mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
MDL-11317 - Slashes displayed in incorrect responses for short answer questions. Fix by adding stripslashes in the appropriate place.
This commit is contained in:
parent
0b58276ad0
commit
dc1a8255ba
2 changed files with 3 additions and 4 deletions
|
@ -333,7 +333,7 @@ class quiz_report extends quiz_default_report {
|
|||
$qclass = 'partialcorrect';
|
||||
}
|
||||
$response->credit = '<span class="'.$qclass.'">('.format_float($q['credits'][$aid],2).') </span>';
|
||||
$response->text = '<span class="'.$qclass.'">'.format_text("$resp", FORMAT_MOODLE, $format_options, $quiz->course).' </span>';
|
||||
$response->text = '<span class="'.$qclass.'">'.format_text($resp, FORMAT_MOODLE, $format_options, $quiz->course).' </span>';
|
||||
$count = $q['rcounts'][$aid].'/'.$q['count'];
|
||||
$response->rcount = $count;
|
||||
$response->rpercent = '('.format_float($q['rcounts'][$aid]/$q['count']*100,0).'%)';
|
||||
|
|
|
@ -179,7 +179,7 @@ class default_questiontype {
|
|||
}
|
||||
|
||||
if (empty($question->name)) {
|
||||
$question->name = substr(strip_tags($question->questiontext), 0, 15);
|
||||
$question->name = shorten_text($question->questiontext, 15);
|
||||
if (empty($question->name)) {
|
||||
$question->name = '-';
|
||||
}
|
||||
|
@ -509,8 +509,7 @@ class default_questiontype {
|
|||
// 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[''];
|
||||
$responses[] = shorten_text(stripslashes($state->responses['']), 45);
|
||||
} else {
|
||||
$responses[] = '';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue