Exercise: Refactor answer handling in exercise_show_functions.lib.php for oral expression questions - refs BT#22308

pull/6061/head
Angel Fernando Quiroz Campos 9 months ago
parent 7638f49ec1
commit 46f11d3e28
No known key found for this signature in database
GPG Key ID: B284841AE3E562CD
  1. 18
      main/inc/lib/exercise_show_functions.lib.php

@ -221,13 +221,19 @@ class ExerciseShowFunctions
echo '<tr><td>&nbsp;</td></tr>';
}
} else {
echo '<tr>';
echo '<td>';
if (!empty($answer)) {
echo Security::remove_XSS($answer);
$text = '';
if (is_array($answer) && !empty($answer['answer'])) {
$text = $answer['answer'];
} elseif (!is_array($answer)) {
$text = $answer;
}
if (!empty($text)) {
echo '<tr><td>';
echo Security::remove_XSS($text);
echo '</td></tr>';
}
echo '</td>';
echo '</tr>';
}
}

Loading…
Cancel
Save