MDL-18910 full support for module intro editor with embedded images
This commit is contained in:
@@ -621,10 +621,8 @@ class password_access_rule extends quiz_access_rule_base {
|
||||
print_header('', '', '', 'quizpassword');
|
||||
}
|
||||
if (trim(strip_tags($this->_quiz->intro))) {
|
||||
$formatoptions = new stdClass;
|
||||
$formatoptions->noclean = true;
|
||||
$output .= print_box(format_text($this->_quiz->intro, $this->_quiz->introformat, $formatoptions),
|
||||
'generalbox', 'intro', true);
|
||||
$cm = get_coursemodule_from_id('quiz', $this->_quiz->id);
|
||||
$output .= print_box(format_module_intro('quiz', $this->_quiz, $cm->id), 'generalbox', 'intro', true);
|
||||
}
|
||||
$output .= print_box_start('generalbox', 'passwordbox', true);
|
||||
|
||||
|
||||
+2
-1
@@ -573,6 +573,7 @@ function quiz_refresh_events($courseid = 0) {
|
||||
$moduleid = $DB->get_field('modules', 'id', array('name' => 'quiz'));
|
||||
|
||||
foreach ($quizzes as $quiz) {
|
||||
$cm = get_coursemodule_from_id('quiz', $quiz->id);
|
||||
$event = NULL;
|
||||
$event2 = NULL;
|
||||
$event2old = NULL;
|
||||
@@ -590,7 +591,7 @@ function quiz_refresh_events($courseid = 0) {
|
||||
}
|
||||
|
||||
$event->name = $quiz->name;
|
||||
$event->description = $quiz->intro;
|
||||
$event->description = format_module_intro('quiz', $quiz, $cm->id);
|
||||
$event->courseid = $quiz->course;
|
||||
$event->groupid = 0;
|
||||
$event->userid = 0;
|
||||
|
||||
@@ -54,9 +54,7 @@ class mod_quiz_mod_form extends moodleform_mod {
|
||||
$mform->addRule('name', null, 'required', null, 'client');
|
||||
|
||||
/// Introduction.
|
||||
$mform->addElement('htmleditor', 'intro', get_string('introduction', 'quiz'));
|
||||
$mform->setType('intro', PARAM_RAW);
|
||||
$mform->setHelpButton('intro', array('richtext2', get_string('helprichtext')));
|
||||
$this->add_intro_editor(false, get_string('introduction', 'quiz'));
|
||||
|
||||
/// Open and close dates.
|
||||
$mform->addElement('date_time_selector', 'timeopen', get_string('quizopen', 'quiz'), array('optional' => true));
|
||||
|
||||
+1
-4
@@ -95,10 +95,7 @@
|
||||
/// Print quiz name and description
|
||||
print_heading(format_string($quiz->name));
|
||||
if (trim(strip_tags($quiz->intro))) {
|
||||
$formatoptions->noclean = true;
|
||||
$formatoptions->para = false;
|
||||
$formatoptions->noclean = true;
|
||||
print_box(format_text($quiz->intro, $quiz->introformat, $formatoptions), 'generalbox', 'intro');
|
||||
print_box(format_module_intro('quiz', $quiz, $cm->id), 'generalbox', 'intro');
|
||||
}
|
||||
|
||||
/// Display information about this quiz.
|
||||
|
||||
Reference in New Issue
Block a user