]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-11617 - 'Student may review' heading on quiz settings form is now misleading...
authortjhunt <tjhunt>
Tue, 9 Oct 2007 15:19:07 +0000 (15:19 +0000)
committertjhunt <tjhunt>
Tue, 9 Oct 2007 15:19:07 +0000 (15:19 +0000)
lang/en_utf8/help/quiz/review2.html
lang/en_utf8/help/quiz/reviewoptions.html [new file with mode: 0644]
lang/en_utf8/quiz.php
mod/quiz/locallib.php
mod/quiz/mod_form.php

index 9ffd516e465e96c6b8805b1a3ca411f55fee399a..69ecf976b128cab4bcb718deda96127787519612 100644 (file)
@@ -3,3 +3,4 @@
 <p>This option controls whether and when students will be able to 
    review their past attempts at this quiz.</p>
 
+<!-- The page was used in Moodle 1.8, but no longer used in Moodle 1.9 -->
\ No newline at end of file
diff --git a/lang/en_utf8/help/quiz/reviewoptions.html b/lang/en_utf8/help/quiz/reviewoptions.html
new file mode 100644 (file)
index 0000000..2ea273e
--- /dev/null
@@ -0,0 +1,18 @@
+<h1>Allow review</h1>
+
+<p>These options control what information users can see when they review a
+quiz attempt or look at the quiz reports.</p>
+
+<p>Immediately after the attempt means within two minuets of the attempt being
+finished by the user clicking 'Submit all and finish'.</p>
+
+<p>Later, while the quiz is still open means after this, and before the quiz
+close date.</p>
+
+<p>After the quiz is closed means after the quiz close date has passed. If
+the quiz does not have a close date, this state is never reached.</p>
+
+<p>Users with the capability 'View hidden grades' [moodle/grade:viewhidden]
+(typically teachers and administrators) are not affected by these settings
+and will always by able to review all information about a student's attempt
+at any time.</p>
\ No newline at end of file
index d3e8f9e866717ec5c2b42a9a9f578545df143e11..d86002802a136dd3bde40827283a73d1f827c423 100644 (file)
@@ -488,6 +488,7 @@ $string['reviewnever'] = 'Never allow review';
 $string['reviewofattempt'] = 'Review of Attempt $a';
 $string['reviewopen'] = 'Later, while the quiz is still open';
 $string['reviewoptions'] = 'Students may review';
+$string['reviewoptionsheading'] = 'Review options';
 $string['reviewresponse'] = 'Review response';
 $string['rqp'] = 'Remote Question';
 $string['rqps'] = 'Remote Questions';
index 7bba35e567f80a3732d751c35ef2c9cabf6441ff..0ec0677999cea62f936dac7713d35ba56d16972a 100644 (file)
@@ -707,45 +707,43 @@ function quiz_get_renderoptions($reviewoptions, $state) {
  *          correct_responses, solutions and general feedback
  */
 function quiz_get_reviewoptions($quiz, $attempt, $context=null) {
-    
-    global $CFG;
-
     $options = new stdClass;
     $options->readonly = true;
+
     // Provide the links to the question review and comment script
     $options->questionreviewlink = '/mod/quiz/reviewquestion.php';
 
-    // Work out the state of the attempt.
-    if (((time() - $attempt->timefinish) < 120) || $attempt->timefinish==0) {
-        $quiz_state_mask = QUIZ_REVIEW_IMMEDIATELY;
-        $options->quizstate = QUIZ_STATE_IMMEDIATELY;
-    } else if (!$quiz->timeclose or time() < $quiz->timeclose) {
-        $quiz_state_mask = QUIZ_REVIEW_OPEN;
-        $options->quizstate = QUIZ_STATE_OPEN;
-    } else {
-        $quiz_state_mask = QUIZ_REVIEW_CLOSED;
-        $options->quizstate = QUIZ_STATE_CLOSED;
+    // Show a link to the comment box only for closed attempts
+    if ($attempt->timefinish && has_capability('mod/quiz:grade', $context)) {
+        $options->questioncommentlink = '/mod/quiz/comment.php';
     }
 
-    if (!is_null($context) && has_capability('mod/quiz:viewreports', $context) and !$attempt->preview) {
-        // The teacher should be shown everything except:
-        //  - during preview when teachers want to see what students see
-        //  - hidden scores are controlled by the moodle/grade:viewhidden capability
+    if (!is_null($context) && has_capability('mod/quiz:viewreports', $context) && 
+            has_capability('moodle/grade:viewhidden', $context) && !$attempt->preview) {
+        // People who can see reports and hidden grades should be shown everything,
+        // except during preview when teachers want to see what students see.
         $options->responses = true;
-        $options->scores = ($quiz->review & $quiz_state_mask & QUIZ_REVIEW_SCORES) ||
-                has_capability('moodle/grade:viewhidden', $context); 
+        $options->scores = true; 
         $options->feedback = true;
         $options->correct_responses = true;
         $options->solutions = false;
         $options->generalfeedback = true;
         $options->overallfeedback = true;
         $options->quizstate = QUIZ_STATE_TEACHERACCESS;
-
-        // Show a link to the comment box only for closed attempts
-        if ($attempt->timefinish) {
-            $options->questioncommentlink = '/mod/quiz/comment.php';
-        }
     } else {
+        // Work out the state of the attempt ...
+        if (((time() - $attempt->timefinish) < 120) || $attempt->timefinish==0) {
+            $quiz_state_mask = QUIZ_REVIEW_IMMEDIATELY;
+            $options->quizstate = QUIZ_STATE_IMMEDIATELY;
+        } else if (!$quiz->timeclose or time() < $quiz->timeclose) {
+            $quiz_state_mask = QUIZ_REVIEW_OPEN;
+            $options->quizstate = QUIZ_STATE_OPEN;
+        } else {
+            $quiz_state_mask = QUIZ_REVIEW_CLOSED;
+            $options->quizstate = QUIZ_STATE_CLOSED;
+        }
+
+        // ... and hence extract the appropriate review options. 
         $options->responses = ($quiz->review & $quiz_state_mask & QUIZ_REVIEW_RESPONSES) ? 1 : 0;
         $options->scores = ($quiz->review & $quiz_state_mask & QUIZ_REVIEW_SCORES) ? 1 : 0;
         $options->feedback = ($quiz->review & $quiz_state_mask & QUIZ_REVIEW_FEEDBACK) ? 1 : 0;
index ff9b30047c3f66464ae5b6bb85466db909bc2a4c..002e69009d0d95fe9b991f193f58b99814c5cca8 100644 (file)
@@ -140,8 +140,8 @@ class mod_quiz_mod_form extends moodleform_mod {
         $mform->addElement('hidden', 'grade', $CFG->quiz_maximumgrade);
 
 //-------------------------------------------------------------------------------
-        $mform->addElement('header', 'reviewoptionshdr', get_string("reviewoptions", "quiz"));
-        $mform->setHelpButton('reviewoptionshdr', array("review2", get_string("allowreview","quiz"), "quiz"));
+        $mform->addElement('header', 'reviewoptionshdr', get_string('reviewoptionsheading', 'quiz'));
+        $mform->setHelpButton('reviewoptionshdr', array('reviewoptions', get_string('reviewoptionsheading','quiz'), 'quiz'));
         $mform->setAdvanced('reviewoptionshdr', $CFG->quiz_fix_review);
 
         $immediatelyoptionsgrp=array();