MDL-11617 - 'Student may review' heading on quiz settings form is now misleading. I have fixed some lang strings and improved the help. Also, finish off the clarification of how various capabilites affect quiz review that was started in MDL-11580.

This commit is contained in:
tjhunt
2007-10-09 15:19:07 +00:00
parent 4400acd2fb
commit e2833e8700
5 changed files with 44 additions and 26 deletions
+1
View 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 -->
+18
View File
@@ -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>
+1
View 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';
+22 -24
View 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;
+2 -2
View 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();