mirrored from git://git.moodle.org/moodle.git
/
postgres7.sql
246 lines (210 loc) · 6.94 KB
/
postgres7.sql
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
# phpMyAdmin MySQL-Dump
# version 2.3.2-dev
# http://www.phpmyadmin.net/ (download page)
#
# Host: localhost
# Generation Time: Oct 16, 2002 at 01:12 AM
# Server version: 3.23.49
# PHP Version: 4.2.3
# Database : moodle
# --------------------------------------------------------
#
# Table structure for table quiz
#
CREATE TABLE prefix_quiz (
id SERIAL PRIMARY KEY,
course integer NOT NULL default '0',
name varchar(255) NOT NULL default '',
intro text NOT NULL default '',
timeopen integer NOT NULL default '0',
timeclose integer NOT NULL default '0',
attempts integer NOT NULL default '0',
attemptonlast integer NOT NULL default '0',
feedback integer NOT NULL default '0',
correctanswers integer NOT NULL default '1',
grademethod integer NOT NULL default '1',
review integer NOT NULL default '0',
shufflequestions integer NOT NULL default '0',
shuffleanswers integer NOT NULL default '0',
questions text NOT NULL default '',
sumgrades integer NOT NULL default '0',
grade integer NOT NULL default '0',
timecreated integer NOT NULL default '0',
timemodified integer NOT NULL default '0'
);
# --------------------------------------------------------
#
# Table structure for table quiz_answers
#
CREATE TABLE prefix_quiz_answers (
id SERIAL PRIMARY KEY,
question integer NOT NULL default '0',
answer varchar(255) NOT NULL default '',
fraction varchar(10) NOT NULL default '0.0',
feedback text NOT NULL default ''
);
# --------------------------------------------------------
#
# Table structure for table quiz_attempts
#
CREATE TABLE prefix_quiz_attempts (
id SERIAL PRIMARY KEY,
quiz integer NOT NULL default '0',
userid integer NOT NULL default '0',
attempt integer NOT NULL default '0',
sumgrades varchar(10) NOT NULL default '0.0',
timestart integer NOT NULL default '0',
timefinish integer NOT NULL default '0',
timemodified integer NOT NULL default '0'
);
# --------------------------------------------------------
#
# Table structure for table quiz_categories
#
CREATE TABLE prefix_quiz_categories (
id SERIAL PRIMARY KEY,
course integer NOT NULL default '0',
name varchar(255) NOT NULL default '',
info text NOT NULL default '',
publish integer NOT NULL default '0',
stamp varchar(255) NOT NULL default ''
);
# --------------------------------------------------------
#
# Table structure for table quiz_grades
#
CREATE TABLE prefix_quiz_grades (
id SERIAL PRIMARY KEY,
quiz integer NOT NULL default '0',
userid integer NOT NULL default '0',
grade varchar(10) NOT NULL default '0.0',
timemodified integer NOT NULL default '0'
);
# --------------------------------------------------------
#
# Table structure for table quiz_match
#
CREATE TABLE prefix_quiz_match (
id SERIAL PRIMARY KEY,
question integer NOT NULL default '0',
subquestions varchar(255) NOT NULL default ''
);
# --------------------------------------------------------
CREATE INDEX prefix_quiz_match_question_idx ON prefix_quiz_match (question);
#
# Table structure for table `quiz_match_sub`
#
CREATE TABLE prefix_quiz_match_sub (
id SERIAL PRIMARY KEY,
question integer NOT NULL default '0',
questiontext text NOT NULL default '',
answertext varchar(255) NOT NULL default ''
);
# --------------------------------------------------------
CREATE INDEX prefix_quiz_match_sub_question_idx ON prefix_quiz_match_sub (question);
#
# Table structure for table `quiz_multianswers`
#
CREATE TABLE prefix_quiz_multianswers (
id SERIAL PRIMARY KEY,
question integer NOT NULL default '0',
answers varchar(255) NOT NULL default '',
positionkey varchar(255) NOT NULL default '',
answertype integer NOT NULL default '0',
norm integer NOT NULL default '1'
);
CREATE INDEX prefix_quiz_multianswers_question_idx ON prefix_quiz_multianswers (question);
#
# Table structure for table quiz_multichoice
#
CREATE TABLE prefix_quiz_multichoice (
id SERIAL PRIMARY KEY,
question integer NOT NULL default '0',
layout integer NOT NULL default '0',
answers varchar(255) NOT NULL default '',
single integer NOT NULL default '0'
);
# --------------------------------------------------------
CREATE INDEX prefix_quiz_multichoice_question_idx ON prefix_quiz_multichoice (question);
#
# Table structure for table quiz_numerical
#
CREATE TABLE prefix_quiz_numerical (
id SERIAL PRIMARY KEY,
question integer NOT NULL default '0',
answer integer NOT NULL default '0',
min varchar(255) NOT NULL default '',
max varchar(255) NOT NULL default ''
);
# --------------------------------------------------------
CREATE INDEX prefix_quiz_numerical_answer_idx ON prefix_quiz_numerical (answer);
#
# Table structure for table quiz_question_grades
#
CREATE TABLE prefix_quiz_question_grades (
id SERIAL PRIMARY KEY,
quiz integer NOT NULL default '0',
question integer NOT NULL default '0',
grade integer NOT NULL default '0'
);
# --------------------------------------------------------
#
# Table structure for table quiz_questions
#
CREATE TABLE prefix_quiz_questions (
id SERIAL PRIMARY KEY,
category integer NOT NULL default '0',
name varchar(255) NOT NULL default '',
questiontext text NOT NULL default '',
image varchar(255) NOT NULL default '',
defaultgrade integer NOT NULL default '1',
qtype integer NOT NULL default '0',
stamp varchar(255) NOT NULL default '',
version integer NOT NULL default '1'
);
# --------------------------------------------------------
#
# Table structure for table quiz_randomsamatch
#
CREATE TABLE prefix_quiz_randomsamatch (
id SERIAL PRIMARY KEY,
question integer NOT NULL default '0',
choose integer NOT NULL default '4'
);
#
# Table structure for table quiz_responses
#
CREATE TABLE prefix_quiz_responses (
id SERIAL PRIMARY KEY,
attempt integer NOT NULL default '0',
question integer NOT NULL default '0',
answer varchar(255) NOT NULL default '',
grade varchar(10) NOT NULL default '0.0'
);
# --------------------------------------------------------
#
# Table structure for table quiz_shortanswer
#
CREATE TABLE prefix_quiz_shortanswer (
id SERIAL PRIMARY KEY,
question integer NOT NULL default '0',
answers varchar(255) NOT NULL default '',
usecase integer NOT NULL default '0'
);
# --------------------------------------------------------
CREATE INDEX prefix_quiz_shortanswer_question_idx ON prefix_quiz_shortanswer (question);
#
# Table structure for table quiz_truefalse
#
CREATE TABLE prefix_quiz_truefalse (
id SERIAL PRIMARY KEY,
question integer NOT NULL default '0',
trueanswer integer NOT NULL default '0',
falseanswer integer NOT NULL default '0'
);
CREATE INDEX prefix_quiz_truefalse_question_idx ON prefix_quiz_truefalse (question);
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');