mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
[Fixed] this page was shooting of warnings for unset variable score. Now checks to make sure score is set before using it.
This commit is contained in:
parent
aeade7e227
commit
8bd7bacd14
@ -103,7 +103,7 @@
|
||||
$oldanswer->response = '';
|
||||
}
|
||||
$oldanswer->jumpto = clean_param($form->jumpto[$i], PARAM_INT);
|
||||
if ($lesson->custom) {
|
||||
if (isset($form->score[$i])) {
|
||||
$oldanswer->score = clean_param($form->score[$i], PARAM_INT);
|
||||
}
|
||||
if (!update_record("lesson_answers", $oldanswer)) {
|
||||
@ -128,7 +128,9 @@
|
||||
$newanswer->response = trim($form->response[$i]);
|
||||
}
|
||||
$newanswer->jumpto = clean_param($form->jumpto[$i], PARAM_INT);
|
||||
$newanswer->score = clean_param($form->score[$i], PARAM_INT);
|
||||
if (isset($form->score[$i])) {
|
||||
$newanswer->score = clean_param($form->score[$i], PARAM_INT);
|
||||
}
|
||||
$newanswerid = insert_record("lesson_answers", $newanswer);
|
||||
if (!$newanswerid) {
|
||||
error("Update page: answer record not inserted");
|
||||
|
Loading…
x
Reference in New Issue
Block a user