Browse Source

Minor - more result_disable changes BT#15743

Julio 5 years ago
parent
commit
53fafb4e32
1 changed files with 7 additions and 0 deletions
  1. 7 0
      main/inc/lib/exercise_show_functions.lib.php

+ 7 - 0
main/inc/lib/exercise_show_functions.lib.php

@@ -262,6 +262,7 @@ class ExerciseShowFunctions
             } else {
                 if (in_array($resultsDisabled, [
                     RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER,
+                    RESULT_DISABLE_SHOW_SCORE_AND_EXPECTED_ANSWERS_AND_RANKING,
                 ])
                 ) {
                     return '';
@@ -344,6 +345,7 @@ class ExerciseShowFunctions
         $showComment = false;
         switch ($resultsDisabled) {
             case RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER:
+            case RESULT_DISABLE_SHOW_SCORE_AND_EXPECTED_ANSWERS_AND_RANKING:
                 $hideStudentChoice = false;
                 $hide_expected_answer = true;
                 $status = Display::label(get_lang('Correct'), 'success');
@@ -376,6 +378,7 @@ class ExerciseShowFunctions
         $studentChoiceClass = '';
         if (in_array($resultsDisabled, [
             RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER,
+            RESULT_DISABLE_SHOW_SCORE_AND_EXPECTED_ANSWERS_AND_RANKING,
         ])
         ) {
             if ($answerCorrect) {
@@ -461,6 +464,7 @@ class ExerciseShowFunctions
         $hide_expected_answer = false;
         $hideStudentChoice = false;
         switch ($resultsDisabled) {
+            case RESULT_DISABLE_SHOW_SCORE_AND_EXPECTED_ANSWERS_AND_RANKING:
             case RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER:
                 $hideStudentChoice = false;
                 $hide_expected_answer = true;
@@ -527,6 +531,7 @@ class ExerciseShowFunctions
                     $exercise->results_disabled,
                     [
                         RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER,
+                        RESULT_DISABLE_SHOW_SCORE_AND_EXPECTED_ANSWERS_AND_RANKING,
                     ]
                 )
             ) {
@@ -663,6 +668,7 @@ class ExerciseShowFunctions
         $hide_expected_answer = false;
         $hideStudentChoice = false;
         switch ($resultsDisabled) {
+            case RESULT_DISABLE_SHOW_SCORE_AND_EXPECTED_ANSWERS_AND_RANKING:
             case RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER:
                 $hideStudentChoice = true;
                 $hide_expected_answer = true;
@@ -728,6 +734,7 @@ class ExerciseShowFunctions
             //@todo replace this harcoded value
             if ($studentChoice || in_array($resultsDisabled, [
                 RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER,
+                RESULT_DISABLE_SHOW_SCORE_AND_EXPECTED_ANSWERS_AND_RANKING,
             ])
             ) {
                 $color = 'black';