diff --git a/main/exercice/exercise.class.php b/main/exercice/exercise.class.php index cc1cb330b7..6c7e8a18b3 100644 --- a/main/exercice/exercise.class.php +++ b/main/exercice/exercise.class.php @@ -1935,6 +1935,9 @@ class Exercise { // Creates a temporary Question object $course_id = api_get_course_int_id(); $objQuestionTmp = Question::read($questionId, $course_id); + if ($objQuestionTmp === false) { + return false; + } $questionName = $objQuestionTmp->selectTitle(); $questionWeighting = $objQuestionTmp->selectWeighting(); diff --git a/main/exercice/exercise.lib.php b/main/exercice/exercise.lib.php index 0cec06aaf6..4b2fe0ff0f 100644 --- a/main/exercice/exercise.lib.php +++ b/main/exercice/exercise.lib.php @@ -2137,6 +2137,9 @@ function display_question_list_by_attempt($objExercise, $exe_id, $save_user_resu // We're inside *one* question. Go through each possible answer for this question $result = $objExercise->manage_answer($exercise_stat_info['exe_id'], $questionId, null, 'exercise_result', array(), $save_user_result, true, $show_results, $objExercise->selectPropagateNeg(), $hotspot_delineation_result); + if (empty($result)) { + continue; + } $total_score += $result['score']; $total_weight += $result['weight']; @@ -2289,4 +2292,4 @@ function get_question_ribbon($objExercise, $score, $weight, $check_pass_percenta $ribbon .= ''; return $ribbon; -} \ No newline at end of file +} diff --git a/main/exercice/question.class.php b/main/exercice/question.class.php index d24a61bd70..f8244ffaa6 100644 --- a/main/exercice/question.class.php +++ b/main/exercice/question.class.php @@ -1602,4 +1602,4 @@ abstract class Question } return $html; } -} \ No newline at end of file +}