diff --git a/mod/quiz/review.php b/mod/quiz/review.php index df0d264d1fd..0c82621fb00 100644 --- a/mod/quiz/review.php +++ b/mod/quiz/review.php @@ -38,7 +38,7 @@ require_login($course->id, false, $cm); $isteacher = isteacher($course->id); - $popup = false; // controls whether the protected window is used + $popup = $isteacher ? 0 : $quiz->popup; // Controls whether this is shown in a javascript-protected window. if (!$isteacher) { if (!$attempt->timefinish) { @@ -56,9 +56,6 @@ if (time() >= $quiz->timeclose and !($quiz->review & QUIZ_REVIEW_CLOSED)) { error(get_string("noreview", "quiz")); } - } else { - // immediately after the attempt the review should be in the protected window if required - $popup = $quiz->popup; } if ($attempt->userid != $USER->id) { error("This is not your attempt!"); diff --git a/mod/quiz/view.php b/mod/quiz/view.php index 2bf7c94954f..203c221add4 100644 --- a/mod/quiz/view.php +++ b/mod/quiz/view.php @@ -148,10 +148,16 @@ $strmarks = get_string('marks', 'quiz'); $strbestgrade = $QUIZ_GRADE_METHOD[$quiz->grademethod]; + $windowoptions = "left=0, top=0, channelmode=yes, fullscreen=yes, scrollbars=yes, resizeable=no, directories=no, toolbar=no, titlebar=no, location=no, status=no, menubar=no"; + $mygrade = quiz_get_best_grade($quiz, $USER->id); +/// Now print table with existing attempts + if ($numattempts) { - if ($quiz->grade and $quiz->sumgrades) { + + /// prepare table header + if ($quiz->grade and $quiz->sumgrades) { // Grades used so have more columns in table if ($quiz->grade <> $quiz->sumgrades) { $table->head = array($strattempt, $strtimetaken, $strtimecompleted, "$strmarks / $quiz->sumgrades", "$strgrade / $quiz->grade"); $table->align = array("center", "center", "left", "right", "right"); @@ -161,18 +167,23 @@ $table->align = array("center", "center", "left", "right"); $table->size = array("", "", "", ""); } + } else { // No grades are being used $table->head = array($strattempt, $strtimetaken, $strtimecompleted); $table->align = array("center", "center", "left"); $table->size = array("", "", ""); } + + /// One row for each attempt foreach ($attempts as $attempt) { + + /// prepare strings for time taken and date completed $timetaken = ''; $datecompleted = ''; - if ($attempt->timefinish > 0) { + if ($attempt->timefinish > 0) { // attempt has finished $timetaken = format_time($attempt->timefinish - $attempt->timestart); $datecompleted = userdate($attempt->timefinish); - } else if ($available) { + } else if ($available) { // The student can continue this attempt, so put appropriate link $timetaken = format_time(time() - $attempt->timestart); $strconfirmstartattempt = addslashes(get_string("confirmstartattempt","quiz")); $datecompleted = "\n".'