File: mysql.sql

package info (click to toggle)
moodle 1.4.4.dfsg.1-3sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 57,876 kB
  • ctags: 29,496
  • sloc: php: 271,617; sql: 5,084; xml: 702; perl: 638; sh: 403; java: 283; makefile: 42; pascal: 21
file content (370 lines) | stat: -rw-r--r-- 13,005 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
# phpMyAdmin SQL Dump
# version 2.5.7
# http://www.phpmyadmin.net
#
# Host: localhost
# Generation Time: Jul 30, 2004 at 02:52 PM
# Server version: 4.0.18
# PHP Version: 4.3.7
# Database : `moodle`
# --------------------------------------------------------

#
# Table structure for table `quiz`
#

CREATE TABLE `prefix_quiz` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `course` int(10) unsigned NOT NULL default '0',
  `name` varchar(255) NOT NULL default '',
  `intro` text NOT NULL,
  `timeopen` int(10) unsigned NOT NULL default '0',
  `timeclose` int(10) unsigned NOT NULL default '0',
  `attempts` smallint(6) NOT NULL default '0',
  `attemptonlast` tinyint(4) NOT NULL default '0',
  `feedback` tinyint(4) NOT NULL default '0',
  `correctanswers` tinyint(4) NOT NULL default '1',
  `grademethod` tinyint(4) NOT NULL default '1',
  `review` tinyint(4) NOT NULL default '0',
  `shufflequestions` tinyint(4) NOT NULL default '0',
  `shuffleanswers` tinyint(4) NOT NULL default '0',
  `questions` text NOT NULL,
  `sumgrades` int(10) NOT NULL default '0',
  `grade` int(10) NOT NULL default '0',
  `timecreated` int(10) unsigned NOT NULL default '0',
  `timemodified` int(10) unsigned NOT NULL default '0',
  `timelimit` int(2) unsigned NOT NULL default '0',
  `password` varchar(255) NOT NULL default '',
  `subnet` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`id`),
  KEY `course` (`course`)
) TYPE=MyISAM COMMENT='Main information about each quiz';
# --------------------------------------------------------

#
# Table structure for table `quiz_answers`
#

CREATE TABLE `prefix_quiz_answers` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `question` int(10) unsigned NOT NULL default '0',
  `answer` varchar(255) NOT NULL default '',
  `fraction` varchar(10) NOT NULL default '0.0',
  `feedback` text NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `question` (`question`)
) TYPE=MyISAM COMMENT='Answers, with a fractional grade (0-1) and feedback';
# --------------------------------------------------------

#
# Table structure for table `quiz_attemptonlast_datasets`
#

CREATE TABLE `prefix_quiz_attemptonlast_datasets` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `category` int(10) unsigned NOT NULL default '0',
  `userid` int(10) unsigned NOT NULL default '0',
  `datasetnumber` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `category` (`category`,`userid`)
) TYPE=MyISAM COMMENT='Dataset number for attemptonlast attempts per user';
# --------------------------------------------------------

#
# Table structure for table `quiz_attempts`
#

CREATE TABLE `prefix_quiz_attempts` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `quiz` int(10) unsigned NOT NULL default '0',
  `userid` int(10) unsigned NOT NULL default '0',
  `attempt` smallint(6) NOT NULL default '0',
  `sumgrades` varchar(10) NOT NULL default '0.0',
  `timestart` int(10) unsigned NOT NULL default '0',
  `timefinish` int(10) unsigned NOT NULL default '0',
  `timemodified` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `quiz` (`quiz`),
  KEY `userid` (`userid`)
) TYPE=MyISAM COMMENT='Stores various attempts on a quiz';
# --------------------------------------------------------

#
# Table structure for table `quiz_calculated`
#

CREATE TABLE `prefix_quiz_calculated` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `question` int(10) unsigned NOT NULL default '0',
  `answer` int(10) unsigned NOT NULL default '0',
  `tolerance` varchar(20) NOT NULL default '0.0',
  `tolerancetype` int(10) NOT NULL default '1',
  `correctanswerlength` int(10) NOT NULL default '2',
  PRIMARY KEY  (`id`),
  KEY `question` (`question`),
  KEY `answer` (`answer`)
) TYPE=MyISAM COMMENT='Options for questions of type calculated';
# --------------------------------------------------------

