diff --git a/question/type/questiontype.php b/question/type/questiontype.php index 1cb9e0f15e1..a150f5aa530 100644 --- a/question/type/questiontype.php +++ b/question/type/questiontype.php @@ -806,7 +806,14 @@ class default_questiontype { */ function response_summary($question, $state, $length=80) { // This should almost certainly be overridden - return substr(implode(',', $this->get_actual_response($question, $state)), 0, $length); + $responses = $this->get_actual_response($question, $state); + if (empty($responses) || !is_array($responses)) { + $responses = array(); + } + if (is_array($responses)) { + $responses = implode(',', $responses); + } + return substr($responses, 0, $length); } /**