Skip to content

Commit

Permalink
Since people adding this block to the quiz screen will get an empty d…
Browse files Browse the repository at this point in the history
…isplay

at first, show them a more friendly message instead.
  • Loading branch information
defacer committed Feb 1, 2005
1 parent 8dffa4d commit e7c15ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions blocks/quiz_results/block_quiz_results.php
Expand Up @@ -66,6 +66,11 @@ function get_content() {
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();
Expand Down
1 change: 1 addition & 0 deletions lang/en/block_quiz_results.php
Expand Up @@ -14,6 +14,7 @@
$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.';
Expand Down

0 comments on commit e7c15ec

Please sign in to comment.