Skip to content

Commit

Permalink
Order code + showw CALCULATED_ANSWER questions - refs #8237
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFQC committed May 20, 2016
1 parent 3709d59 commit aafde67
Showing 1 changed file with 20 additions and 117 deletions.
137 changes: 20 additions & 117 deletions main/exercice/exercise_show.php
Expand Up @@ -364,134 +364,33 @@ function getFCK(vals, marksid) {
// Start buffer
ob_start();

if ($answerType == MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE) {
$choice = array();
}

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:
//no break
case MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE:
$choice = array();
$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;
//no break
case UNIQUE_ANSWER:
//no break;
case UNIQUE_ANSWER_NO_OPTION:
$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'];
echo '</table>';
break;
//no break
case MULTIPLE_ANSWER:
//no break
case MULTIPLE_ANSWER_TRUE_FALSE:
//no break
case FILL_IN_BLANKS:
$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;
//no break
case CALCULATED_ANSWER:
//no break
case GLOBAL_MULTIPLE_ANSWER:
$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;
//no break
case FREE_ANSWER:
$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;
//no break
case ORAL_EXPRESSION:
$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;
//no break
case MATCHING:
//no break
case DRAGGABLE:
Expand Down Expand Up @@ -718,6 +617,10 @@ function getFCK(vals, marksid) {
break;
}

if ($answerType == MULTIPLE_ANSWER_TRUE_FALSE) {
echo '</table>';
}

if ($show_results && $answerType != HOT_SPOT) {
echo '</table>';
}
Expand Down

0 comments on commit aafde67

Please sign in to comment.