MDL-8349 - responses not being filtered in history display. Backported from MOODLE_18_STABLE.
This commit is contained in:
@@ -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 ////////////////////////////
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user