From c7dc81a679f944f868c0243b8bb66a545cd6d783 Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Mon, 23 May 2016 15:58:17 +0200 Subject: [PATCH] Fix option RESULT_DISABLE_SHOW_SCORE_ATTEMPT_SHOW_ANSWERS_LAST_ATTEMPT BT#11202 --- main/inc/lib/exercise.lib.php | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/main/inc/lib/exercise.lib.php b/main/inc/lib/exercise.lib.php index aa7e5ff120..7e0b2eae3c 100644 --- a/main/inc/lib/exercise.lib.php +++ b/main/inc/lib/exercise.lib.php @@ -3461,8 +3461,7 @@ HOTSPOT; $objExercise, $exe_id, $save_user_result = false - ) - { + ) { global $origin; // Getting attempt info @@ -3532,16 +3531,19 @@ HOTSPOT; if ($attempts) { $numberAttempts = count($attempts); - if ($save_user_result) { - $numberAttempts++; - } - if ($numberAttempts >= $objExercise->attempts) { - $show_results = true; - $show_only_score = false; - $show_total_score_and_user_choices = false; - } else { - $show_total_score_and_user_choices = true; - } + } else { + $numberAttempts = 0; + } + + if ($save_user_result) { + $numberAttempts++; + } + if ($numberAttempts >= $objExercise->attempts) { + $show_results = true; + $show_only_score = false; + $show_total_score_and_user_choices = false; + } else { + $show_total_score_and_user_choices = true; } } }