From a4ff234c80b1ee5ae9a663cac842c0abe3be7389 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 1a2c8d1b526..fa91855157c 100644 --- a/mod/lesson/pagetypes/matching.php +++ b/mod/lesson/pagetypes/matching.php @@ -518,6 +518,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 c22a6ea0bb4..4286a3f37a5 100644 --- a/mod/lesson/pagetypes/multichoice.php +++ b/mod/lesson/pagetypes/multichoice.php @@ -476,6 +476,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')); @@ -529,6 +532,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 6a1b00b9708..0c937183383 100644 --- a/mod/lesson/pagetypes/numerical.php +++ b/mod/lesson/pagetypes/numerical.php @@ -264,6 +264,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 3b5c9a230db..c2b1485d2ed 100644 --- a/mod/lesson/pagetypes/shortanswer.php +++ b/mod/lesson/pagetypes/shortanswer.php @@ -350,6 +350,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 c0376c6bb27..d09cd5dbe15 100644 --- a/mod/lesson/pagetypes/truefalse.php +++ b/mod/lesson/pagetypes/truefalse.php @@ -367,6 +367,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'));