MDL-25899 Lesson: fixed page content rendering
authorDavid Mudrak <david@moodle.com>
Fri, 18 Feb 2011 10:43:24 +0000 (11:43 +0100)
committerDavid Mudrak <david@moodle.com>
Fri, 18 Feb 2011 10:43:24 +0000 (11:43 +0100)
Form element 'header' used to be used for rendering the page contents.
This led to layout problems in non-gecko browsers. This patch fixes the
issue by using raw 'html' element to render the page contents.

mod/lesson/pagetypes/essay.php
mod/lesson/pagetypes/matching.php
mod/lesson/pagetypes/multichoice.php
mod/lesson/pagetypes/numerical.php
mod/lesson/pagetypes/shortanswer.php
mod/lesson/pagetypes/truefalse.php

index 2ae796f..2f7d4f9 100644 (file)
@@ -252,7 +252,9 @@ class lesson_display_answer_form_essay extends moodleform {
         $mform = $this->_form;
         $contents = $this->_customdata['contents'];
 
-        $mform->addElement('header', 'pageheader', $OUTPUT->box($contents, 'contents'));
+        $mform->addElement('header', 'pageheader');
+
+        $mform->addElement('html', $OUTPUT->container($contents, 'contents'));
 
         $options = new stdClass;
         $options->para = false;
@@ -270,4 +272,4 @@ class lesson_display_answer_form_essay extends moodleform {
         $this->add_action_buttons(null, get_string("pleaseenteryouranswerinthebox", "lesson"));
     }
 
-}
\ No newline at end of file
+}
index 43335c0..3e40c63 100644 (file)
@@ -483,7 +483,9 @@ class lesson_display_answer_form_matching extends moodleform {
         $lessonid = $this->_customdata['lessonid'];
         $contents = $this->_customdata['contents'];
 
-        $mform->addElement('header', 'pageheader', $OUTPUT->box($contents, 'contents'));
+        $mform->addElement('header', 'pageheader');
+
+        $mform->addElement('html', $OUTPUT->container($contents, 'contents'));
 
         $options = new stdClass;
         $options->para = false;
@@ -514,4 +516,4 @@ class lesson_display_answer_form_matching extends moodleform {
         $this->add_action_buttons(null, get_string("pleasematchtheabovepairs", "lesson"));
     }
 
-}
\ No newline at end of file
+}
index a9d912f..f29268f 100644 (file)
@@ -485,7 +485,10 @@ class lesson_display_answer_form_multichoice_singleanswer extends moodleform {
             $attempt = new stdClass();
             $attempt->answerid = null;
         }
-        $mform->addElement('header', 'pageheader', $OUTPUT->box($contents, 'contents'));
+
+        $mform->addElement('header', 'pageheader');
+
+        $mform->addElement('html', $OUTPUT->container($contents, 'contents'));
 
         $options = new stdClass;
         $options->para = false;
@@ -524,7 +527,9 @@ class lesson_display_answer_form_multichoice_multianswer extends moodleform {
         $lessonid = $this->_customdata['lessonid'];
         $contents = $this->_customdata['contents'];
 
-        $mform->addElement('header', 'pageheader', $OUTPUT->box($contents, 'contents'));
+        $mform->addElement('header', 'pageheader');
+
+        $mform->addElement('html', $OUTPUT->container($contents, 'contents'));
 
         $options = new stdClass;
         $options->para = false;
index 56b1784..18fb54f 100644 (file)
@@ -264,7 +264,9 @@ class lesson_display_answer_form_numerical extends moodleform {
         $mform = $this->_form;
         $contents = $this->_customdata['contents'];
 
-        $mform->addElement('header', 'pageheader', $OUTPUT->box($contents, 'contents'));
+        $mform->addElement('header', 'pageheader');
+
+        $mform->addElement('html', $OUTPUT->container($contents, 'contents'));
 
         $options = new stdClass;
         $options->para = false;
@@ -282,4 +284,4 @@ class lesson_display_answer_form_numerical extends moodleform {
         $this->add_action_buttons(null, get_string("pleaseenteryouranswerinthebox", "lesson"));
     }
 
-}
\ No newline at end of file
+}
index 62e0a8e..821d614 100644 (file)
@@ -331,7 +331,9 @@ class lesson_display_answer_form_shortanswer extends moodleform {
         $mform = $this->_form;
         $contents = $this->_customdata['contents'];
 
-        $mform->addElement('header', 'pageheader', $OUTPUT->box($contents, 'contents'));
+        $mform->addElement('header', 'pageheader');
+
+        $mform->addElement('html', $OUTPUT->container($contents, 'contents'));
 
         $options = new stdClass;
         $options->para = false;
index 5bdbe22..61a1a7e 100644 (file)
@@ -299,7 +299,9 @@ class lesson_display_answer_form_truefalse extends moodleform {
             $attempt->answerid = null;
         }
 
-        $mform->addElement('header', 'pageheader', $OUTPUT->box($contents, 'contents'));
+        $mform->addElement('header', 'pageheader');
+
+        $mform->addElement('html', $OUTPUT->container($contents, 'contents'));
 
         $options = new stdClass();
         $options->para = false;
@@ -326,4 +328,4 @@ class lesson_display_answer_form_truefalse extends moodleform {
         $this->add_action_buttons(null, get_string("pleasecheckoneanswer", "lesson"));
     }
 
-}
\ No newline at end of file
+}