Permalink
Browse files

MDL-8349 - responses not being filtered in history display. Backporte…

…d from MOODLE_18_STABLE.
  • Loading branch information...
1 parent 6a15960 commit 1e1ac995130b83cc3d03695c0fe8988eb3ea8869 tjhunt committed Mar 6, 2007
Showing with 12 additions and 1 deletion.
  1. +12 −1 question/type/multichoice/questiontype.php
View
13 question/type/multichoice/questiontype.php
@@ -359,17 +359,28 @@ function grade_responses(&$question, &$state, $cmoptions) {
// ULPGC ecastro
function get_actual_response($question, $state) {
+ $formatoptions = new stdClass;
+ $formatoptions->noclean = true;
+ $formatoptions->para = false;
+
$answers = $question->options->answers;
+ $responses = array();
if (!empty($state->responses)) {
foreach ($state->responses as $aid =>$rid){
- $responses[] = (!empty($answers[$rid]) ? $answers[$rid]->answer : '');
+ if (!empty($answers[$rid])) {
+ $responses[] = format_text($answers[$rid]->answer, $question->questiontextformat, $formatoptions);
+ }
}
} else {
$responses[] = '';
}
return $responses;
}
+ function response_summary($question, $state, $length = 80) {
+ return implode(',', $this->get_actual_response($question, $state));
+ }
+
/// BACKUP FUNCTIONS ////////////////////////////
/*

0 comments on commit 1e1ac99

Please sign in to comment.