|
|
@ -599,14 +599,29 @@ class ExerciseLib |
|
|
|
$correctItem = $studentAnswerList[$i]; |
|
|
|
$correctItem = $studentAnswerList[$i]; |
|
|
|
} |
|
|
|
} |
|
|
|
$attributes["style"] = "width:" . $listAnswerInformations["tabinputsize"][$i] . "px"; |
|
|
|
$attributes["style"] = "width:" . $listAnswerInformations["tabinputsize"][$i] . "px"; |
|
|
|
$answer .= FillBlanks::getFillTheBlankHtml($separatorStartRegexp, $separatorEndRegexp, $correctItemRegexp, $questionId, $correctItem, $attributes, $answer, $listAnswerInformations, $displayForStudent, $i); |
|
|
|
$answer .= FillBlanks::getFillTheBlankHtml( |
|
|
|
|
|
|
|
$separatorStartRegexp, |
|
|
|
|
|
|
|
$separatorEndRegexp, |
|
|
|
|
|
|
|
$correctItemRegexp, |
|
|
|
|
|
|
|
$questionId, |
|
|
|
|
|
|
|
$correctItem, |
|
|
|
|
|
|
|
$attributes, |
|
|
|
|
|
|
|
$answer, |
|
|
|
|
|
|
|
$listAnswerInformations, |
|
|
|
|
|
|
|
$displayForStudent, |
|
|
|
|
|
|
|
$i |
|
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
// display the last common word |
|
|
|
// display the last common word |
|
|
|
$answer .= $listAnswerInformations["commonwords"][$i]; |
|
|
|
$answer .= $listAnswerInformations["commonwords"][$i]; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// display empty [input] with the right width for student to fill it |
|
|
|
// display empty [input] with the right width for student to fill it |
|
|
|
$separatorStartRegexp = FillBlanks::escapeForRegexp($listAnswerInformations['blankseparatorstart']); |
|
|
|
$separatorStartRegexp = FillBlanks::escapeForRegexp( |
|
|
|
$separatorEndRegexp = FillBlanks::escapeForRegexp($listAnswerInformations['blankseparatorend']); |
|
|
|
$listAnswerInformations['blankseparatorstart'] |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
$separatorEndRegexp = FillBlanks::escapeForRegexp( |
|
|
|
|
|
|
|
$listAnswerInformations['blankseparatorend'] |
|
|
|
|
|
|
|
); |
|
|
|
$answer = ''; |
|
|
|
$answer = ''; |
|
|
|
for ($i = 0; $i < count($listAnswerInformations["commonwords"]) - 1; $i++) { |
|
|
|
for ($i = 0; $i < count($listAnswerInformations["commonwords"]) - 1; $i++) { |
|
|
|
// display the common words |
|
|
|
// display the common words |
|
|
@ -617,7 +632,18 @@ class ExerciseLib |
|
|
|
$correctItemRegexp = $correctItem; |
|
|
|
$correctItemRegexp = $correctItem; |
|
|
|
// replace / with \/ to allow the preg_replace bellow and all the regexp char |
|
|
|
// replace / with \/ to allow the preg_replace bellow and all the regexp char |
|
|
|
$correctItemRegexp = FillBlanks::getRegexpProtected($correctItemRegexp); |
|
|
|
$correctItemRegexp = FillBlanks::getRegexpProtected($correctItemRegexp); |
|
|
|
$answer .= FillBlanks::getFillTheBlankHtml($separatorStartRegexp, $separatorEndRegexp, $correctItemRegexp, $questionId, '', $attributes, $answer, $listAnswerInformations, $displayForStudent, $i); |
|
|
|
$answer .= FillBlanks::getFillTheBlankHtml( |
|
|
|
|
|
|
|
$separatorStartRegexp, |
|
|
|
|
|
|
|
$separatorEndRegexp, |
|
|
|
|
|
|
|
$correctItemRegexp, |
|
|
|
|
|
|
|
$questionId, |
|
|
|
|
|
|
|
'', |
|
|
|
|
|
|
|
$attributes, |
|
|
|
|
|
|
|
$answer, |
|
|
|
|
|
|
|
$listAnswerInformations, |
|
|
|
|
|
|
|
$displayForStudent, |
|
|
|
|
|
|
|
$i |
|
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
// display the last common word |
|
|
|
// display the last common word |
|
|
|
$answer .= $listAnswerInformations["commonwords"][$i]; |
|
|
|
$answer .= $listAnswerInformations["commonwords"][$i]; |
|
|
|