Commit 18b5df91 authored by skodak's avatar skodak
Browse files

MDL-18910 normalised module intro and introformat

parent 6507d1a9
......@@ -233,6 +233,14 @@ function xmldb_forum_upgrade($oldversion) {
upgrade_mod_savepoint($result, 2009042003, 'forum');
}
if ($result && $oldversion < 2009042004) {
/// set format to current
$DB->set_field('forum', 'introformat', FORMAT_MOODLE, array());
/// quiz savepoint reached
upgrade_mod_savepoint($result, 2009042004, 'forum');
}
return $result;
}
......
......@@ -5,7 +5,7 @@
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////
$module->version = 2009042003;
$module->version = 2009042004;
$module->requires = 2009041700; // Requires this Moodle version
$module->cron = 60;
......
......@@ -623,7 +623,7 @@ class password_access_rule extends quiz_access_rule_base {
if (trim(strip_tags($this->_quiz->intro))) {
$formatoptions = new stdClass;
$formatoptions->noclean = true;
$output .= print_box(format_text($this->_quiz->intro, FORMAT_MOODLE, $formatoptions),
$output .= print_box(format_text($this->_quiz->intro, $this->_quiz->introformat, $formatoptions),
'generalbox', 'intro', true);
}
$output .= print_box_start('generalbox', 'passwordbox', true);
......
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="mod/quiz/db" VERSION="20090107" COMMENT="XMLDB file for Moodle mod/quiz"
<XMLDB PATH="mod/quiz/db" VERSION="20090420" COMMENT="XMLDB file for Moodle mod/quiz"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
......@@ -9,8 +9,9 @@
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="course"/>
<FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Foreign key references course.id." PREVIOUS="id" NEXT="name"/>
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" COMMENT="The name of this quiz." PREVIOUS="course" NEXT="intro"/>
<FIELD NAME="intro" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" COMMENT="The introductory text desplayed on the view.php page." PREVIOUS="name" NEXT="timeopen"/>
<FIELD NAME="timeopen" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Time at which students may start attempting this quiz." PREVIOUS="intro" NEXT="timeclose"/>
<FIELD NAME="intro" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" COMMENT="The introductory text desplayed on the view.php page." PREVIOUS="name" NEXT="introformat"/>
<FIELD NAME="introformat" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="intro" NEXT="timeopen"/>
<FIELD NAME="timeopen" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Time at which students may start attempting this quiz." PREVIOUS="introformat" NEXT="timeclose"/>
<FIELD NAME="timeclose" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Time by which students must have completed their attempt." PREVIOUS="timeopen" NEXT="optionflags"/>
<FIELD NAME="optionflags" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="This stores the adaptive mode setting for this quiz." PREVIOUS="timeclose" NEXT="penaltyscheme"/>
<FIELD NAME="penaltyscheme" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Stores the apply penaties setting." PREVIOUS="optionflags" NEXT="attempts"/>
......@@ -71,7 +72,7 @@
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="quiz"/>
<FIELD NAME="quiz" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Foreign key references quiz.id." PREVIOUS="id" NEXT="userid"/>
<FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Foreign key references user.id." PREVIOUS="quiz" NEXT="grade"/>
<FIELD NAME="grade" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="The overall grade from the quiz. Not affected by overrides in the gradebook." DECIMALS="5" PREVIOUS="userid" NEXT="timemodified"/>
<FIELD NAME="grade" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" DECIMALS="5" COMMENT="The overall grade from the quiz. Not affected by overrides in the gradebook." PREVIOUS="userid" NEXT="timemodified"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="The last time this grade changed." PREVIOUS="grade"/>
</FIELDS>
<KEYS>
......
......@@ -276,6 +276,22 @@ function xmldb_quiz_upgrade($oldversion) {
upgrade_mod_savepoint($result, 2009031001, 'quiz');
}
if ($result && $oldversion < 2009042000) {
/// Define field introformat to be added to quiz
$table = new xmldb_table('quiz');
$field = new xmldb_field('introformat', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'intro');
/// Launch add field introformat
$dbman->add_field($table, $field);
/// set format to current
$DB->set_field('quiz', 'introformat', FORMAT_MOODLE, array());
/// quiz savepoint reached
upgrade_mod_savepoint($result, 2009042000, 'quiz');
}
return $result;
}
......@@ -5,8 +5,8 @@
// This fragment is called by moodle_needs_upgrading() and /admin/index.php
////////////////////////////////////////////////////////////////////////////////
$module->version = 2009031001; // The (date) version of this module
$module->requires = 2008072401; // Requires this Moodle version
$module->version = 2009042000; // The (date) version of this module
$module->requires = 2009041700; // Requires this Moodle version
$module->cron = 0; // How often should cron check this module (seconds)?
?>
......@@ -97,7 +97,8 @@
if (trim(strip_tags($quiz->intro))) {
$formatoptions->noclean = true;
$formatoptions->para = false;
print_box(format_text($quiz->intro, FORMAT_MOODLE, $formatoptions), 'generalbox', 'intro');
$formatoptions->noclean = true;
print_box(format_text($quiz->intro, $quiz->introformat, $formatoptions), 'generalbox', 'intro');
}
/// Display information about this quiz.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment