Skip to content
Browse files

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

…OODLE_22_STABLE
  • Loading branch information...
2 parents 9205de2 + 29c1067 commit 37e91e07318fd9489e0f7122542c085a787a1417 @danpoltawski danpoltawski committed Dec 17, 2012
Showing with 10 additions and 5 deletions.
  1. +10 −5 mod/quiz/mod_form.php
View
15 mod/quiz/mod_form.php
@@ -470,11 +470,16 @@ public function validation($data, $files) {
$i = 0;
while (!empty($data['feedbackboundaries'][$i] )) {
$boundary = trim($data['feedbackboundaries'][$i]);
- if (strlen($boundary) > 0 && $boundary[strlen($boundary) - 1] == '%') {
- $boundary = trim(substr($boundary, 0, -1));
- if (is_numeric($boundary)) {
- $boundary = $boundary * $data['grade'] / 100.0;
- } else {
+ if (strlen($boundary) > 0) {
+ if ($boundary[strlen($boundary) - 1] == '%') {
+ $boundary = trim(substr($boundary, 0, -1));
+ if (is_numeric($boundary)) {
+ $boundary = $boundary * $data['grade'] / 100.0;
+ } else {
+ $errors["feedbackboundaries[$i]"] =
+ get_string('feedbackerrorboundaryformat', 'quiz', $i + 1);
+ }
+ } else if (!is_numeric($boundary)) {
$errors["feedbackboundaries[$i]"] =
get_string('feedbackerrorboundaryformat', 'quiz', $i + 1);
}

0 comments on commit 37e91e0

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