Merged differences from MOODLE_16_STABLE into HEAD

This commit is contained in:
mark-nielsen
2006-08-25 18:33:50 +00:00
parent 09942a5ec2
commit 2fc13bc767
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -148,7 +148,7 @@
$lesson->maxanswers = $lesson->maxanswers + 2;
}
for ($i = 0; $i < $lesson->maxanswers; $i++) {
if (trim(strip_tags($form->answer[$i]))) { // strip_tags because the HTML editor adds <p><br />...
if (!empty($form->answer[$i]) and trim(strip_tags($form->answer[$i]))) { // strip_tags because the HTML editor adds <p><br />...
$newanswer->lessonid = $lesson->id;
$newanswer->pageid = $newpageid;
$newanswer->timecreated = $timenow;
+2 -2
View File
@@ -83,7 +83,7 @@
for ($i = 0; $i < $lesson->maxanswers; $i++) {
// strip tags because the editor gives <p><br />...
// also save any answers where the editor is (going to be) used
if (trim(strip_tags($form->answer[$i])) or isset($form->answereditor[$i]) or isset($form->responseeditor[$i])) {
if ((!empty($form->answer[$i]) and trim(strip_tags($form->answer[$i]))) or isset($form->answereditor[$i]) or isset($form->responseeditor[$i])) {
if ($form->answerid[$i]) {
$oldanswer = new stdClass;
$oldanswer->id = clean_param($form->answerid[$i], PARAM_INT);
@@ -162,7 +162,7 @@
error("Update page: answer $i not updated");
}
}
} elseif ($form->answerid[$i]) {
} elseif (!empty($form->answerid[$i])) {
// need to delete blanked out answer
if (!delete_records("lesson_answers", "id", clean_param($form->answerid[$i], PARAM_INT))) {
error("Update page: unable to delete answer record");