1 <?xml version="1.0" encoding="UTF-8" ?>
2 <XMLDB PATH="mod/choice/db" VERSION="20060808" COMMENT="XMLDB file for Moodle mod/choice">
4 <TABLE NAME="choice" COMMENT="Available choices are stored here" NEXT="choice_options">
6 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="course"/>
7 <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="name"/>
8 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="text"/>
9 <FIELD NAME="text" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="format"/>
10 <FIELD NAME="format" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="text" NEXT="publish"/>
11 <FIELD NAME="publish" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="format" NEXT="showresults"/>
12 <FIELD NAME="showresults" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="publish" NEXT="display"/>
13 <FIELD NAME="display" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="showresults" NEXT="allowupdate"/>
14 <FIELD NAME="allowupdate" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="display" NEXT="showunanswered"/>
15 <FIELD NAME="showunanswered" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="allowupdate" NEXT="limitanswers"/>
16 <FIELD NAME="limitanswers" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="showunanswered" NEXT="timeopen"/>
17 <FIELD NAME="timeopen" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="limitanswers" NEXT="timeclose"/>
18 <FIELD NAME="timeclose" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timeopen" NEXT="timemodified"/>
19 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timeclose"/>
22 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for choice"/>
25 <INDEX NAME="course" UNIQUE="false" FIELDS="course"/>
28 <TABLE NAME="choice_options" COMMENT="available options to choice" PREVIOUS="choice" NEXT="choice_answers">
30 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="choiceid"/>
31 <FIELD NAME="choiceid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="text"/>
32 <FIELD NAME="text" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="choiceid" NEXT="maxanswers"/>
33 <FIELD NAME="maxanswers" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="text" NEXT="timemodified"/>
34 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="maxanswers"/>
37 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for choice_options" NEXT="choiceid"/>
38 <KEY NAME="choiceid" TYPE="foreign" FIELDS="choiceid" REFTABLE="choice" REFFIELDS="id" PREVIOUS="primary"/>
41 <TABLE NAME="choice_answers" COMMENT="choices performed by users" PREVIOUS="choice_options">
43 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="choiceid"/>
44 <FIELD NAME="choiceid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
45 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="choiceid" NEXT="optionid"/>
46 <FIELD NAME="optionid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="timemodified"/>
47 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="optionid"/>
50 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for choice_answers" NEXT="choiceid"/>
51 <KEY NAME="choiceid" TYPE="foreign" FIELDS="choiceid" REFTABLE="choice" REFFIELDS="id" PREVIOUS="primary" NEXT="optionid"/>
52 <KEY NAME="optionid" TYPE="foreign" FIELDS="optionid" REFTABLE="choice_options" REFFIELDS="id" PREVIOUS="choiceid"/>
55 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid"/>
60 <STATEMENT NAME="insert log_display" TYPE="insert" TABLE="log_display" COMMENT="Initial insert of records on table log_display">
62 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('choice', 'view', 'choice', 'name')" />
63 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('choice', 'update', 'choice', 'name')" />
64 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('choice', 'add', 'choice', 'name')" />
65 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('choice', 'report', 'choice', 'name')" />
66 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('choice', 'choose', 'choice', 'name')" />
67 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('choice', 'choose again', 'choice', 'name')" />