mirror of
https://github.com/moodle/moodle.git
synced 2025-03-18 22:50:19 +01:00
MDL-48965 mod_lesson: avoid short answer question without any answers
This commit is contained in:
parent
b90f98dade
commit
400fa4a1b5
@ -337,7 +337,8 @@ class lesson_add_page_form_shortanswer extends lesson_add_page_form_base {
|
||||
|
||||
for ($i = 0; $i < $this->_customdata['lesson']->maxanswers; $i++) {
|
||||
$this->_form->addElement('header', 'answertitle'.$i, get_string('answer').' '.($i+1));
|
||||
$this->add_answer($i);
|
||||
// Only first answer is required.
|
||||
$this->add_answer($i, null, ($i < 1));
|
||||
$this->add_response($i);
|
||||
$this->add_jumpto($i, null, ($i == 0 ? LESSON_NEXTPAGE : LESSON_THISPAGE));
|
||||
$this->add_score($i, null, ($i===0)?1:0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user