From f2cdff586d7367b25bb295bf29fbff193a0d967d Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Thu, 29 Sep 2016 12:21:55 +0200 Subject: [PATCH] Fix error where teacher cannot correct exercise see BT#11759 --- main/exercice/exercise_show.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/main/exercice/exercise_show.php b/main/exercice/exercise_show.php index 7e866929b7..9646510a86 100755 --- a/main/exercice/exercise_show.php +++ b/main/exercice/exercise_show.php @@ -1,6 +1,8 @@ + /*echo ' -
'; Display::display_warning_message( @@ -217,7 +217,7 @@ if (!empty($track_exercise_info)) { ); echo '
'; + ';*/ } } elseif ($result_disabled == RESULT_DISABLE_SHOW_SCORE_ONLY) { $show_results = false; @@ -262,6 +262,10 @@ if ($origin == 'learnpath' && !isset($_GET['fb_type'])) { $show_results = false; } +if ($is_allowedToEdit && in_array($action, ['qualify', 'edit'])) { + $show_results = true; +} + if ($show_results || $show_only_total_score || $showTotalScoreAndUserChoices) { $user_info = api_get_user_info($student_id); //Shows exercise header @@ -344,7 +348,6 @@ foreach ($questionList as $questionId) { $counter = 1; $exercise_content = null; $category_list = array(); - $useAdvancedEditor = true; if (!empty($maxEditors) && count($questionList) > $maxEditors) { @@ -352,7 +355,7 @@ if (!empty($maxEditors) && count($questionList) > $maxEditors) { } foreach ($questionList as $questionId) { - $choice = $exerciseResult[$questionId]; + $choice = isset($exerciseResult[$questionId]) ? $exerciseResult[$questionId] : ''; // destruction of the Question object unset($objQuestionTmp); @@ -626,7 +629,6 @@ foreach ($questionList as $questionId) { } $comnt = null; - if ($show_results) { if ( $is_allowedToEdit &&