From 3bd6b6e29cacbc91127b29ccb116caaa615ce65e Mon Sep 17 00:00:00 2001 From: Juan Cortizas Ponte <48205899+juan-cortizas-ponte@users.noreply.github.com> Date: Wed, 13 Apr 2022 17:38:02 +0200 Subject: [PATCH] Refactoring code to fix IExplorer support --- main/lp/scorm_api.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/main/lp/scorm_api.php b/main/lp/scorm_api.php index 59049d343a..3413210a01 100755 --- a/main/lp/scorm_api.php +++ b/main/lp/scorm_api.php @@ -874,10 +874,10 @@ function SetValue(param, val) { /** * Saves the current data from JS memory to the LMS database */ -function savedata(item_id, forceIframeSave) { - if (!forceIframeSave) { - forceIframeSave = 0; - } +function savedata(item_id) { + var forceIframeSave = arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : 0; // Origin can be 'commit', 'finish' or 'terminate' (depending on the calling function) logit_lms('function savedata(' + item_id + ')', 3); @@ -887,10 +887,6 @@ function savedata(item_id, forceIframeSave) { //olms.updatable_vars_list['cmi.core.lesson_status'] = true; } - if (typeof(forceIframeSave) == 'undefined') { - forceIframeSave = 0; - } - old_item_id = olms.info_lms_item[0]; var item_to_save = olms.lms_item_id; logit_lms('item_to_save (original value): ' + item_to_save, 3);