Skip to content

Commit

Permalink
MDL-10300 - cleaning incorrectly applied to overall feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjhunt committed Jul 30, 2007
1 parent 00719c0 commit de26653
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
7 changes: 6 additions & 1 deletion mod/quiz/locallib.php
Expand Up @@ -346,7 +346,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.
Expand All @@ -360,6 +360,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;
}

Expand Down
2 changes: 1 addition & 1 deletion mod/quiz/mod_form.php
Expand Up @@ -228,7 +228,7 @@ function definition() {
}
$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,
Expand Down
6 changes: 5 additions & 1 deletion mod/quiz/report/overview/report.php
Expand Up @@ -42,6 +42,10 @@ function display($quiz, $cm, $course) {
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);
Expand Down Expand Up @@ -466,7 +470,7 @@ function display($quiz, $cm, $course) {
}
if ($hasfeedback) {
if ($attempt->timefinish) {
$row[] = $attempt->feedbacktext;
$row[] = format_text($attempt->feedbacktext, FORMAT_MOODLE, $nocleanformatoptions);
} else {
$row[] = '-';
}
Expand Down

0 comments on commit de26653

Please sign in to comment.