From a23fb143e14e3eb5b1483bd86c98cd2be1a6a676 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Wed, 7 Nov 2012 14:36:42 +0100 Subject: [PATCH] Fixing logit_scorm and logit_lms functions, now score is correctly saved --- main/newscorm/scorm_api.php | 38 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/main/newscorm/scorm_api.php b/main/newscorm/scorm_api.php index 26dcafb2af..82e0b25362 100644 --- a/main/newscorm/scorm_api.php +++ b/main/newscorm/scorm_api.php @@ -1092,27 +1092,25 @@ function chamilo_void_save_asset(myscore,mymax) * @param string Message to log * @param integer Priority (0 for top priority, 3 for lowest) */ -function logit_scorm(message,priority) { - //scorm_logs = 10000; +function logit_scorm(message,priority) { if (scorm_logs == 0) { return false; } - if (scorm_logs > priority) { + if (scorm_logs > priority) { /* fixed see http://support.chamilo.org/issues/370 */ if ($("#lp_log_name") && $("#log_content")){ $("#log_content").append("SCORM: " + message + "
"); } - params = { - msg: "SCORM: " + message, - debug: scorm_logs - }; - $.ajax({ - type: "POST", - data: params, - url: "lp_ajax_log.php", - dataType: "script", - async: true - }); - //console.log(message); } + params = { + msg: "SCORM: " + message, + debug: scorm_logs + }; + $.ajax({ + type: "POST", + data: params, + url: "lp_ajax_log.php", + dataType: "script", + async: true + }); } /** @@ -1122,9 +1120,10 @@ function logit_scorm(message,priority) { */ function logit_lms(message, priority){ if (lms_logs >= priority) { - if ($("#lp_log_name") && $("#log_content")) { - $("#log_content").append("LMS: " + message + "
"); - } + if ($("#lp_log_name") && $("#log_content")) { + $("#log_content").append("LMS: " + message + "
"); + } + } params = { msg: "LMS: " + message, debug: lms_logs @@ -1135,8 +1134,7 @@ function logit_lms(message, priority){ url: "lp_ajax_log.php", dataType: "script", async: true - }); - } + }); //console.log(message); }