New type of question: Multiple answer \"Exact\" fixes

skala
Julio Montoya 16 years ago
parent 01e98dd584
commit 8e89f373a4
  1. 23
      main/exercice/exercice_submit.php

@ -432,15 +432,7 @@ if ($formSent) {
if (!$my_answer) { if (!$my_answer) {
$final_answer = false; $final_answer = false;
} }
} }
if ($final_answer) {
//getting only the first score where we save the weight of all the question
$answerWeighting=$objAnswerTmp->selectWeighting(1);
$questionScore+=$answerWeighting;
$totalScore+=$answerWeighting;
}
break; break;
// for fill in the blanks // for fill in the blanks
case FILL_IN_BLANKS : case FILL_IN_BLANKS :
@ -626,6 +618,17 @@ if ($formSent) {
} // end switch Answertype } // end switch Answertype
} // end for that loops over all answers of the current question } // end for that loops over all answers of the current question
// destruction of Answer // destruction of Answer
//we add the total score after dealing with the answers
if ($answerType == MULTIPLE_ANSWER_COMBINATION) {
if ($final_answer) {
//getting only the first score where we save the weight of all the question
$answerWeighting=$objAnswerTmp->selectWeighting(1);
$questionScore+=$answerWeighting;
$totalScore+=$answerWeighting;
}
}
unset ($objAnswerTmp); unset ($objAnswerTmp);
$i++; $i++;
@ -654,6 +657,8 @@ if ($formSent) {
$reply = array_keys($choice); $reply = array_keys($choice);
for ($i = 0; $i < sizeof($reply); $i++) { for ($i = 0; $i < sizeof($reply); $i++) {
$ans = $reply[$i]; $ans = $reply[$i];
echo ($questionScore.' - '.$ans.' - '. $quesId.' - '. $exeId.' - '. $i);
echo '<br />';
exercise_attempt($questionScore, $ans, $quesId, $exeId, $i); exercise_attempt($questionScore, $ans, $quesId, $exeId, $i);
} }
} else { } else {

Loading…
Cancel
Save