MDL-52457 mod_scorm: Fix return types definitions in SCORM WS
authorJuan Leyva <juanleyvadelgado@gmail.com>
Wed, 9 Dec 2015 13:02:37 +0000 (14:02 +0100)
committerJuan Leyva <juanleyvadelgado@gmail.com>
Wed, 9 Dec 2015 13:02:37 +0000 (14:02 +0100)
Incorrect return types definitions in external function
mod_scorm_external::get_scorm_by_courses (hidetoc, displayattemptstatus
and skipview)

mod/scorm/classes/external.php
mod/scorm/tests/externallib_test.php

index a67cb74..df9db5a 100644 (file)
@@ -760,16 +760,17 @@ class mod_scorm_external extends external_api {
                                                                     VALUE_OPTIONAL),
                             'lastattemptlock' => new external_value(PARAM_BOOL, 'Prevents to launch new attempts once finished',
                                                                     VALUE_OPTIONAL),
                                                                     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),
                             '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),
                             '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),
                                                             VALUE_OPTIONAL),
                             'nav' => new external_value(PARAM_INT, 'Show navigation buttons', VALUE_OPTIONAL),
                             'navpositionleft' => new external_value(PARAM_INT, 'Navigation position left', VALUE_OPTIONAL),
index d034c0c..dcddafb 100644 (file)
@@ -552,6 +552,9 @@ class mod_scorm_external_testcase extends externallib_advanced_testcase {
         $record = new stdClass();
         $record->introformat = FORMAT_HTML;
         $record->course = $course1->id;
         $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.
         $scorm1 = self::getDataGenerator()->create_module('scorm', $record);
 
         // Second scorm.