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:
tjhunt 2006-10-16 15:23:54 +00:00
parent 2559409081
commit 879caa5172

View File

@ -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);
}
/**