|
|
@ -233,7 +233,17 @@ function LMSInitialize() { //this is the initialize function of all APIobjects |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
olms.G_LastError = G_NoError ; |
|
|
|
olms.G_LastError = G_NoError ; |
|
|
|
olms.G_LastErrorMessage = 'No error'; |
|
|
|
olms.G_LastErrorMessage = 'No error'; |
|
|
|
//reinit to list |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
olms.lms_initialized=0; |
|
|
|
|
|
|
|
// if there are more parameters than "" |
|
|
|
|
|
|
|
if (arguments.length>1) { |
|
|
|
|
|
|
|
olms.G_LastError = G_InvalidArgumentError; |
|
|
|
|
|
|
|
olms.G_LastErrorMessage = G_InvalidArgumentErrorMessage; |
|
|
|
|
|
|
|
logit_scorm('Error '+ G_InvalidArgumentError + G_InvalidArgumentErrorMessage, 0); |
|
|
|
|
|
|
|
return('false'); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
//reinit the list of modified variables |
|
|
|
reinit_updatable_vars_list(); |
|
|
|
reinit_updatable_vars_list(); |
|
|
|
// Get LMS values for this item |
|
|
|
// Get LMS values for this item |
|
|
|
params = { |
|
|
|
params = { |
|
|
@ -245,21 +255,10 @@ function LMSInitialize() { //this is the initialize function of all APIobjects |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
type: "POST", |
|
|
|
type: "POST", |
|
|
|
url: "lp_ajax_initialize.php", |
|
|
|
url: "lp_ajax_initialize.php", |
|
|
|
data: "", |
|
|
|
data: params, |
|
|
|
success: function(tmp_data) { |
|
|
|
dataType: 'script', |
|
|
|
$("#media").html(tmp_data); |
|
|
|
async: false |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
olms.lms_initialized=0; |
|
|
|
|
|
|
|
dummy = olms.lesson_location; |
|
|
|
|
|
|
|
// if there are more parameters than "" |
|
|
|
|
|
|
|
if (arguments.length>1) { |
|
|
|
|
|
|
|
olms.G_LastError = G_InvalidArgumentError; |
|
|
|
|
|
|
|
olms.G_LastErrorMessage = G_InvalidArgumentErrorMessage; |
|
|
|
|
|
|
|
logit_scorm('Error '+ G_InvalidArgumentError + G_InvalidArgumentErrorMessage, 0); |
|
|
|
|
|
|
|
return('false'); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// log a more complete object dump when initializing, so we know what data hasn't been cleaned |
|
|
|
// log a more complete object dump when initializing, so we know what data hasn't been cleaned |
|
|
|
var log = '<br />item : '+ olms.lms_item_id |
|
|
|
var log = '<br />item : '+ olms.lms_item_id |
|
|
|
+ '<br />score : '+ olms.score |
|
|
|
+ '<br />score : '+ olms.score |
|
|
@ -346,7 +345,7 @@ function LMSGetValue(param) |
|
|
|
olms.G_LastError = G_ElementIsWriteOnly; |
|
|
|
olms.G_LastError = G_ElementIsWriteOnly; |
|
|
|
}else if(param == 'cmi.core.lesson_status'){ |
|
|
|
}else if(param == 'cmi.core.lesson_status'){ |
|
|
|
// ---- cmi.core.lesson_status |
|
|
|
// ---- cmi.core.lesson_status |
|
|
|
if(lesson_status != '') { |
|
|
|
if(olms.lesson_status != '') { |
|
|
|
result=olms.lesson_status; |
|
|
|
result=olms.lesson_status; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
//result='not attempted'; |
|
|
|
//result='not attempted'; |
|
|
@ -857,7 +856,7 @@ function LMSFinish(val) { |
|
|
|
olms.commit = false; |
|
|
|
olms.commit = false; |
|
|
|
//} |
|
|
|
//} |
|
|
|
|
|
|
|
|
|
|
|
//reinit to list |
|
|
|
//reinit the list of modified variables |
|
|
|
reinit_updatable_vars_list() |
|
|
|
reinit_updatable_vars_list() |
|
|
|
return('true'); |
|
|
|
return('true'); |
|
|
|
} |
|
|
|
} |
|
|
@ -1461,35 +1460,35 @@ function xajax_save_item_scorm(lms_lp_id, lms_user_id, lms_view_id, lms_item_id) |
|
|
|
var is_interactions='false'; |
|
|
|
var is_interactions='false'; |
|
|
|
var params=''; |
|
|
|
var params=''; |
|
|
|
params += 'lid='+lms_lp_id+'&uid='+lms_user_id+'&vid='+lms_view_id+'&iid='+lms_item_id; |
|
|
|
params += 'lid='+lms_lp_id+'&uid='+lms_user_id+'&vid='+lms_view_id+'&iid='+lms_item_id; |
|
|
|
var my_get_value_scorm=new Array(); |
|
|
|
var my_scorm_values=new Array(); |
|
|
|
my_get_value_scorm=process_scorm_values(); |
|
|
|
my_scorm_values=process_scorm_values(); |
|
|
|
|
|
|
|
|
|
|
|
for (k=0;k<info_get_lms.length;k++) { |
|
|
|
for (k=0;k<my_scorm_values.length;k++) { |
|
|
|
if (my_get_value_scorm[k]=='cmi.core.session_time') { |
|
|
|
if (my_scorm_values[k]=='cmi.core.session_time') { |
|
|
|
params += '&t='+olms.session_time; |
|
|
|
params += '&t='+olms.session_time; |
|
|
|
} else if (my_get_value_scorm[k]=='cmi.core.lesson_status' && lesson_status!='') { |
|
|
|
} else if (my_scorm_values[k]=='cmi.core.lesson_status' && lesson_status!='') { |
|
|
|
params += '&status='+olms.lesson_status; |
|
|
|
params += '&status='+olms.lesson_status; |
|
|
|
} else if (my_get_value_scorm[k]=='cmi.core.score.raw') { |
|
|
|
} else if (my_scorm_values[k]=='cmi.core.score.raw') { |
|
|
|
params += '&s='+olms.score; |
|
|
|
params += '&s='+olms.score; |
|
|
|
} else if (my_get_value_scorm[k]=='cmi.core.score.max') { |
|
|
|
} else if (my_scorm_values[k]=='cmi.core.score.max') { |
|
|
|
params += '&max='+olms.max; |
|
|
|
params += '&max='+olms.max; |
|
|
|
} else if (my_get_value_scorm[k]=='cmi.core.score.min') { |
|
|
|
} else if (my_scorm_values[k]=='cmi.core.score.min') { |
|
|
|
params += '&min='+olms.min; |
|
|
|
params += '&min='+olms.min; |
|
|
|
} else if (my_get_value_scorm[k]=='cmi.core.lesson_location') { |
|
|
|
} else if (my_scorm_values[k]=='cmi.core.lesson_location') { |
|
|
|
params += '&loc='+olms.lesson_location; |
|
|
|
params += '&loc='+olms.lesson_location; |
|
|
|
} else if (my_get_value_scorm[k]=='cmi.completion_status') { |
|
|
|
} else if (my_scorm_values[k]=='cmi.completion_status') { |
|
|
|
|
|
|
|
|
|
|
|
} else if (my_get_value_scorm[k]=='cmi.score.scaled') { |
|
|
|
} else if (my_scorm_values[k]=='cmi.score.scaled') { |
|
|
|
|
|
|
|
|
|
|
|
} else if (my_get_value_scorm[k]=='cmi.suspend_data') { |
|
|
|
} else if (my_scorm_values[k]=='cmi.suspend_data') { |
|
|
|
params += '&suspend='+olms.suspend_data; |
|
|
|
params += '&suspend='+olms.suspend_data; |
|
|
|
} else if (my_get_value_scorm[k]=='cmi.completion_status') { |
|
|
|
} else if (my_scorm_values[k]=='cmi.completion_status') { |
|
|
|
|
|
|
|
|
|
|
|
} else if (my_get_value_scorm[k]=='cmi.core.exit') { |
|
|
|
} else if (my_scorm_values[k]=='cmi.core.exit') { |
|
|
|
params += '&core_exit='+olms.lms_item_core_exit; |
|
|
|
params += '&core_exit='+olms.lms_item_core_exit; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (my_get_value_scorm[k]=='interactions') { |
|
|
|
if (my_scorm_values[k]=='interactions') { |
|
|
|
is_interactions='true'; |
|
|
|
is_interactions='true'; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
is_interactions='false'; |
|
|
|
is_interactions='false'; |
|
|
@ -1530,7 +1529,7 @@ function xajax_save_item_scorm(lms_lp_id, lms_user_id, lms_view_id, lms_item_id) |
|
|
|
async: false |
|
|
|
async: false |
|
|
|
}); |
|
|
|
}); |
|
|
|
params=''; |
|
|
|
params=''; |
|
|
|
my_get_value_scorm = null; |
|
|
|
my_scorm_values = null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|