MDL-16111 - SCORM grade not updated in Grader Report. Thanks John Macklin.
This commit is contained in:
@@ -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)) {
|
||||
|
||||
@@ -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
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user