mirror of
https://github.com/moodle/moodle.git
synced 2025-04-17 22:45:54 +02:00
Make things a bit more robust. Sorry, I can't remember exactly what the problem was that this fixed any more. It has been sitting around for a couple of weeks and I had forgotten to commit it.
This commit is contained in:
parent
2559409081
commit
879caa5172
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user