Jelajahi Sumber

fix #6985 Using < or > in a "fill blanks" answer does not work

eric 11 tahun lalu
induk
melakukan
d16c0f43a6
2 mengubah file dengan 4 tambahan dan 2 penghapusan
  1. 2 1
      main/exercice/exercise.class.php
  2. 2 1
      main/exercice/fill_blanks.class.php

+ 2 - 1
main/exercice/exercise.class.php

@@ -2407,7 +2407,8 @@ class Exercise
                             //Needed to let characters ' and " to work as part of an answer
                             $choice[$j] = stripslashes($choice[$j]);
                         } else {
-                            $choice[$j] = trim($choice[$j]);
+							// This value is the user input, not escaped while correct answer is escaped by fckeditor
+							$choice[$j] = htmlentities(trim($choice[$j]));
                         }
 
                         //No idea why we api_strtolower user reponses

+ 2 - 1
main/exercice/fill_blanks.class.php

@@ -162,8 +162,9 @@ class FillBlanks extends Question
 	{
 		global $charset;
 		$answer = $form->getSubmitValue('answer');
+		//echo $answer;exit;
 		//Due the fckeditor transform the elements to their HTML value
-		$answer = api_html_entity_decode($answer, ENT_QUOTES, $charset);
+		//$answer = api_html_entity_decode($answer, ENT_QUOTES, $charset);
 
 		//remove the :: eventually written by the user
 		$answer = str_replace('::','',$answer);