|
@@ -89,6 +89,13 @@ class ExerciseLib
|
|
|
$objAnswerTmp = new Answer($questionId);
|
|
|
$nbrAnswers = $objAnswerTmp->selectNbrAnswers();
|
|
|
|
|
|
+ if ($answerType == FREE_ANSWER ||
|
|
|
+ $answerType == ORAL_EXPRESSION ||
|
|
|
+ $answerType == CALCULATED_ANSWER
|
|
|
+ ) {
|
|
|
+ $nbrAnswers = 1;
|
|
|
+ }
|
|
|
+
|
|
|
$quiz_question_options = Question::readQuestionOption(
|
|
|
$questionId,
|
|
|
$course_id
|
|
@@ -622,12 +629,12 @@ class ExerciseLib
|
|
|
* the text to find mustn't contains HTML tags
|
|
|
* the text to find mustn't contains char "
|
|
|
*/
|
|
|
- global $exe_id;
|
|
|
+ global $exerciseId;
|
|
|
$trackAttempts = Database::get_main_table(
|
|
|
TABLE_STATISTIC_TRACK_E_ATTEMPT
|
|
|
);
|
|
|
$sql = 'SELECT answer FROM ' . $trackAttempts . '
|
|
|
- WHERE exe_id=' . $exe_id . ' AND question_id=' . $questionId;
|
|
|
+ WHERE exe_id=' . $exerciseId . ' AND question_id=' . $questionId;
|
|
|
$rsLastAttempt = Database::query($sql);
|
|
|
$rowLastAttempt = Database::fetch_array($rsLastAttempt);
|
|
|
$answer = $rowLastAttempt['answer'];
|