#
# Table structure for table `quiz_categories`
#

CREATE TABLE `prefix_quiz_categories` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `course` int(10) unsigned NOT NULL default '0',
  `name` varchar(255) NOT NULL default '',
  `info` text NOT NULL,
  `publish` tinyint(4) NOT NULL default '0',
  `stamp` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`id`),
  KEY `course` (`course`)
) TYPE=MyISAM COMMENT='Categories are for grouping questions';
# --------------------------------------------------------

#
# Table structure for table `quiz_dataset_definitions`
#

CREATE TABLE `prefix_quiz_dataset_definitions` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `category` int(10) unsigned NOT NULL default '0',
  `name` varchar(255) NOT NULL default '',
  `type` int(10) NOT NULL default '0',
  `options` varchar(255) NOT NULL default '',
  `itemcount` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `category` (`category`)
) TYPE=MyISAM COMMENT='Organises and stores properties for dataset items';
# --------------------------------------------------------

#
# Table structure for table `quiz_dataset_items`
#

CREATE TABLE `prefix_quiz_dataset_items` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `definition` int(10) unsigned NOT NULL default '0',
  `number` int(10) unsigned NOT NULL default '0',
  `value` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`id`),
  KEY `definition` (`definition`)
) TYPE=MyISAM COMMENT='Individual dataset items';
# --------------------------------------------------------

#
# Table structure for table `quiz_grades`
#

CREATE TABLE `prefix_quiz_grades` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `quiz` int(10) unsigned NOT NULL default '0',
  `userid` int(10) unsigned NOT NULL default '0',
  `grade` varchar(10) NOT NULL default '0.0',
  `timemodified` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `quiz` (`quiz`),
  KEY `userid` (`userid`)
) TYPE=MyISAM COMMENT='Final quiz grade (may be best of several attempts)';
# --------------------------------------------------------

#
# Table structure for table `quiz_match`
#

CREATE TABLE `prefix_quiz_match` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `question` int(10) unsigned NOT NULL default '0',
  `subquestions` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`id`),
  KEY `question` (`question`)
) TYPE=MyISAM COMMENT='Defines fixed matching questions';
# --------------------------------------------------------

#
# Table structure for table `quiz_match_sub`
#

CREATE TABLE `prefix_quiz_match_sub` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `question` int(10) unsigned NOT NULL default '0',
  `questiontext` text NOT NULL,
  `answertext` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`id`),
  KEY `question` (`question`)
) TYPE=MyISAM COMMENT='Defines the subquestions that make up a matching question';
# --------------------------------------------------------

#
# Table structure for table `quiz_multianswers`
#

CREATE TABLE `prefix_quiz_multianswers` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `question` int(10) unsigned NOT NULL default '0',
  `answers` varchar(255) NOT NULL default '',
  `positionkey` varchar(255) NOT NULL default '',
  `answertype` smallint(6) NOT NULL default '0',
  `norm` int(10) unsigned NOT NULL default '1',
  PRIMARY KEY  (`id`),
  KEY `question` (`question`)
) TYPE=MyISAM COMMENT='Options for multianswer questions';
# --------------------------------------------------------

#
# Table structure for table `quiz_multichoice`
#

CREATE TABLE `prefix_quiz_multichoice` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `question` int(10) unsigned NOT NULL default '0',
  `layout` tinyint(4) NOT NULL default '0',
  `answers` varchar(255) NOT NULL default '',
  `single` tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `question` (`question`)
) TYPE=MyISAM COMMENT='Options for multiple choice questions';
# --------------------------------------------------------

#
# Table structure for table `quiz_numerical`
#

CREATE TABLE `prefix_quiz_numerical` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `question` int(10) unsigned NOT NULL default '0',
  `answer` int(10) unsigned NOT NULL default '0',
  `min` varchar(255) NOT NULL default '',
  `max` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`id`),
  KEY `answer` (`answer`),
  KEY `question` (`question`)
) TYPE=MyISAM COMMENT='Options for numerical questions';
# --------------------------------------------------------

#
# Table structure for table `quiz_numerical_units`
#

CREATE TABLE `prefix_quiz_numerical_units` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `question` int(10) unsigned NOT NULL default '0',
  `multiplier` decimal(40,20) NOT NULL default '1.00000000000000000000',
  `unit` varchar(50) NOT NULL default '',
  PRIMARY KEY  (`id`),
  KEY `question` (`question`)
) TYPE=MyISAM COMMENT='Optional unit options for numerical questions';
# --------------------------------------------------------

