diff --git a/main/newscorm/scorm_api.php b/main/newscorm/scorm_api.php index 164a220b42..c2884ad826 100755 --- a/main/newscorm/scorm_api.php +++ b/main/newscorm/scorm_api.php @@ -235,6 +235,21 @@ function LMSInitialize() { //this is the initialize function of all APIobjects olms.G_LastErrorMessage = 'No error'; //reinit to list reinit_updatable_vars_list(); + // Get LMS values for this item + params = { + 'lid': olms.lms_lp_id, + 'uid': olms.lms_user_id, + 'vid': olms.lms_view_id, + 'iid': olms.lms_item_id + }; + $.ajax({ + type: "POST", + url: "lp_ajax_initialize.php", + data: "", + success: function(tmp_data) { + $("#media").html(tmp_data); + } + }); olms.lms_initialized=0; dummy = olms.lesson_location; @@ -245,7 +260,20 @@ function LMSInitialize() { //this is the initialize function of all APIobjects logit_scorm('Error '+ G_InvalidArgumentError + G_InvalidArgumentErrorMessage, 0); return('false'); } else { - logit_scorm('LMSInitialise()',0); + // log a more complete object dump when initializing, so we know what data hasn't been cleaned + var log = '
item : '+ olms.lms_item_id + + '
score : '+ olms.score + + '
max : '+ olms.max + + '
min : '+ olms.min + + '
lesson_status : '+ olms.lesson_status + + '
session_time : '+ olms.session_time + + '
lesson_location : '+ olms.lesson_location + + '
suspend_data : '+ olms.suspend_data + + '
total_time : '+ olms.total_time + + '
mastery_score : '+ olms.mastery_score + + '
max_time_allowed: '+ olms.max_time_allowed+'
'; + + logit_scorm('LMSInitialise()'+log,0); olms.lms_initialized=1; return('true'); } @@ -275,7 +303,7 @@ function LMSGetValue(param) if (olms.lms_initialized == 0) { olms.G_LastError = G_NotInitialized; olms.G_LastErrorMessage = G_NotInitializedMessage; - logit_scorm('Error '+ G_NotInitialized + ' ' +G_NotInitializedMessage, 0); + logit_scorm('LMSGetValue('+param+'):
=> Error '+ G_NotInitialized + ' ' +G_NotInitializedMessage, 0); return ''; }