/**
* Get the feedback text that should be show to a student who
- * got this grade on this quiz.
+ * got this grade on this quiz. The feedback is processed ready for diplay.
*
* @param float $grade a grade on this quiz.
* @param integer $quizid the id of the quiz object.
$feedback = '';
}
+ // Clean the text, ready for display.
+ $formatoptions = new stdClass;
+ $formatoptions->noclean = true;
+ $feedback = format_text($feedback, FORMAT_MOODLE, $formatoptions);
+
return $feedback;
}
}
$numfeedbacks = max(count($this->_feedbacks) * 1.5, 5);
- $mform->setType('feedbacktext', PARAM_TEXT);
+ $mform->setType('feedbacktext', PARAM_RAW);
$mform->setType('feedbackboundaries', PARAM_NOTAGS);
$nextel=$this->repeat_elements($repeatarray, $numfeedbacks-1,
break;
}
+ // Set of format options for teacher-created content, for example overall feedback.
+ $nocleanformatoptions = new stdClass;
+ $nocleanformatoptions->noclean = true;
+
// Set table options
$noattempts = optional_param('noattempts', 0, PARAM_INT);
$detailedmarks = optional_param('detailedmarks', 0, PARAM_INT);
}
if ($hasfeedback) {
if ($attempt->timefinish) {
- $row[] = $attempt->feedbacktext;
+ $row[] = format_text($attempt->feedbacktext, FORMAT_MOODLE, $nocleanformatoptions);
} else {
$row[] = '-';
}