1
0
mirror of https://github.com/moodle/moodle.git synced 2025-05-11 10:45:38 +02:00

Merge branch 'MDL-37114' of git://github.com/timhunt/moodle

This commit is contained in:
Dan Poltawski 2012-12-17 15:25:22 +08:00
commit 0b10485a03

@ -522,7 +522,8 @@ class mod_quiz_mod_form extends moodleform_mod {
$i = 0;
while (!empty($data['feedbackboundaries'][$i] )) {
$boundary = trim($data['feedbackboundaries'][$i]);
if (strlen($boundary) > 0 && $boundary[strlen($boundary) - 1] == '%') {
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;
@ -530,6 +531,10 @@ class mod_quiz_mod_form extends moodleform_mod {
$errors["feedbackboundaries[$i]"] =
get_string('feedbackerrorboundaryformat', 'quiz', $i + 1);
}
} else if (!is_numeric($boundary)) {
$errors["feedbackboundaries[$i]"] =
get_string('feedbackerrorboundaryformat', 'quiz', $i + 1);
}
}
if (is_numeric($boundary) && $boundary <= 0 || $boundary >= $data['grade'] ) {
$errors["feedbackboundaries[$i]"] =