#
# Table structure for table `quiz_question_datasets`
#

CREATE TABLE `prefix_quiz_question_datasets` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `question` int(10) unsigned NOT NULL default '0',
  `datasetdefinition` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `question` (`question`,`datasetdefinition`)
) TYPE=MyISAM COMMENT='Many-many relation between questions and dataset definitions';
# --------------------------------------------------------

#
# Table structure for table `quiz_question_grades`
#

CREATE TABLE `prefix_quiz_question_grades` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `quiz` int(10) unsigned NOT NULL default '0',
  `question` int(10) unsigned NOT NULL default '0',
  `grade` smallint(6) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `quiz` (`quiz`),
  KEY `question` (`question`)
) TYPE=MyISAM COMMENT='The grade for a question in a quiz';
# --------------------------------------------------------

#
# Table structure for table `quiz_questions`
#

CREATE TABLE `prefix_quiz_questions` (
  `id` int(10) NOT NULL auto_increment,
  `category` int(10) NOT NULL default '0',
  `name` varchar(255) NOT NULL default '',
  `questiontext` text NOT NULL,
  `questiontextformat` tinyint(2) NOT NULL default '0',
  `image` varchar(255) NOT NULL default '',
  `defaultgrade` int(10) unsigned NOT NULL default '1',
  `qtype` smallint(6) NOT NULL default '0',
  `stamp` varchar(255) NOT NULL default '',
  `version` int(10) NOT NULL default '1',
  PRIMARY KEY  (`id`),
  KEY `category` (`category`)
) TYPE=MyISAM COMMENT='The quiz questions themselves';
# --------------------------------------------------------

#
# Table structure for table `quiz_randomsamatch`
#

CREATE TABLE `prefix_quiz_randomsamatch` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `question` int(10) unsigned NOT NULL default '0',
  `choose` int(10) unsigned NOT NULL default '4',
  PRIMARY KEY  (`id`),
  KEY `question` (`question`)
) TYPE=MyISAM COMMENT='Info about a random short-answer matching question';
# --------------------------------------------------------

#
# Table structure for table `quiz_responses`
#

CREATE TABLE `prefix_quiz_responses` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `attempt` int(10) unsigned NOT NULL default '0',
  `question` int(10) unsigned NOT NULL default '0',
  `answer` varchar(255) NOT NULL default '',
  `grade` varchar(10) NOT NULL default '0.0',
  PRIMARY KEY  (`id`),
  KEY `attempt` (`attempt`),
  KEY `question` (`question`)
) TYPE=MyISAM COMMENT='Stores user responses to a quiz, and percentage grades';
# --------------------------------------------------------

#
# Table structure for table `quiz_shortanswer`
#

CREATE TABLE `prefix_quiz_shortanswer` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `question` int(10) unsigned NOT NULL default '0',
  `answers` varchar(255) NOT NULL default '',
  `usecase` tinyint(2) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `question` (`question`)
) TYPE=MyISAM COMMENT='Options for short answer questions';
# --------------------------------------------------------

#
# Table structure for table `quiz_truefalse`
#

CREATE TABLE `prefix_quiz_truefalse` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `question` int(10) unsigned NOT NULL default '0',
  `trueanswer` int(10) unsigned NOT NULL default '0',
  `falseanswer` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `question` (`question`)
) TYPE=MyISAM COMMENT='Options for True-False questions';
# --------------------------------------------------------

INSERT INTO prefix_log_display VALUES ('quiz', 'add', 'quiz', 'name');
INSERT INTO prefix_log_display VALUES ('quiz', 'update', 'quiz', 'name');
INSERT INTO prefix_log_display VALUES ('quiz', 'view', 'quiz', 'name');
INSERT INTO prefix_log_display VALUES ('quiz', 'report', 'quiz', 'name');
INSERT INTO prefix_log_display VALUES ('quiz', 'attempt', 'quiz', 'name');
INSERT INTO prefix_log_display VALUES ('quiz', 'submit', 'quiz', 'name');
INSERT INTO prefix_log_display VALUES ('quiz', 'review', 'quiz', 'name');