mirror of
https://github.com/moodle/moodle.git
synced 2025-04-24 18:04:43 +02:00
Lesson/MDL-13311: make it possible to have a short answer question using 0 has answer. (merge)
This commit is contained in:
parent
f86eb734ee
commit
2e7938bb9f
@ -88,7 +88,9 @@
|
||||
$studentanswer = s($useranswer);
|
||||
break;
|
||||
case LESSON_SHORTANSWER :
|
||||
if (!$useranswer = $_POST['answer']) {
|
||||
if (isset($_POST['answer'])) {
|
||||
$useranswer = $_POST['answer'];
|
||||
} else {
|
||||
$noanswer = true;
|
||||
break;
|
||||
}
|
||||
|
@ -84,7 +84,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 ((!empty($form->answer[$i]) and trim(strip_tags($form->answer[$i]))) or isset($form->answereditor[$i]) or isset($form->responseeditor[$i])) {
|
||||
if ((isset($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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user