MDL-19442 - fix type cast of values for gradebook calculations
This commit is contained in:
@@ -443,7 +443,7 @@ function scorm_get_tracks($scoid,$userid,$attempt='') {
|
||||
break;
|
||||
case 'cmi.core.score.raw':
|
||||
case 'cmi.score.raw':
|
||||
$usertrack->score_raw = sprintf('%0d', $track->value);
|
||||
$usertrack->score_raw = (float) sprintf('%2.2f', $track->value);
|
||||
break;
|
||||
case 'cmi.core.session_time':
|
||||
case 'cmi.session_time':
|
||||
@@ -544,7 +544,7 @@ function scorm_grade_user_attempt($scorm, $userid, $attempt=1, $time=false) {
|
||||
}
|
||||
switch ($scorm->grademethod) {
|
||||
case GRADEHIGHEST:
|
||||
$score = $attemptscore->max;
|
||||
$score = (float) $attemptscore->max;
|
||||
break;
|
||||
case GRADEAVERAGE:
|
||||
if ($attemptscore->values > 0) {
|
||||
|
||||
Reference in New Issue
Block a user