MDL-16111 - SCORM grade not updated in Grader Report. Thanks John Macklin.

This commit is contained in:
piers
2008-08-21 03:12:08 +00:00
parent 19f1d26224
commit 7ef16bf927
4 changed files with 16 additions and 6 deletions
+3 -1
View File
@@ -248,7 +248,9 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
}
$strsuspended = get_string('suspended','scorm');
if (isset($usertrack->{'cmi.core.exit'}) && ($usertrack->{'cmi.core.exit'} == 'suspend')) {
$statusicon = '<img src="'.$scormpixdir.'/suspend.gif" alt="'.$strstatus.' - '.$strsuspended.'" title="'.$strstatus.' - '.$strsuspended.'" />';
if($usertrack->status !='completed') {
$statusicon = '<img src="'.$scormpixdir.'/suspend.gif" alt="'.$strstatus.' - '.$strsuspended.'" title="'.$strstatus.' - '.$strsuspended.'" />';
}
}
} else {
if ($play && empty($scoid)) {
+3 -1
View File
@@ -140,7 +140,9 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
}
$strsuspended = get_string('suspended','scorm');
if (isset($usertrack->{'cmi.core.exit'}) && ($usertrack->{'cmi.core.exit'} == 'suspend')) {
$statusicon = '<img src="'.$scormpixdir.'/suspend.gif" alt="'.$strstatus.' - '.$strsuspended.'" title="'.$strstatus.' - '.$strsuspended.'" />';
if($usertrack->status !='completed') {
$statusicon = '<img src="'.$scormpixdir.'/suspend.gif" alt="'.$strstatus.' - '.$strsuspended.'" title="'.$strstatus.' - '.$strsuspended.'" />';
}
}
} else {
if ($play && empty($scoid)) {
+7 -3
View File
@@ -124,7 +124,8 @@ function scorm_update_instance($scorm) {
}
if ($result = $DB->update_record('scorm', $scorm)) {
scorm_grade_item_update($scorm);
scorm_grade_item_update(stripslashes_recursive($scorm));
//scorm_grade_item_update($scorm); // John Macklins fix - dont think this is needed
}
return $result;
@@ -505,8 +506,11 @@ function scorm_grade_item_update($scorm, $grades=NULL) {
require_once($CFG->libdir.'/gradelib.php');
}
$params = array('itemname'=>$scorm->name, 'idnumber'=>$scorm->cmidnumber);
$params = array('itemname'=>$scorm->name);
if (isset($scorm->cmidnumber)) {
$params['idnumber'] = $scorm->cmidnumber;
}
if (($scorm->grademethod % 10) == 0) { // GRADESCOES
if ($maxgrade = $DB->count_records_select('scorm_scoes', 'scorm = ? AND launch <> ?', array($scorm->id, ''))) {
$params['gradetype'] = GRADE_TYPE_VALUE;
+3 -1
View File
@@ -368,7 +368,9 @@ function scorm_grade_user_attempt($scorm, $userid, $attempt=1, $time=false) {
break;
case GRADESCOES:
$score = $attemptscore->scoes;
break;
break;
default:
$score = $attemptscore->max; // Remote Learner GRADEHIGHEST is default
}
if ($time) {