From 4f3d1b0ec6f834d30a1f4d448c5a676bff0adc07 Mon Sep 17 00:00:00 2001 From: Juan Leyva Date: Wed, 9 Dec 2015 14:02:37 +0100 Subject: [PATCH] MDL-52457 mod_scorm: Fix return types definitions in SCORM WS Incorrect return types definitions in external function mod_scorm_external::get_scorm_by_courses (hidetoc, displayattemptstatus and skipview) --- mod/scorm/classes/external.php | 7 ++++--- mod/scorm/tests/externallib_test.php | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mod/scorm/classes/external.php b/mod/scorm/classes/external.php index a67cb7469cfbc..df9db5a1a4a1c 100644 --- a/mod/scorm/classes/external.php +++ b/mod/scorm/classes/external.php @@ -760,16 +760,17 @@ public static function get_scorms_by_courses_returns() { VALUE_OPTIONAL), 'lastattemptlock' => new external_value(PARAM_BOOL, 'Prevents to launch new attempts once finished', VALUE_OPTIONAL), - 'displayattemptstatus' => new external_value(PARAM_BOOL, 'Display attempts status', VALUE_OPTIONAL), + 'displayattemptstatus' => new external_value(PARAM_INT, 'How to display attempt status', + VALUE_OPTIONAL), 'displaycoursestructure' => new external_value(PARAM_BOOL, 'Display contents structure', VALUE_OPTIONAL), 'sha1hash' => new external_value(PARAM_NOTAGS, 'Package content or ext path hash', VALUE_OPTIONAL), 'md5hash' => new external_value(PARAM_NOTAGS, 'MD5 Hash of package file', VALUE_OPTIONAL), 'revision' => new external_value(PARAM_INT, 'Revison number', VALUE_OPTIONAL), 'launch' => new external_value(PARAM_INT, 'First content to launch', VALUE_OPTIONAL), - 'skipview' => new external_value(PARAM_BOOL, 'Skip or not content structure page', VALUE_OPTIONAL), + 'skipview' => new external_value(PARAM_INT, 'How to skip the content structure page', VALUE_OPTIONAL), 'hidebrowse' => new external_value(PARAM_BOOL, 'Disable preview mode?', VALUE_OPTIONAL), - 'hidetoc' => new external_value(PARAM_BOOL, 'Display or not course structure in player', + 'hidetoc' => new external_value(PARAM_INT, 'How to display the SCORM structure in player', VALUE_OPTIONAL), 'nav' => new external_value(PARAM_INT, 'Show navigation buttons', VALUE_OPTIONAL), 'navpositionleft' => new external_value(PARAM_INT, 'Navigation position left', VALUE_OPTIONAL), diff --git a/mod/scorm/tests/externallib_test.php b/mod/scorm/tests/externallib_test.php index d034c0c1d9b50..dcddafb3897a8 100644 --- a/mod/scorm/tests/externallib_test.php +++ b/mod/scorm/tests/externallib_test.php @@ -552,6 +552,9 @@ public function test_mod_scorm_get_scorms_by_courses() { $record = new stdClass(); $record->introformat = FORMAT_HTML; $record->course = $course1->id; + $record->hidetoc = 2; + $record->displayattemptstatus = 2; + $record->skipview = 2; $scorm1 = self::getDataGenerator()->create_module('scorm', $record); // Second scorm.