// quits the loop if there are no more blanks (detect '[')
@ -2087,7 +2085,7 @@ class Exercise {
break;
}
if ($from_database) {
$queryfill = "SELECT answer FROM ".$TBL_TRACK_ATTEMPT." WHERE exe_id = '".Database::escape_string($exeId)."' AND question_id= '".Database::escape_string($questionId)."'";
$queryfill = "SELECT answer FROM ".$TBL_TRACK_ATTEMPT." WHERE exe_id = '".$exeId."' AND question_id= '".Database::escape_string($questionId)."'";
$resfill = Database::query($queryfill);
$str = Database::result($resfill,0,'answer');
@ -2095,9 +2093,9 @@ class Exercise {
$str = str_replace('\r\n', '', $str);
$choice = $arr[1];
$tmp=strrpos($choice[$j],' / ');
$choice[$j]=api_substr($choice[$j],0,$tmp);
$choice[$j]=trim($choice[$j]);
$tmp=strrpos($choice[$j],' / ');
$choice[$j]=api_substr($choice[$j],0,$tmp);
$choice[$j]=trim($choice[$j]);
//Needed to let characters ' and " to work as part of an answer
$choice[$j] = stripslashes($choice[$j]);
@ -2105,12 +2103,11 @@ class Exercise {
$choice[$j] = trim($choice[$j]);
}
$user_tags[] = api_strtolower($choice[$j]);
$user_tags[] = api_strtolower($choice[$j]);
//put the contents of the [] answer tag into correct_tags[]