mirror of
https://github.com/moodle/moodle.git
synced 2025-05-10 02:08:33 +02:00
Merge branch 'MDL-37114' of git://github.com/timhunt/moodle
This commit is contained in:
commit
0b10485a03
@ -522,11 +522,16 @@ class mod_quiz_mod_form extends moodleform_mod {
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
while (!empty($data['feedbackboundaries'][$i] )) {
|
while (!empty($data['feedbackboundaries'][$i] )) {
|
||||||
$boundary = trim($data['feedbackboundaries'][$i]);
|
$boundary = trim($data['feedbackboundaries'][$i]);
|
||||||
if (strlen($boundary) > 0 && $boundary[strlen($boundary) - 1] == '%') {
|
if (strlen($boundary) > 0) {
|
||||||
$boundary = trim(substr($boundary, 0, -1));
|
if ($boundary[strlen($boundary) - 1] == '%') {
|
||||||
if (is_numeric($boundary)) {
|
$boundary = trim(substr($boundary, 0, -1));
|
||||||
$boundary = $boundary * $data['grade'] / 100.0;
|
if (is_numeric($boundary)) {
|
||||||
} else {
|
$boundary = $boundary * $data['grade'] / 100.0;
|
||||||
|
} else {
|
||||||
|
$errors["feedbackboundaries[$i]"] =
|
||||||
|
get_string('feedbackerrorboundaryformat', 'quiz', $i + 1);
|
||||||
|
}
|
||||||
|
} else if (!is_numeric($boundary)) {
|
||||||
$errors["feedbackboundaries[$i]"] =
|
$errors["feedbackboundaries[$i]"] =
|
||||||
get_string('feedbackerrorboundaryformat', 'quiz', $i + 1);
|
get_string('feedbackerrorboundaryformat', 'quiz', $i + 1);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user