Order code + showw CALCULATED_ANSWER questions - refs #8237

1.10.x
Angel Fernando Quiroz Campos 10 years ago
parent 3709d59641
commit aafde67b9c
  1. 137
      main/exercice/exercise_show.php

@ -364,134 +364,33 @@ foreach ($questionList as $questionId) {
// Start buffer // Start buffer
ob_start(); ob_start();
if ($answerType == MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE) {
$choice = array();
}
switch ($answerType) { switch ($answerType) {
case MULTIPLE_ANSWER:
//no break
case MULTIPLE_ANSWER_TRUE_FALSE:
$question_result = $objExercise->manage_answer(
$id,
$questionId,
$choice,
'exercise_show',
array(),
false,
true,
$show_results,
$objExercise->selectPropagateNeg(),
[],
$showTotalScoreAndUserChoices
);
$questionScore = $question_result['score'];
$totalScore += $question_result['score'];
break;
case MULTIPLE_ANSWER_COMBINATION: case MULTIPLE_ANSWER_COMBINATION:
//no break //no break
case MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE: case MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE:
$choice = array(); //no break
$question_result = $objExercise->manage_answer(
$id,
$questionId,
$choice,
'exercise_show',
array(),
false,
true,
$show_results,
$objExercise->selectPropagateNeg(),
[],
$showTotalScoreAndUserChoices
);
$questionScore = $question_result['score'];
$totalScore += $question_result['score'];
break;
case UNIQUE_ANSWER: case UNIQUE_ANSWER:
//no break; //no break;
case UNIQUE_ANSWER_NO_OPTION: case UNIQUE_ANSWER_NO_OPTION:
$question_result = $objExercise->manage_answer( //no break
$id, case MULTIPLE_ANSWER:
$questionId, //no break
$choice, case MULTIPLE_ANSWER_TRUE_FALSE:
'exercise_show', //no break
array(),
false,
true,
$show_results,
$objExercise->selectPropagateNeg(),
[],
$showTotalScoreAndUserChoices
);
$questionScore = $question_result['score'];
$totalScore += $question_result['score'];
echo '</table>';
break;
case FILL_IN_BLANKS: case FILL_IN_BLANKS:
$question_result = $objExercise->manage_answer( //no break
$id, case CALCULATED_ANSWER:
$questionId, //no break
$choice,
'exercise_show',
array(),
false,
true,
$show_results,
$objExercise->selectPropagateNeg(),
[],
$showTotalScoreAndUserChoices
);
$questionScore = $question_result['score'];
$totalScore += $question_result['score'];
break;
case GLOBAL_MULTIPLE_ANSWER: case GLOBAL_MULTIPLE_ANSWER:
$question_result = $objExercise->manage_answer( //no break
$id,
$questionId,
$choice,
'exercise_show',
array(),
false,
true,
$show_results,
$objExercise->selectPropagateNeg(),
[],
$showTotalScoreAndUserChoices
);
$questionScore = $question_result['score'];
$totalScore += $question_result['score'];
break;
case FREE_ANSWER: case FREE_ANSWER:
$question_result = $objExercise->manage_answer( //no break
$id,
$questionId,
$choice,
'exercise_show',
array(),
false,
true,
$show_results,
$objExercise->selectPropagateNeg(),
[],
$showTotalScoreAndUserChoices
);
$questionScore = $question_result['score'];
$totalScore += $question_result['score'];
break;
case ORAL_EXPRESSION: case ORAL_EXPRESSION:
$question_result = $objExercise->manage_answer( //no break
$id,
$questionId,
$choice,
'exercise_show',
array(),
false,
true,
$show_results,
$objExercise->selectPropagateNeg(),
[],
$showTotalScoreAndUserChoices
);
$questionScore = $question_result['score'];
$totalScore += $question_result['score'];
break;
case MATCHING: case MATCHING:
//no break //no break
case DRAGGABLE: case DRAGGABLE:
@ -718,6 +617,10 @@ foreach ($questionList as $questionId) {
break; break;
} }
if ($answerType == MULTIPLE_ANSWER_TRUE_FALSE) {
echo '</table>';
}
if ($show_results && $answerType != HOT_SPOT) { if ($show_results && $answerType != HOT_SPOT) {
echo '</table>'; echo '</table>';
} }

Loading…
Cancel
Save