mirror of
https://github.com/moodle/moodle.git
synced 2025-03-13 04:01:40 +01:00
Added default values to migrate2utf8.xml, for any varchar and text field types, if the default values for these fields were not defined as '' in the MySQL table creation script. Committed by vyshane
237 lines
8.5 KiB
XML
Executable File
237 lines
8.5 KiB
XML
Executable File
<DBMIGRATION type="mod/quiz" VERSION="2005120100">
|
|
<TABLES>
|
|
<TABLE name="quiz_attemptonlast_datasets" />
|
|
<TABLE name="quiz_grades" />
|
|
<TABLE name="quiz_question_datasets" />
|
|
<TABLE name="quiz_question_instances" />
|
|
<TABLE name="quiz_question_versions" />
|
|
<TABLE name="quiz_randomsamatch" />
|
|
<TABLE name="quiz_truefalse" />
|
|
<TABLE name="quiz_rqp">
|
|
<FIELDS>
|
|
<FIELD name="format" method="NO_CONV" type="varchar" length="255" />
|
|
</FIELDS>
|
|
</TABLE>
|
|
<TABLE name="quiz_rqp_servers">
|
|
<FIELDS>
|
|
<FIELD name="url" method="NO_CONV" type="varchar" length="255" />
|
|
</FIELDS>
|
|
</TABLE>
|
|
<TABLE name="quiz_rqp_states">
|
|
<FIELDS>
|
|
<FIELD name="responses" method="NO_CONV" type="text" length="0" />
|
|
<FIELD name="persistent_data" method="NO_CONV" type="text" length="0" />
|
|
<FIELD name="template_vars" method="NO_CONV" type="text" length="0" />
|
|
</FIELDS>
|
|
</TABLE>
|
|
<TABLE name="quiz_rqp_types">
|
|
<FIELDS>
|
|
<FIELD name="name" method="NO_CONV" type="varchar" length="255" dropindex="name" adduniqueindex="name (name(255))"/>
|
|
</FIELDS>
|
|
</TABLE>
|
|
<TABLE name="quiz_shortanswer">
|
|
<FIELDS>
|
|
<FIELD name="answers" method="NO_CONV" type="varchar" length="255" />
|
|
</FIELDS>
|
|
</TABLE>
|
|
<TABLE name="quiz_numerical">
|
|
<FIELDS>
|
|
<FIELD name="tolerance" method="NO_CONV" type="varchar" length="255" default="0.0" />
|
|
</FIELDS>
|
|
</TABLE>
|
|
<TABLE name="quiz_newest_states">
|
|
<FIELDS>
|
|
<FIELD name="sumpenalty" method="NO_CONV" type="varchar" length="10" default="0.0" />
|
|
</FIELDS>
|
|
</TABLE>
|
|
<TABLE name="quiz_multichoice">
|
|
<FIELDS>
|
|
<FIELD name="answers" method="NO_CONV" type="varchar" length="255" />
|
|
</FIELDS>
|
|
</TABLE>
|
|
<TABLE name="quiz_multianswers">
|
|
<FIELDS>
|
|
<FIELD name="sequence" method="NO_CONV" type="varchar" length="255" />
|
|
</FIELDS>
|
|
</TABLE>
|
|
<TABLE name="quiz_match">
|
|
<FIELDS>
|
|
<FIELD name="subquestions" method="NO_CONV" type="varchar" length="255" />
|
|
</FIELDS>
|
|
</TABLE>
|
|
<TABLE name="quiz_essay">
|
|
<FIELDS>
|
|
<FIELD name="answer" method="NO_CONV" type="varchar" length="255" />
|
|
</FIELDS>
|
|
</TABLE>
|
|
<TABLE name="quiz_dataset_items">
|
|
<FIELDS>
|
|
<FIELD name="value" method="NO_CONV" type="varchar" length="255" />
|
|
</FIELDS>
|
|
</TABLE>
|
|
<TABLE name="quiz_calculated">
|
|
<FIELDS>
|
|
<FIELD name="tolerance" method="NO_CONV" type="varchar" length="20" default="0.0" />
|
|
</FIELDS>
|
|
</TABLE>
|
|
<TABLE name="quiz_attempts">
|
|
<FIELDS>
|
|
<FIELD name="sumgrades" method="NO_CONV" type="varchar" length="10" default="0.0" />
|
|
<FIELD name="layout" method="NO_CONV" type="text" length="0" />
|
|
</FIELDS>
|
|
</TABLE>
|
|
<TABLE name="quiz_states">
|
|
<FIELDS>
|
|
<FIELD name="answer" method="PLAIN_SQL_UPDATE" type="text" length="0">
|
|
<SQL_DETECT_USER>
|
|
SELECT qa.userid
|
|
FROM {$CFG->prefix}quiz_states qs,
|
|
{$CFG->prefix}quiz_attempts qa
|
|
WHERE qa.id = qs.attempt
|
|
AND qs.id=RECORDID
|
|
</SQL_DETECT_USER>
|
|
<SQL_DETECT_COURSE>
|
|
SELECT q.course
|
|
FROM {$CFG->prefix}quiz q,
|
|
{$CFG->prefix}quiz_states qs,
|
|
{$CFG->prefix}quiz_attempts qa
|
|
WHERE q.id = qa.quiz
|
|
AND qa.id = qs.attempt
|
|
AND qs.id = RECORDID
|
|
</SQL_DETECT_COURSE>
|
|
</FIELD>
|
|
<FIELD name="grade" method="NO_CONV" type="varchar" length="10" />
|
|
<FIELD name="raw_grade" method="NO_CONV" type="varchar" length="10" />
|
|
<FIELD name="penalty" method="NO_CONV" type="varchar" length="10" />
|
|
</FIELDS>
|
|
</TABLE>
|
|
<TABLE name="quiz_questions">
|
|
<FIELDS>
|
|
<FIELD name="name" method="PHP_FUNCTION" type="varchar" length="255">
|
|
<PHP_FUNCTION>
|
|
migrate2utf8_quiz_questions_name(RECORDID)
|
|
</PHP_FUNCTION>
|
|
</FIELD>
|
|
<FIELD name="questiontext" method="PHP_FUNCTION" type="text" length="0">
|
|
<PHP_FUNCTION>
|
|
migrate2utf8_quiz_questions_questiontext(RECORDID)
|
|
</PHP_FUNCTION>
|
|
</FIELD>
|
|
<FIELD name="image" method="NO_CONV" type="varchar" length="255" />
|
|
<FIELD name="stamp" method="NO_CONV" type="varchar" length="255" />
|
|
</FIELDS>
|
|
</TABLE>
|
|
<TABLE name="quiz_numerical_units">
|
|
<FIELDS>
|
|
<FIELD name="unit" method="PHP_FUNCTION" type="varchar" length="50">
|
|
<PHP_FUNCTION>
|
|
migrate2utf8_quiz_numerical_units_unit(RECORDID)
|
|
</PHP_FUNCTION>
|
|
</FIELD>
|
|
</FIELDS>
|
|
</TABLE>
|
|
<TABLE name="quiz_match_sub">
|
|
<FIELDS>
|
|
<FIELD name="questiontext" method="PHP_FUNCTION" type="text" length="0">
|
|
<PHP_FUNCTION>
|
|
migrate2utf8_quiz_match_sub_questionext(RECORDID)
|
|
</PHP_FUNCTION>
|
|
</FIELD>
|
|
<FIELD name="answertext" method="PHP_FUNCTION" type="varchar" length="255">
|
|
<PHP_FUNCTION>
|
|
migrate2utf8_quiz_match_sub_answertext(RECORDID)
|
|
</PHP_FUNCTION>
|
|
</FIELD>
|
|
</FIELDS>
|
|
</TABLE>
|
|
<TABLE name="quiz_answers">
|
|
<FIELDS>
|
|
<FIELD name="answer" method="PHP_FUNCTION" type="text" length="0">
|
|
<PHP_FUNCTION>
|
|
migrate2utf8_quiz_answers_answer(RECORDID)
|
|
</PHP_FUNCTION>
|
|
</FIELD>
|
|
<FIELD name="fraction" method="NO_CONV" type="varchar" length="10" default="0.0"/>
|
|
<FIELD name="feedback" method="PHP_FUNCTION" type="text" length="0">
|
|
<PHP_FUNCTION>
|
|
migrate2utf8_quiz_answers_feedback(RECORDID)
|
|
</PHP_FUNCTION>
|
|
</FIELD>
|
|
</FIELDS>
|
|
</TABLE>
|
|
<TABLE name="quiz_dataset_definitions">
|
|
<FIELDS>
|
|
<FIELD name="name" method="PHP_FUNCTION" type="varchar" length="255">
|
|
<PHP_FUNCTION>
|
|
migrate2utf8_quiz_dataset_definitions_name(RECORDID)
|
|
</PHP_FUNCTION>
|
|
</FIELD>
|
|
<FIELD name="options" method="NO_CONV" type="varchar" length="255" />
|
|
</FIELDS>
|
|
</TABLE>
|
|
<TABLE name="quiz_essay_states">
|
|
<FIELDS>
|
|
<FIELD name="fraction" method="NO_CONV" type="varchar" length="10" default="0.0" />
|
|
<FIELD name="response" method="PLAIN_SQL_UPDATE" type="text" length="0">
|
|
<SQL_DETECT_USER>
|
|
SELECT qa.userid
|
|
FROM {$CFG->prefix}quiz_states qs,
|
|
{$CFG->prefix}quiz_attempts qa,
|
|
{$CFG->prefix}quiz_essay_states qes
|
|
WHERE qa.id = qs.attempt
|
|
AND qs.id = qes.stateid
|
|
AND qes.id = RECORDID
|
|
</SQL_DETECT_USER>
|
|
<SQL_DETECT_COURSE>
|
|
SELECT q.course
|
|
FROM {$CFG->prefix}quiz q,
|
|
{$CFG->prefix}quiz_attempts qa,
|
|
{$CFG->prefix}quiz_states qs,
|
|
{$CFG->prefix}quiz_essay_states qes
|
|
WHERE q.id = qa.quiz
|
|
AND qa.id = qs.attempt
|
|
AND qs.id = qes.stateid
|
|
AND qes.id = RECORDID
|
|
</SQL_DETECT_COURSE>
|
|
</FIELD>
|
|
</FIELDS>
|
|
</TABLE>
|
|
<TABLE name="quiz_categories">
|
|
<FIELDS>
|
|
<FIELD name="name" method="PHP_FUNCTION" type="varchar" length="255">
|
|
<PHP_FUNCTION>
|
|
migrate2utf8_quiz_categories_name(RECORDID)
|
|
</PHP_FUNCTION>
|
|
</FIELD>
|
|
<FIELD name="info" method="PHP_FUNCTION" type="text" length="0">
|
|
<PHP_FUNCTION>
|
|
migrate2utf8_quiz_categories_info(RECORDID)
|
|
</PHP_FUNCTION>
|
|
</FIELD>
|
|
<FIELD name="stamp" method="NO_CONV" type="varchar" length="255" />
|
|
</FIELDS>
|
|
</TABLE>
|
|
<TABLE name="quiz">
|
|
<FIELDS>
|
|
<FIELD name="name" method="PHP_FUNCTION" type="varchar" length="255">
|
|
<PHP_FUNCTION>
|
|
migrate2utf8_quiz_name(RECORDID)
|
|
</PHP_FUNCTION>
|
|
</FIELD>
|
|
<FIELD name="intro" method="PHP_FUNCTION" type="text" length="0">
|
|
<PHP_FUNCTION>
|
|
migrate2utf8_quiz_intro(RECORDID)
|
|
</PHP_FUNCTION>
|
|
</FIELD>
|
|
<FIELD name="questions" method="NO_CONV" type="text" length="0" />
|
|
<FIELD name="password" method="PHP_FUNCTION" type="varchar" length="255">
|
|
<PHP_FUNCTION>
|
|
migrate2utf8_quiz_password(RECORDID)
|
|
</PHP_FUNCTION>
|
|
</FIELD>
|
|
<FIELD name="subnet" method="NO_CONV" type="varchar" length="255" />
|
|
</FIELDS>
|
|
</TABLE>
|
|
</TABLES>
|
|
</DBMIGRATION>
|