Browse files

Merge branch 'MDL-37599_23' of git://github.com/timhunt/moodle into M…

…OODLE_23_STABLE
  • Loading branch information...
2 parents e21f9dd + fb5819b commit 211fa38ca5ae9c18525f5c1a9472bb685da14e09 @danpoltawski danpoltawski committed Jan 22, 2013
Showing with 6 additions and 5 deletions.
  1. +1 −1 lang/en/question.php
  2. +5 −4 question/format.php
View
2 lang/en/question.php
@@ -183,13 +183,13 @@
$string['invalidcategoryidtomove'] = 'Invalid category id to move!';
$string['invalidconfirm'] = 'Confirmation string was incorrect';
$string['invalidcontextinhasanyquestions'] = 'Invalid context passed to question_context_has_any_questions.';
+$string['invalidgrade'] = 'Grades ({$a}) do not match grade options - question skipped.';
$string['invalidpenalty'] = 'Invalid penalty';
$string['invalidwizardpage'] = 'Incorrect or no wizard page specified!';
$string['lastmodifiedby'] = 'Last modified by';
$string['linkedfiledoesntexist'] = 'Linked file {$a} doesn\'t exist';
$string['makechildof'] = 'Make child of \'{$a}\'';
$string['maketoplevelitem'] = 'Move to top level';
-$string['matcherror'] = 'Grades do not match grade options - question skipped';
$string['matchgrades'] = 'Match grades';
$string['matchgradeserror'] = 'Error if grade not listed';
$string['matchgradesnearest'] = 'Nearest grade if not listed';
View
9 question/format.php
@@ -348,18 +348,19 @@ public function importprocess($category) {
foreach ($questions as $question) {
if (!empty($question->fraction) and (is_array($question->fraction))) {
$fractions = $question->fraction;
- $answersvalid = true; // in case they are!
+ $invalidfractions = array();
foreach ($fractions as $key => $fraction) {
$newfraction = match_grade_options($gradeoptionsfull, $fraction,
$this->matchgrades);
if ($newfraction === false) {
- $answersvalid = false;
+ $invalidfractions[] = $fraction;
} else {
$fractions[$key] = $newfraction;
}
}
- if (!$answersvalid) {
- echo $OUTPUT->notification(get_string('invalidgrade', 'question'));
+ if ($invalidfractions) {
+ echo $OUTPUT->notification(get_string('invalidgrade', 'question',
+ implode(', ', $invalidfractions)));
++$gradeerrors;
continue;
} else {

0 comments on commit 211fa38

Please sign in to comment.