diff --git a/mod/quiz/review.php b/mod/quiz/review.php index d67a46140b6..6b157579171 100644 --- a/mod/quiz/review.php +++ b/mod/quiz/review.php @@ -160,61 +160,63 @@ if ($attemptobj->has_capability('mod/quiz:viewreports')) { } } -// Timing information. -$rows[] = '' . get_string('startedon', 'quiz') . - '' . userdate($attempt->timestart) . ''; -if ($attempt->timefinish) { - $rows[] = '' . get_string('completedon', 'quiz') . '' . - userdate($attempt->timefinish) . ''; - $rows[] = '' . get_string('timetaken', 'quiz') . '' . - $timetaken . ''; -} -if (!empty($overtime)) { - $rows[] = '' . get_string('overdue', 'quiz') . '' . $overtime . ''; -} - -// Show marks (if the user is allowed to see marks at the moment). -$grade = quiz_rescale_grade($attempt->sumgrades, $quiz, false); -if ($options->marks && quiz_has_grades($quiz)) { - - if (!$attempt->timefinish) { - $rows[] = '' . get_string('grade') . '' . - get_string('attemptstillinprogress', 'quiz') . ''; - - } else if (is_null($grade)) { - $rows[] = '' . get_string('grade') . '' . - quiz_format_grade($quiz, $grade) . ''; - - } else { - // Show raw marks only if they are different from the grade (like on the view page). - if ($quiz->grade != $quiz->sumgrades) { - $a = new stdClass(); - $a->grade = quiz_format_grade($quiz, $attempt->sumgrades); - $a->maxgrade = quiz_format_grade($quiz, $quiz->sumgrades); - $rows[] = '' . get_string('marks', 'quiz') . '' . - get_string('outofshort', 'quiz', $a) . ''; - } - - // Now the scaled grade. - $a = new stdClass(); - $a->grade = '' . quiz_format_grade($quiz, $grade) . ''; - $a->maxgrade = quiz_format_grade($quiz, $quiz->grade); - if ($quiz->grade != 100) { - $a->percent = '' . round($attempt->sumgrades * 100 / $quiz->sumgrades, 0) . ''; - $formattedgrade = get_string('outofpercent', 'quiz', $a); - } else { - $formattedgrade = get_string('outof', 'quiz', $a); - } - $rows[] = '' . get_string('grade') . '' . - $formattedgrade . ''; +if ($page == 0) { + // Timing information. + $rows[] = '' . get_string('startedon', 'quiz') . + '' . userdate($attempt->timestart) . ''; + if ($attempt->timefinish) { + $rows[] = '' . get_string('completedon', 'quiz') . '' . + userdate($attempt->timefinish) . ''; + $rows[] = '' . get_string('timetaken', 'quiz') . '' . + $timetaken . ''; + } + if (!empty($overtime)) { + $rows[] = '' . get_string('overdue', 'quiz') . '' . $overtime . ''; } -} -// Feedback if there is any, and the user is allowed to see it now. -$feedback = $attemptobj->get_overall_feedback($grade); -if ($options->overallfeedback && $feedback) { - $rows[] = '' . get_string('feedback', 'quiz') . - '' . $feedback . ''; + // Show marks (if the user is allowed to see marks at the moment). + $grade = quiz_rescale_grade($attempt->sumgrades, $quiz, false); + if ($options->marks && quiz_has_grades($quiz)) { + + if (!$attempt->timefinish) { + $rows[] = '' . get_string('grade') . '' . + get_string('attemptstillinprogress', 'quiz') . ''; + + } else if (is_null($grade)) { + $rows[] = '' . get_string('grade') . '' . + quiz_format_grade($quiz, $grade) . ''; + + } else { + // Show raw marks only if they are different from the grade (like on the view page). + if ($quiz->grade != $quiz->sumgrades) { + $a = new stdClass(); + $a->grade = quiz_format_grade($quiz, $attempt->sumgrades); + $a->maxgrade = quiz_format_grade($quiz, $quiz->sumgrades); + $rows[] = '' . get_string('marks', 'quiz') . '' . + get_string('outofshort', 'quiz', $a) . ''; + } + + // Now the scaled grade. + $a = new stdClass(); + $a->grade = '' . quiz_format_grade($quiz, $grade) . ''; + $a->maxgrade = quiz_format_grade($quiz, $quiz->grade); + if ($quiz->grade != 100) { + $a->percent = '' . round($attempt->sumgrades * 100 / $quiz->sumgrades, 0) . ''; + $formattedgrade = get_string('outofpercent', 'quiz', $a); + } else { + $formattedgrade = get_string('outof', 'quiz', $a); + } + $rows[] = '' . get_string('grade') . '' . + $formattedgrade . ''; + } + } + + // Feedback if there is any, and the user is allowed to see it now. + $feedback = $attemptobj->get_overall_feedback($grade); + if ($options->overallfeedback && $feedback) { + $rows[] = '' . get_string('feedback', 'quiz') . + '' . $feedback . ''; + } } // Now output the summary table, if there are any rows to be shown. diff --git a/question/engine/simpletest/helpers.php b/question/engine/simpletest/helpers.php index c37fa75975c..dd1bc955211 100644 --- a/question/engine/simpletest/helpers.php +++ b/question/engine/simpletest/helpers.php @@ -195,7 +195,7 @@ class test_question_maker { self::set_standard_combined_feedback_fields($match); - // Using unset to get 1-based arrays. + // Using unset to get 1-based arrays. $match->stems = array('', 'Dog', 'Frog', 'Toad', 'Cat'); $match->stemformat = array('', FORMAT_HTML, FORMAT_HTML, FORMAT_HTML, FORMAT_HTML); $match->choices = array('', 'Mammal', 'Amphibian', 'Insect');