Permalink
Browse files

Added cmi.core.score.min/max support to API

  • Loading branch information...
bobopinna
bobopinna committed Jun 10, 2004
1 parent 4a9df37 commit 415807c02d4f1dd25a1a1fcea84807ab5e1bf9c1
Showing with 7 additions and 1 deletion.
  1. +5 −1 mod/scorm/api1_2.php
  2. +2 −0 mod/scorm/backuplib.php
View
@@ -23,7 +23,7 @@
cmi.core.lesson_mode = "<?php echo $mode; ?>";
cmi.core.score = new Object();
- cmi.core.score._children = "raw";
+ cmi.core.score._children = "raw,min,max";
cmi.core.score.raw = "<?php echo $sco_user->cmi_core_score_raw; ?>";
cmi.suspend_data = "<?php echo $sco_user->cmi_suspend_data; ?>";
cmi.launch_data = "<?php echo $sco_user->cmi_launch_data; ?>";
@@ -98,6 +98,7 @@ function LMSGetValue (param) {
function LMSSetValue (param,value) {
if (Initialized) {
//top.status="SET "+param+" = "+value;
+ //top.alert("SET "+param+" = "+value);
switch (param) {
case "cmi.core.session_time":
cmi.core.total_time = AddTime(cmi.core.total_time, value);
@@ -116,6 +117,9 @@ function LMSSetValue (param,value) {
return "true";
break;
case "cmi.core.score.raw":
+ case "cmi.core.score.min":
+ case "cmi.core.score.max":
+ //top.alert("SET "+param+" = "+value);
if ((parseFloat(value,10)).toString() != value) {
errorCode = 405;
return "false";
View
@@ -49,6 +49,7 @@ function scorm_backup_mods($bf,$preferences) {
fwrite ($bf,full_tag("AUTO",4,false,$scorm->auto));
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$scorm->timemodified));
$status = backup_scorm_scoes($bf,$preferences,$scorm->id);
+
//if we've selected to backup users info, then execute backup_scorm_sco_users
if ($status) {
if ($preferences->mods["scorm"]->userinfo) {
@@ -62,6 +63,7 @@ function scorm_backup_mods($bf,$preferences) {
if ($status) {
$status = backup_scorm_files($bf,$preferences);
}
+
}
return $status;
}

0 comments on commit 415807c

Please sign in to comment.