Browse Source

Fix student answers with html entities - refs BT#12630

Angel Fernando Quiroz Campos 7 years ago
parent
commit
f74cecbf83
1 changed files with 1 additions and 0 deletions
  1. 1 0
      main/exercise/fill_blanks.class.php

+ 1 - 0
main/exercise/fill_blanks.class.php

@@ -1333,6 +1333,7 @@ class FillBlanks extends Question
         $answer = htmlentities(api_utf8_encode($answer), ENT_QUOTES);
         $answer = str_replace(''', ''', $answer); // fix apostrophe
         $answer = api_preg_replace('/\s\s+/', ' ', $answer); // replace excess white spaces
+        $answer = strtr($answer, array_flip(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES)));
 
         return trim($answer);
     }