From ffd413d43695ae7f02a78fcf43ee79f4281923db Mon Sep 17 00:00:00 2001 From: Jean-Michel Vedrine Date: Sun, 8 Mar 2015 11:06:53 +0100 Subject: [PATCH] MDL-39262 mod_lesson: disable shortforms in lesson question display Conflicts: mod/lesson/pagetypes/shortanswer.php --- mod/lesson/pagetypes/essay.php | 3 +++ mod/lesson/pagetypes/matching.php | 3 +++ mod/lesson/pagetypes/multichoice.php | 6 ++++++ mod/lesson/pagetypes/numerical.php | 3 +++ mod/lesson/pagetypes/shortanswer.php | 3 +++ mod/lesson/pagetypes/truefalse.php | 3 +++ 6 files changed, 21 insertions(+) diff --git a/mod/lesson/pagetypes/essay.php b/mod/lesson/pagetypes/essay.php index cceef9ad8b4..c15df389e55 100644 --- a/mod/lesson/pagetypes/essay.php +++ b/mod/lesson/pagetypes/essay.php @@ -279,6 +279,9 @@ class lesson_display_answer_form_essay extends moodleform { } } + // Disable shortforms. + $mform->setDisableShortforms(); + $mform->addElement('header', 'pageheader'); $mform->addElement('html', $OUTPUT->container($contents, 'contents')); diff --git a/mod/lesson/pagetypes/matching.php b/mod/lesson/pagetypes/matching.php index ea0f0f44b4b..b6ff03a8acd 100644 --- a/mod/lesson/pagetypes/matching.php +++ b/mod/lesson/pagetypes/matching.php @@ -496,6 +496,9 @@ class lesson_display_answer_form_matching extends moodleform { $lessonid = $this->_customdata['lessonid']; $contents = $this->_customdata['contents']; + // Disable shortforms. + $mform->setDisableShortforms(); + $mform->addElement('header', 'pageheader'); $mform->addElement('html', $OUTPUT->container($contents, 'contents')); diff --git a/mod/lesson/pagetypes/multichoice.php b/mod/lesson/pagetypes/multichoice.php index ceb7bf04cc7..af8eb696a89 100644 --- a/mod/lesson/pagetypes/multichoice.php +++ b/mod/lesson/pagetypes/multichoice.php @@ -472,6 +472,9 @@ class lesson_display_answer_form_multichoice_singleanswer extends moodleform { $attempt->answerid = null; } + // Disable shortforms. + $mform->setDisableShortforms(); + $mform->addElement('header', 'pageheader'); $mform->addElement('html', $OUTPUT->container($contents, 'contents')); @@ -525,6 +528,9 @@ class lesson_display_answer_form_multichoice_multianswer extends moodleform { $lessonid = $this->_customdata['lessonid']; $contents = $this->_customdata['contents']; + // Disable shortforms. + $mform->setDisableShortforms(); + $mform->addElement('header', 'pageheader'); $mform->addElement('html', $OUTPUT->container($contents, 'contents')); diff --git a/mod/lesson/pagetypes/numerical.php b/mod/lesson/pagetypes/numerical.php index 0285965bcdf..bc4b1d7bcf8 100644 --- a/mod/lesson/pagetypes/numerical.php +++ b/mod/lesson/pagetypes/numerical.php @@ -263,6 +263,9 @@ class lesson_display_answer_form_numerical extends moodleform { $mform = $this->_form; $contents = $this->_customdata['contents']; + // Disable shortforms. + $mform->setDisableShortforms(); + $mform->addElement('header', 'pageheader'); $mform->addElement('html', $OUTPUT->container($contents, 'contents')); diff --git a/mod/lesson/pagetypes/shortanswer.php b/mod/lesson/pagetypes/shortanswer.php index db6e79e2a36..6b5f15f8af1 100644 --- a/mod/lesson/pagetypes/shortanswer.php +++ b/mod/lesson/pagetypes/shortanswer.php @@ -345,6 +345,9 @@ class lesson_display_answer_form_shortanswer extends moodleform { } } + // Disable shortforms. + $mform->setDisableShortforms(); + $mform->addElement('header', 'pageheader'); $mform->addElement('html', $OUTPUT->container($contents, 'contents')); diff --git a/mod/lesson/pagetypes/truefalse.php b/mod/lesson/pagetypes/truefalse.php index 00c53e858c8..ee6af5e1abe 100644 --- a/mod/lesson/pagetypes/truefalse.php +++ b/mod/lesson/pagetypes/truefalse.php @@ -358,6 +358,9 @@ class lesson_display_answer_form_truefalse extends moodleform { $attempt->answerid = null; } + // Disable shortforms. + $mform->setDisableShortforms(); + $mform->addElement('header', 'pageheader'); $mform->addElement('html', $OUTPUT->container($contents, 'contents'));