Merge pull request #3768 from alfonso-salces/MOBILE-4191

MOBILE-4191 scorm: Make options field optional
main
Dani Palou 2023-08-02 08:20:23 +02:00 committed by GitHub
commit 284111865f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -1124,11 +1124,13 @@ export class AddonModScormProvider {
currentScorm.warningMessage = warning?.message; currentScorm.warningMessage = warning?.message;
} }
if (response.options) {
const scormOptions = CoreUtils.objectToKeyValueMap(response.options, 'name', 'value'); const scormOptions = CoreUtils.objectToKeyValueMap(response.options, 'name', 'value');
if (scormOptions.scormstandard) { if (scormOptions.scormstandard) {
currentScorm.scormStandard = Number(scormOptions.scormstandard); currentScorm.scormStandard = Number(scormOptions.scormstandard);
} }
}
currentScorm.moduleurl = options.moduleUrl; currentScorm.moduleurl = options.moduleUrl;
@ -1871,7 +1873,7 @@ export type AddonModScormGetScormsByCoursesWSParams = {
* Data returned by mod_scorm_get_scorms_by_courses WS. * Data returned by mod_scorm_get_scorms_by_courses WS.
*/ */
export type AddonModScormGetScormsByCoursesWSResponse = { export type AddonModScormGetScormsByCoursesWSResponse = {
options: AddonModScormOptions[]; options?: AddonModScormOptions[]; // @since v4.3. Scorm options
scorms: AddonModScormScormWSData[]; scorms: AddonModScormScormWSData[];
warnings?: CoreWSExternalWarning[]; warnings?: CoreWSExternalWarning[];
}; };