Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-31702 quiz: clarify error message that has been confusing people.

  • Loading branch information...
commit 53e40ebe2d7f89e3480628ae00de462c97df7556 1 parent 5f51b09
Tim Hunt timhunt authored

Showing 2 changed files with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. +1 1  mod/quiz/lang/en/quiz.php
  2. +2 1  mod/quiz/locallib.php
2  mod/quiz/lang/en/quiz.php
@@ -127,7 +127,7 @@
127 127 $string['cannotsavequestion'] = 'Cannot save question list';
128 128 $string['cannotsetgrade'] = 'Could not set a new maximum grade for the quiz';
129 129 $string['cannotsetsumgrades'] = 'Failed to set sumgrades';
130   -$string['cannotstartgradesmismatch'] = 'Cannot start an attempt at this quiz. The quiz is supposed to be graded, but there are no questions in the quiz that are worth any marks.';
  130 +$string['cannotstartgradesmismatch'] = 'Cannot start an attempt at this quiz. The quiz is set to be graded out of {$a->grade}, but none of the questions in the quiz have a grade. This can be fixed on the \'Edit quiz\' page.';
131 131 $string['cannotstartmissingquestion'] = 'Cannot start an attempt at this quiz. The quiz definition includes a question that does not exist.';
132 132 $string['cannotstartnoquestions'] = 'Cannot start an attempt at this quiz. The quiz has not been set up yet. No questions have been added.';
133 133 $string['cannotwrite'] = 'Cannot write to export file ({$a})';
3  mod/quiz/locallib.php
@@ -71,7 +71,8 @@ function quiz_create_attempt($quiz, $attemptnumber, $lastattempt, $timenow, $isp
71 71
72 72 if ($quiz->sumgrades < 0.000005 && $quiz->grade > 0.000005) {
73 73 throw new moodle_exception('cannotstartgradesmismatch', 'quiz',
74   - new moodle_url('/mod/quiz/view.php', array('q' => $quiz->id)));
  74 + new moodle_url('/mod/quiz/view.php', array('q' => $quiz->id)),
  75 + array('grade' => quiz_format_grade($quiz, $quiz->grade)));
75 76 }
76 77
77 78 if ($attemptnumber == 1 || !$quiz->attemptonlast) {

0 comments on commit 53e40eb

Please sign in to comment.
Something went wrong with that request. Please try again.