// Show feedback once the question has been graded (if allowed by the quiz)
$options->feedback = question_state_is_graded($state) && ($reviewoptions & QUIZ_REVIEW_FEEDBACK & QUIZ_REVIEW_IMMEDIATELY);
- // Show validation only after a validation event
- $options->validation = QUESTION_EVENTVALIDATE === $state->event;
-
// Show correct responses in readonly mode if the quiz allows it
$options->correct_responses = $options->readonly && ($reviewoptions & QUIZ_REVIEW_ANSWERS & QUIZ_REVIEW_IMMEDIATELY);
$options->responses = true;
$options->scores = true;
$options->quizstate = QUIZ_STATE_DURING;
+ $options->history = false;
return $options;
}
$options->questioncommentlink = '/mod/quiz/comment.php';
}
- if (!is_null($context) && has_capability('mod/quiz:viewreports', $context) &&
- has_capability('moodle/grade:viewhidden', $context) && !$attempt->preview) {
+ // Whether to display a response history.
+ $canviewreports = !is_null($context) && has_capability('mod/quiz:viewreports', $context);
+ $options->history = ($canviewreports && !$attempt->preview) ? 'all' : 'graded';
+
+ if ($canviewreports && 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;
/**
* This page prints a review of a particular question attempt
*
- * @author Martin Dougiamas and many others. This has recently been completely
- * rewritten by Alex Smith, Julian Sedding and Gustav Delius as part of
- * the Serving Mathematics project
- * {@link http://maths.york.ac.uk/serving_maths}
+ * @author Martin Dougiamas and many others.
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package quiz
*/
- require_once('../../config.php');
+ require_once(dirname(__FILE__) . '/../../config.php');
require_once('locallib.php');
// Either stateid or (attemptid AND questionid) must be given
$state->last_graded = $state;
$options = quiz_get_reviewoptions($quiz, $attempt, $context);
- $options->validation = ($state->event == QUESTION_EVENTVALIDATE);
- $options->history = (has_capability('mod/quiz:viewreports', $context) and !$attempt->preview) ? 'all' : 'graded';
/// Print infobox
$table->align = array("right", "left");
/// This page prints a particular instance of quiz
- require_once("../../config.php");
+ require_once(dirname(__FILE__) . '/../../config.php');
require_once($CFG->libdir.'/blocklib.php');
require_once($CFG->libdir.'/gradelib.php');
require_once($CFG->dirroot.'/mod/quiz/locallib.php');