Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed comments_from_learner data element to fit ADL requirements

  • Loading branch information...
commit 04231a954751ec038fb65d748c64bc1425df4985 1 parent cfa7cdb
bobopinna authored
Showing with 9 additions and 14 deletions.
  1. +9 −14 mod/scorm/datamodels/scorm_13.js.php
View
23 mod/scorm/datamodels/scorm_13.js.php
@@ -273,7 +273,7 @@ function GetValue (element) {
errorCode = "0";
<?php
if (debugging('',DEBUG_DEVELOPER)) {
- echo 'alert(element+": "+eval(element));';
+ echo 'alert("GetValue("+element+") -> "+eval(element));';
}
?>
return eval(element);
@@ -361,7 +361,7 @@ function SetValue (element,value) {
} else {
subelement = subelement.concat('.'+elementIndex);
}
- if ((typeof eval(subelement)) == "undefined") {
+ if (((typeof eval(subelement)) == "undefined") && (errorCode == "0")) {
eval(subelement+' = new Object();');
if (subelement.substr(0,14) == 'cmi.objectives') {
eval(subelement+'.score = new Object();');
@@ -377,6 +377,11 @@ function SetValue (element,value) {
eval(subelement+'.correct_responses = new Object();');
eval(subelement+'.correct_responses._count = 0;');
}
+ if (subelement.substr(0,25) == 'cmi.comments_from_learner') {
+ eval(subelement+'.comment = "";');
+ eval(subelement+'.location = "";');
+ eval(subelement+'.timestamp = "";');
+ }
}
}
element = subelement.concat('.'+elementIndexes[elementIndexes.length-1]);
@@ -393,7 +398,7 @@ function SetValue (element,value) {
errorCode = "0";
<?php
if (debugging('',DEBUG_DEVELOPER)) {
- echo 'alert(element+":= "+value);';
+ echo 'alert("SetValue("+element+","+value+") -> OK");';
}
?>
return "true";
@@ -408,7 +413,7 @@ function SetValue (element,value) {
errorCode = "0";
<?php
if (debugging('',DEBUG_DEVELOPER)) {
- echo 'alert(element+":= "+value);';
+ echo 'alert("SetValue("+element+","+value+") -> OK");';
}
?>
return "true";
@@ -621,11 +626,6 @@ function AddTime (first, second) {
}
function TotalTime() {
- <?php
- if (debugging('',DEBUG_DEVELOPER)) {
- echo 'alert("TotalTime");';
- }
- ?>
total_time = AddTime(cmi.total_time, cmi.session_time);
return '&'+underscore('cmi.total_time')+'='+escape(total_time);
}
@@ -657,11 +657,6 @@ function CollectData(data,parent) {
}
function StoreData(data,storetotaltime) {
- <?php
- if (debugging('',DEBUG_DEVELOPER)) {
- echo 'alert("StoreData");';
- }
- ?>
if (storetotaltime) {
if (cmi.mode == 'normal') {
if (cmi.credit == 'credit') {
Please sign in to comment.
Something went wrong with that request. Please try again.