Skip to content

Commit

Permalink
Merge branch 'MDL-37114_22' of git://github.com/timhunt/moodle into M…
Browse files Browse the repository at this point in the history
…OODLE_22_STABLE
  • Loading branch information
danpoltawski committed Dec 17, 2012
2 parents 9205de2 + 29c1067 commit 37e91e0
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions mod/quiz/mod_form.php
Expand Up @@ -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);
}
Expand Down

0 comments on commit 37e91e0

Please sign in to comment.