MDL-8349 - responses not being filtered in history display. Backported from MOODLE_18_STABLE.

This commit is contained in:
tjhunt
2007-03-06 18:00:51 +00:00
parent 6a1596099d
commit 1e1ac99513
+12 -1
View File
@@ -359,10 +359,17 @@ class question_multichoice_qtype extends default_questiontype {
// 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[] = '';
@@ -370,6 +377,10 @@ class question_multichoice_qtype extends default_questiontype {
return $responses;
}
function response_summary($question, $state, $length = 80) {
return implode(',', $this->get_actual_response($question, $state));
}
/// BACKUP FUNCTIONS ////////////////////////////
/*