[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:
mark-nielsen 2006-03-19 02:16:00 +00:00
parent aeade7e227
commit 8bd7bacd14

View File

@ -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");