Pārlūkot izejas kodu

Display Not attempted if test not attempted and score not displayed

Hubert Borderiou 12 gadi atpakaļ
vecāks
revīzija
69476fe796
1 mainītis faili ar 9 papildinājumiem un 1 dzēšanām
  1. 9 1
      main/exercice/exercice.php

+ 9 - 1
main/exercice/exercice.php

@@ -700,7 +700,15 @@ if (!empty($exercise_list)) {
                             $attempt_text = get_lang('NotAttempted');
                         }
                     } else {
-                        $attempt_text = get_lang('CantShowResults');
+                        // if we don't show the score
+                        if ($num > 0) {
+                            // if the exercice has been attempted
+                            $attempt_text = get_lang('CantShowResults');
+                        }
+                        else {
+                            // if the exercice hasn't been attempted
+                            $attempt_text = get_lang('NotAttempted');
+                        }
                     }
 
                     $class_tip = '';