mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 00:16:46 +02:00
SCORM MDL-24734 - fix display of grade information on view.php page - also fixes some XHTML in the same function.
This commit is contained in:
parent
91787c37e1
commit
4f4a8acf3b
1 changed files with 14 additions and 6 deletions
|
@ -1009,11 +1009,11 @@ function scorm_get_attempt_status($user, $scorm) {
|
|||
|
||||
$result = '<p>'.get_string('noattemptsallowed', 'scorm').': ';
|
||||
if ($scorm->maxattempt > 0) {
|
||||
$result .= $scorm->maxattempt . '<BR>';
|
||||
$result .= $scorm->maxattempt . '<br />';
|
||||
} else {
|
||||
$result .= get_string('unlimited').'<BR>';
|
||||
$result .= get_string('unlimited').'<br />';
|
||||
}
|
||||
$result .= get_string('noattemptsmade', 'scorm').': ' . $attemptcount . '<BR>';
|
||||
$result .= get_string('noattemptsmade', 'scorm').': ' . $attemptcount . '<br />';
|
||||
|
||||
if ($scorm->maxattempt == 1) {
|
||||
switch ($scorm->grademethod) {
|
||||
|
@ -1051,16 +1051,24 @@ function scorm_get_attempt_status($user, $scorm) {
|
|||
$i = 1;
|
||||
foreach($attempts as $attempt) {
|
||||
$gradereported = scorm_grade_user_attempt($scorm, $user->id, $attempt->attemptnumber);
|
||||
$result .= get_string('gradeforattempt', 'scorm').' ' . $i . ': ' . $gradereported .'%<BR>';
|
||||
if ($scorm->grademethod !== GRADESCOES && !empty($scorm->maxgrade)) {
|
||||
$gradereported = $gradereported/$scorm->maxgrade;
|
||||
$gradereported = number_format($gradereported*100, 0) .'%';
|
||||
}
|
||||
$result .= get_string('gradeforattempt', 'scorm').' ' . $i . ': ' . $gradereported .'<br />';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$calculatedgrade = scorm_grade_user($scorm, $user->id);
|
||||
if ($scorm->grademethod !== GRADESCOES && !empty($scorm->maxgrade)) {
|
||||
$calculatedgrade = $calculatedgrade/$scorm->maxgrade;
|
||||
$calculatedgrade = number_format($calculatedgrade*100, 0) .'%';
|
||||
}
|
||||
$result .= get_string('grademethod', 'scorm'). ': ' . $grademethod;
|
||||
if(empty($attempts)) {
|
||||
$result .= '<BR>' . get_string('gradereported','scorm') . ': ' . get_string('none') . '<BR>';
|
||||
$result .= '<br />' . get_string('gradereported','scorm') . ': ' . get_string('none') . '<br />';
|
||||
} else {
|
||||
$result .= '<BR>' . get_string('gradereported','scorm') . ': ' . $calculatedgrade . ($scorm->grademethod == GRADESCOES ? '' : '%') .'<BR>';
|
||||
$result .= '<br />' . get_string('gradereported','scorm') . ': ' . $calculatedgrade . '<br />';
|
||||
}
|
||||
$result .= '</p>';
|
||||
if ($attemptcount >= $scorm->maxattempt and $scorm->maxattempt > 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue