Skip to content

Commit

Permalink
MDL-48965 mod_lesson: avoid short answer question without any answers
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Michel Vedrine committed Mar 7, 2015
1 parent b90f98d commit 400fa4a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mod/lesson/pagetypes/shortanswer.php
Expand Up @@ -337,7 +337,8 @@ public function custom_definition() {

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);
Expand Down

0 comments on commit 400fa4a

Please sign in to comment.