MDL-11082 Improved groups upgrade performance 1.8x -> 1.9; thanks Eloy for telling...
[moodle-pu.git] / mod / lesson / db / install.xml
blob94f74bee080e145adb3e7420dcd0f362a89d2aa3
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <XMLDB PATH="mod/lesson/db" VERSION="20070223" COMMENT="XMLDB file for Moodle mod/lesson"
3     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4     xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
6   <TABLES>
7     <TABLE NAME="lesson" COMMENT="Defines lesson" NEXT="lesson_pages">
8       <FIELDS>
9         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="course"/>
10         <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="name"/>
11         <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="practice"/>
12         <FIELD NAME="practice" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="modattempts"/>
13         <FIELD NAME="modattempts" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="practice" NEXT="usepassword"/>
14         <FIELD NAME="usepassword" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="modattempts" NEXT="password"/>
15         <FIELD NAME="password" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="usepassword" NEXT="dependency"/>
16         <FIELD NAME="dependency" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="password" NEXT="conditions"/>
17         <FIELD NAME="conditions" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="dependency" NEXT="grade"/>
18         <FIELD NAME="grade" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="conditions" NEXT="custom"/>
19         <FIELD NAME="custom" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="grade" NEXT="ongoing"/>
20         <FIELD NAME="ongoing" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="custom" NEXT="usemaxgrade"/>
21         <FIELD NAME="usemaxgrade" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="ongoing" NEXT="maxanswers"/>
22         <FIELD NAME="maxanswers" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="4" SEQUENCE="false" ENUM="false" PREVIOUS="usemaxgrade" NEXT="maxattempts"/>
23         <FIELD NAME="maxattempts" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="5" SEQUENCE="false" ENUM="false" PREVIOUS="maxanswers" NEXT="review"/>
24         <FIELD NAME="review" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="maxattempts" NEXT="nextpagedefault"/>
25         <FIELD NAME="nextpagedefault" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="review" NEXT="feedback"/>
26         <FIELD NAME="feedback" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="nextpagedefault" NEXT="minquestions"/>
27         <FIELD NAME="minquestions" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="feedback" NEXT="maxpages"/>
28         <FIELD NAME="maxpages" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="minquestions" NEXT="timed"/>
29         <FIELD NAME="timed" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="maxpages" NEXT="maxtime"/>
30         <FIELD NAME="maxtime" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timed" NEXT="retake"/>
31         <FIELD NAME="retake" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="maxtime" NEXT="activitylink"/>
32         <FIELD NAME="activitylink" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="retake" NEXT="mediafile"/>
33         <FIELD NAME="mediafile" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="activitylink" NEXT="mediaheight"/>
34         <FIELD NAME="mediaheight" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="100" SEQUENCE="false" ENUM="false" PREVIOUS="mediafile" NEXT="mediawidth"/>
35         <FIELD NAME="mediawidth" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="650" SEQUENCE="false" ENUM="false" PREVIOUS="mediaheight" NEXT="mediaclose"/>
36         <FIELD NAME="mediaclose" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="mediawidth" NEXT="slideshow"/>
37         <FIELD NAME="slideshow" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="mediaclose" NEXT="width"/>
38         <FIELD NAME="width" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="640" SEQUENCE="false" ENUM="false" PREVIOUS="slideshow" NEXT="height"/>
39         <FIELD NAME="height" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="480" SEQUENCE="false" ENUM="false" PREVIOUS="width" NEXT="bgcolor"/>
40         <FIELD NAME="bgcolor" TYPE="char" LENGTH="7" NOTNULL="true" DEFAULT="#FFFFFF" SEQUENCE="false" ENUM="false" PREVIOUS="height" NEXT="displayleft"/>
41         <FIELD NAME="displayleft" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="bgcolor" NEXT="displayleftif"/>
42         <FIELD NAME="displayleftif" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="displayleft" NEXT="progressbar"/>
43         <FIELD NAME="progressbar" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="displayleftif" NEXT="highscores"/>
44         <FIELD NAME="highscores" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="progressbar" NEXT="maxhighscores"/>
45         <FIELD NAME="maxhighscores" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="highscores" NEXT="available"/>
46         <FIELD NAME="available" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="maxhighscores" NEXT="deadline"/>
47         <FIELD NAME="deadline" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="available" NEXT="timemodified"/>
48         <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="deadline"/>
49       </FIELDS>
50       <KEYS>
51         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for lesson"/>
52       </KEYS>
53       <INDEXES>
54         <INDEX NAME="course" UNIQUE="false" FIELDS="course"/>
55       </INDEXES>
56     </TABLE>
57     <TABLE NAME="lesson_pages" COMMENT="Defines lesson_pages" PREVIOUS="lesson" NEXT="lesson_answers">
58       <FIELDS>
59         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="lessonid"/>
60         <FIELD NAME="lessonid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="prevpageid"/>
61         <FIELD NAME="prevpageid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="lessonid" NEXT="nextpageid"/>
62         <FIELD NAME="nextpageid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="prevpageid" NEXT="qtype"/>
63         <FIELD NAME="qtype" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="nextpageid" NEXT="qoption"/>
64         <FIELD NAME="qoption" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="qtype" NEXT="layout"/>
65         <FIELD NAME="layout" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="qoption" NEXT="display"/>
66         <FIELD NAME="display" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="layout" NEXT="timecreated"/>
67         <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="display" NEXT="timemodified"/>
68         <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timecreated" NEXT="title"/>
69         <FIELD NAME="title" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified" NEXT="contents"/>
70         <FIELD NAME="contents" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="title"/>
71       </FIELDS>
72       <KEYS>
73         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for lesson_pages" NEXT="lessonid"/>
74         <KEY NAME="lessonid" TYPE="foreign" FIELDS="lessonid" REFTABLE="lesson" REFFIELDS="id" PREVIOUS="primary"/>
75       </KEYS>
76     </TABLE>
77     <TABLE NAME="lesson_answers" COMMENT="Defines lesson_answers" PREVIOUS="lesson_pages" NEXT="lesson_attempts">
78       <FIELDS>
79         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="lessonid"/>
80         <FIELD NAME="lessonid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="pageid"/>
81         <FIELD NAME="pageid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="lessonid" NEXT="jumpto"/>
82         <FIELD NAME="jumpto" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="pageid" NEXT="grade"/>
83         <FIELD NAME="grade" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="jumpto" NEXT="score"/>
84         <FIELD NAME="score" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="grade" NEXT="flags"/>
85         <FIELD NAME="flags" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="score" NEXT="timecreated"/>
86         <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="flags" NEXT="timemodified"/>
87         <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timecreated" NEXT="answer"/>
88         <FIELD NAME="answer" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified" NEXT="response"/>
89         <FIELD NAME="response" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="answer"/>
90       </FIELDS>
91       <KEYS>
92         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for lesson_answers" NEXT="lessonid"/>
93         <KEY NAME="lessonid" TYPE="foreign" FIELDS="lessonid" REFTABLE="lesson" REFFIELDS="id" PREVIOUS="primary" NEXT="pageid"/>
94         <KEY NAME="pageid" TYPE="foreign" FIELDS="pageid" REFTABLE="lesson_pages" REFFIELDS="id" PREVIOUS="lessonid"/>
95       </KEYS>
96     </TABLE>
97     <TABLE NAME="lesson_attempts" COMMENT="Defines lesson_attempts" PREVIOUS="lesson_answers" NEXT="lesson_grades">
98       <FIELDS>
99         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="lessonid"/>
100         <FIELD NAME="lessonid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="pageid"/>
101         <FIELD NAME="pageid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="lessonid" NEXT="userid"/>
102         <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="pageid" NEXT="answerid"/>
103         <FIELD NAME="answerid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="retry"/>
104         <FIELD NAME="retry" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="answerid" NEXT="correct"/>
105         <FIELD NAME="correct" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="retry" NEXT="useranswer"/>
106         <FIELD NAME="useranswer" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="correct" NEXT="timeseen"/>
107         <FIELD NAME="timeseen" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="useranswer"/>
108       </FIELDS>
109       <KEYS>
110         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for lesson_attempts" NEXT="lessonid"/>
111         <KEY NAME="lessonid" TYPE="foreign" FIELDS="lessonid" REFTABLE="lesson" REFFIELDS="id" PREVIOUS="primary" NEXT="pageid"/>
112         <KEY NAME="pageid" TYPE="foreign" FIELDS="pageid" REFTABLE="lesson_pages" REFFIELDS="id" PREVIOUS="lessonid" NEXT="answerid"/>
113         <KEY NAME="answerid" TYPE="foreign" FIELDS="answerid" REFTABLE="lesson_answers" REFFIELDS="id" PREVIOUS="pageid"/>
114       </KEYS>
115       <INDEXES>
116         <INDEX NAME="userid" UNIQUE="false" FIELDS="userid"/>
117       </INDEXES>
118     </TABLE>
119     <TABLE NAME="lesson_grades" COMMENT="Defines lesson_grades" PREVIOUS="lesson_attempts" NEXT="lesson_default">
120       <FIELDS>
121         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="lessonid"/>
122         <FIELD NAME="lessonid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
123         <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="lessonid" NEXT="grade"/>
124         <FIELD NAME="grade" TYPE="float" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="late"/>
125         <FIELD NAME="late" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="grade" NEXT="completed"/>
126         <FIELD NAME="completed" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="late"/>
127       </FIELDS>
128       <KEYS>
129         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for lesson_grades" NEXT="lessonid"/>
130         <KEY NAME="lessonid" TYPE="foreign" FIELDS="lessonid" REFTABLE="lesson" REFFIELDS="id" PREVIOUS="primary"/>
131       </KEYS>
132       <INDEXES>
133         <INDEX NAME="userid" UNIQUE="false" FIELDS="userid"/>
134       </INDEXES>
135     </TABLE>
136     <TABLE NAME="lesson_default" COMMENT="Defines lesson_default" PREVIOUS="lesson_grades" NEXT="lesson_timer">
137       <FIELDS>
138         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="course"/>
139         <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="practice"/>
140         <FIELD NAME="practice" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="modattempts"/>
141         <FIELD NAME="modattempts" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="practice" NEXT="usepassword"/>
142         <FIELD NAME="usepassword" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="modattempts" NEXT="password"/>
143         <FIELD NAME="password" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="usepassword" NEXT="conditions"/>
144         <FIELD NAME="conditions" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="password" NEXT="grade"/>
145         <FIELD NAME="grade" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="conditions" NEXT="custom"/>
146         <FIELD NAME="custom" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="grade" NEXT="ongoing"/>
147         <FIELD NAME="ongoing" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="custom" NEXT="usemaxgrade"/>
148         <FIELD NAME="usemaxgrade" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="ongoing" NEXT="maxanswers"/>
149         <FIELD NAME="maxanswers" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="4" SEQUENCE="false" ENUM="false" PREVIOUS="usemaxgrade" NEXT="maxattempts"/>
150         <FIELD NAME="maxattempts" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="5" SEQUENCE="false" ENUM="false" PREVIOUS="maxanswers" NEXT="review"/>
151         <FIELD NAME="review" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="maxattempts" NEXT="nextpagedefault"/>
152         <FIELD NAME="nextpagedefault" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="review" NEXT="feedback"/>
153         <FIELD NAME="feedback" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="nextpagedefault" NEXT="minquestions"/>
154         <FIELD NAME="minquestions" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="feedback" NEXT="maxpages"/>
155         <FIELD NAME="maxpages" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="minquestions" NEXT="timed"/>
156         <FIELD NAME="timed" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="maxpages" NEXT="maxtime"/>
157         <FIELD NAME="maxtime" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timed" NEXT="retake"/>
158         <FIELD NAME="retake" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="maxtime" NEXT="mediaheight"/>
159         <FIELD NAME="mediaheight" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="100" SEQUENCE="false" ENUM="false" PREVIOUS="retake" NEXT="mediawidth"/>
160         <FIELD NAME="mediawidth" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="650" SEQUENCE="false" ENUM="false" PREVIOUS="mediaheight" NEXT="mediaclose"/>
161         <FIELD NAME="mediaclose" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="mediawidth" NEXT="slideshow"/>
162         <FIELD NAME="slideshow" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="mediaclose" NEXT="width"/>
163         <FIELD NAME="width" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="640" SEQUENCE="false" ENUM="false" PREVIOUS="slideshow" NEXT="height"/>
164         <FIELD NAME="height" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="480" SEQUENCE="false" ENUM="false" PREVIOUS="width" NEXT="bgcolor"/>
165         <FIELD NAME="bgcolor" TYPE="char" LENGTH="7" NOTNULL="false" DEFAULT="#FFFFFF" SEQUENCE="false" ENUM="false" PREVIOUS="height" NEXT="displayleft"/>
166         <FIELD NAME="displayleft" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="bgcolor" NEXT="displayleftif"/>
167         <FIELD NAME="displayleftif" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="displayleft" NEXT="progressbar"/>
168         <FIELD NAME="progressbar" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="displayleftif" NEXT="highscores"/>
169         <FIELD NAME="highscores" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="progressbar" NEXT="maxhighscores"/>
170         <FIELD NAME="maxhighscores" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="highscores"/>
171       </FIELDS>
172       <KEYS>
173         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for lesson_default"/>
174       </KEYS>
175     </TABLE>
176     <TABLE NAME="lesson_timer" COMMENT="lesson timer for each lesson" PREVIOUS="lesson_default" NEXT="lesson_branch">
177       <FIELDS>
178         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="lessonid"/>
179         <FIELD NAME="lessonid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
180         <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="lessonid" NEXT="starttime"/>
181         <FIELD NAME="starttime" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="lessontime"/>
182         <FIELD NAME="lessontime" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="starttime"/>
183       </FIELDS>
184       <KEYS>
185         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for lesson_timer" NEXT="lessonid"/>
186         <KEY NAME="lessonid" TYPE="foreign" FIELDS="lessonid" REFTABLE="lesson" REFFIELDS="id" PREVIOUS="primary"/>
187       </KEYS>
188       <INDEXES>
189         <INDEX NAME="userid" UNIQUE="false" FIELDS="userid"/>
190       </INDEXES>
191     </TABLE>
192     <TABLE NAME="lesson_branch" COMMENT="branches for each lesson/user" PREVIOUS="lesson_timer" NEXT="lesson_high_scores">
193       <FIELDS>
194         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="lessonid"/>
195         <FIELD NAME="lessonid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
196         <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="lessonid" NEXT="pageid"/>
197         <FIELD NAME="pageid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="retry"/>
198         <FIELD NAME="retry" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="pageid" NEXT="flag"/>
199         <FIELD NAME="flag" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="retry" NEXT="timeseen"/>
200         <FIELD NAME="timeseen" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="flag"/>
201       </FIELDS>
202       <KEYS>
203         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for lesson_branch" NEXT="lessonid"/>
204         <KEY NAME="lessonid" TYPE="foreign" FIELDS="lessonid" REFTABLE="lesson" REFFIELDS="id" PREVIOUS="primary" NEXT="pageid"/>
205         <KEY NAME="pageid" TYPE="foreign" FIELDS="pageid" REFTABLE="lesson_pages" REFFIELDS="id" PREVIOUS="lessonid"/>
206       </KEYS>
207       <INDEXES>
208         <INDEX NAME="userid" UNIQUE="false" FIELDS="userid"/>
209       </INDEXES>
210     </TABLE>
211     <TABLE NAME="lesson_high_scores" COMMENT="high scores for each lesson" PREVIOUS="lesson_branch">
212       <FIELDS>
213         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="lessonid"/>
214         <FIELD NAME="lessonid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
215         <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="lessonid" NEXT="gradeid"/>
216         <FIELD NAME="gradeid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="nickname"/>
217         <FIELD NAME="nickname" TYPE="char" LENGTH="5" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="gradeid"/>
218       </FIELDS>
219       <KEYS>
220         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for lesson_high_scores" NEXT="lessonid"/>
221         <KEY NAME="lessonid" TYPE="foreign" FIELDS="lessonid" REFTABLE="lesson" REFFIELDS="id" PREVIOUS="primary"/>
222       </KEYS>
223       <INDEXES>
224         <INDEX NAME="userid" UNIQUE="false" FIELDS="userid"/>
225       </INDEXES>
226     </TABLE>
227   </TABLES>
228   <STATEMENTS>
229     <STATEMENT NAME="insert log_display" TYPE="insert" TABLE="log_display" COMMENT="Initial insert of records on table log_display">
230       <SENTENCES>
231         <SENTENCE TEXT="(module, action, mtable, field) VALUES ('lesson', 'start', 'lesson', 'name')" />
232         <SENTENCE TEXT="(module, action, mtable, field) VALUES ('lesson', 'end', 'lesson', 'name')" />
233         <SENTENCE TEXT="(module, action, mtable, field) VALUES ('lesson', 'view', 'lesson_pages', 'title')" />
234       </SENTENCES>
235     </STATEMENT>
236   </STATEMENTS>
237 </XMLDB>