]> git.mjollnir.org Git - moodle.git/commitdiff
Since people adding this block to the quiz screen will get an empty display
authordefacer <defacer>
Tue, 1 Feb 2005 07:46:31 +0000 (07:46 +0000)
committerdefacer <defacer>
Tue, 1 Feb 2005 07:46:31 +0000 (07:46 +0000)
at first, show them a more friendly message instead.

blocks/quiz_results/block_quiz_results.php
lang/en/block_quiz_results.php

index 1b85cfdb6445539d98c9deba759dbd8b7de44261..e31e1d1d312071ae6f0669d8621a16db366afa28 100644 (file)
@@ -66,6 +66,11 @@ class block_quiz_results extends block_base {
             return $this->content;
         }
 
+        if(empty($this->config->showbest) && empty($this->config->showworst)) {
+            $this->content->text = get_string('configuredtoshownothing', 'block_quiz_results');
+            return $this->content;
+        }
+
         $groupmode = NOGROUPS;
         $best      = array();
         $worst     = array();
index f3fb890b619741acce17d7ede798418856d84b6c..e0dff6946b990b8037e499ad2b122751a7b5742b 100644 (file)
@@ -14,6 +14,7 @@ $string['config_format_percentage'] = 'Percentages';
 $string['config_format_fraction'] = 'Fractions';
 $string['config_format_absolute'] = 'Absolute numbers';
 $string['config_no_quizzes_in_course'] = 'This course does not contain any quiz activities . You must add at least one before you are able to use this block correctly.';
+$string['configuredtoshownothing'] = 'This block\'s configuration currently does not allow it to show any results. You may want to either configure it or hide it.';
 $string['error_emptyquizid'] = 'There is an error right now with this block: you need to select which quiz it should display results from.';
 $string['error_emptyquizrecord'] = 'There is an error right now with this block: the selected quiz does not seem to exist in the database.';
 $string['error_nogroupsexist'] = 'There is an error right now with this block: it is set to display grades in group mode, but the course has no defined groups.';