MDL-10300 - cleaning incorrectly applied to overall feedback. Backported from HEAD.

This commit is contained in:
tjhunt
2007-07-30 10:41:15 +00:00
parent f97583af41
commit 9ff3b4ab32
3 changed files with 12 additions and 3 deletions
+6 -1
View File
@@ -317,7 +317,7 @@ function quiz_rescale_grade($rawgrade, $quiz) {
/**
* 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.
@@ -331,6 +331,11 @@ function quiz_feedback_for_grade($grade, $quizid) {
$feedback = '';
}
// Clean the text, ready for display.
$formatoptions = new stdClass;
$formatoptions->noclean = true;
$feedback = format_text($feedback, FORMAT_MOODLE, $formatoptions);
return $feedback;
}
+1 -1
View File
@@ -222,7 +222,7 @@ class mod_quiz_mod_form extends moodleform_mod {
}
$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,
+5 -1
View File
@@ -55,6 +55,10 @@ class quiz_report extends quiz_default_report {
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);
@@ -480,7 +484,7 @@ class quiz_report extends quiz_default_report {
}
if ($hasfeedback) {
if ($attempt->timefinish) {
$row[] = $attempt->feedbacktext;
$row[] = format_text($attempt->feedbacktext, FORMAT_MOODLE, $nocleanformatoptions);
} else {
$row[] = '-';
}