Changed the get_actual_responses() method to truncate at 40 characters, contributed by Jean-Michel.

This commit is contained in:
gustav_delius
2006-03-28 08:27:56 +00:00
parent 223ad0b94b
commit 8cc274defc
+10 -9
View File
@@ -384,15 +384,16 @@ class default_questiontype {
* type specific information is included.
*/
// ULPGC ecastro
function get_actual_response(&$question, &$state) {
/* The default implementation only returns the raw ->responses.
may be overridden by each type*/
//unset($resp);
if (isset($state->responses)) {
return $state->responses;
} else {
return null;
}
function get_actual_response($question, $state) {
// change length to truncate responses here if you want
$lmax = 40;
if (!empty($state->responses)) {
$responses[] = (strlen($state->responses['']) > $lmax) ?
substr($state->responses[''], 0, $lmax).'...' : $state->responses[''];
} else {
$responses[] = '';
}
return $responses;
}
// ULPGC ecastro