-
Notifications
You must be signed in to change notification settings - Fork 0
/
prodjudge.sql
390 lines (322 loc) · 9.64 KB
/
prodjudge.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
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
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
-- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
-- Värd: localhost
-- Skapad: 15 december 2009 kl 11:36
-- Serverversion: 5.1.36
-- PHP-version: 5.3.0
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Databas: `prodjudge`
--
-- --------------------------------------------------------
--
-- Struktur för tabell `pj_axis`
--
CREATE TABLE IF NOT EXISTS `pj_axis` (
`qid` int(11) NOT NULL,
`dimension` varchar(140) COLLATE utf8_swedish_ci NOT NULL,
`left` varchar(140) COLLATE utf8_swedish_ci NOT NULL,
`right` varchar(140) COLLATE utf8_swedish_ci NOT NULL,
PRIMARY KEY (`qid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;
--
-- Data i tabell `pj_axis`
--
INSERT INTO `pj_axis` (`qid`, `dimension`, `left`, `right`) VALUES
(1, 'Appetising, tasty', 'Least', 'Most'),
(2, 'Functional, practical', 'Least', 'Most'),
(3, 'Appealing, attractive', 'Least', 'Most'),
(4, 'Comfortable, ergonomic', 'Least', 'Most'),
(5, '”Suits public environments”, institutional', 'Least', 'Most'),
(6, 'Modern, trendy', 'Least', 'Most'),
(7, 'Unique, distinctive, characteristic', 'Least', 'Most');
-- --------------------------------------------------------
--
-- Struktur för tabell `pj_images`
--
CREATE TABLE IF NOT EXISTS `pj_images` (
`iid` int(11) NOT NULL AUTO_INCREMENT,
`filename` varchar(140) COLLATE utf8_swedish_ci NOT NULL,
PRIMARY KEY (`iid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=14 ;
--
-- Data i tabell `pj_images`
--
INSERT INTO `pj_images` (`iid`, `filename`) VALUES
(1, 'Faatoelj_A'),
(2, 'Faatoelj_B'),
(3, 'Faatoelj_C'),
(4, 'Faatoelj_D'),
(5, 'Faatoelj_E'),
(6, 'Faatoelj_F'),
(7, 'Faatoelj_G'),
(8, 'Faatoelj_H'),
(9, 'Faatoelj_I'),
(10, 'Faatoelj_J'),
(11, 'fr_apelsin'),
(12, 'fr_apple'),
(13, 'fr_banana');
-- --------------------------------------------------------
--
-- Struktur för tabell `pj_imagesanswers`
--
CREATE TABLE IF NOT EXISTS `pj_imagesanswers` (
`iaid` int(11) NOT NULL AUTO_INCREMENT,
`quid` int(11) NOT NULL,
`iid` int(11) NOT NULL,
`x` int(11) NOT NULL,
`y` int(11) NOT NULL,
PRIMARY KEY (`iaid`),
KEY `iid` (`iid`),
KEY `quid` (`quid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=1 ;
--
-- Data i tabell `pj_imagesanswers`
--
-- --------------------------------------------------------
--
-- Struktur för tabell `pj_investigations`
--
CREATE TABLE IF NOT EXISTS `pj_investigations` (
`inid` int(11) NOT NULL AUTO_INCREMENT,
`orgid` int(11) NOT NULL,
`name` varchar(140) COLLATE utf8_swedish_ci NOT NULL,
PRIMARY KEY (`inid`),
KEY `orgid` (`orgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=2 ;
--
-- Data i tabell `pj_investigations`
--
INSERT INTO `pj_investigations` (`inid`, `orgid`, `name`) VALUES
(1, 1, 'Arm chairs');
-- --------------------------------------------------------
--
-- Struktur för tabell `pj_organization`
--
CREATE TABLE IF NOT EXISTS `pj_organization` (
`orgid` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(140) COLLATE utf8_swedish_ci NOT NULL,
PRIMARY KEY (`orgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=2 ;
--
-- Data i tabell `pj_organization`
--
INSERT INTO `pj_organization` (`orgid`, `name`) VALUES
(1, 'LTH');
-- --------------------------------------------------------
--
-- Struktur för tabell `pj_particip`
--
CREATE TABLE IF NOT EXISTS `pj_particip` (
`inid` int(11) NOT NULL,
`uid` int(11) NOT NULL,
KEY `inid` (`inid`),
KEY `uid` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;
--
-- Data i tabell `pj_particip`
--
-- --------------------------------------------------------
--
-- Struktur för tabell `pj_questions`
--
CREATE TABLE IF NOT EXISTS `pj_questions` (
`qid` int(11) NOT NULL AUTO_INCREMENT,
`inid` int(11) NOT NULL,
`text` varchar(140) COLLATE utf8_swedish_ci NOT NULL,
`frontispiece` varchar(140) COLLATE utf8_swedish_ci DEFAULT NULL,
`type` enum('prodstay','proddisa') COLLATE utf8_swedish_ci NOT NULL,
PRIMARY KEY (`qid`),
KEY `inid` (`inid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=8 ;
--
-- Data i tabell `pj_questions`
--
INSERT INTO `pj_questions` (`qid`, `inid`, `text`, `frontispiece`, `type`) VALUES
(1, 1, 'Assess the three fruits according to how you perceive them. Drag and drop the pictures along the line.', 'Before the real assessment starts, you will complete a test assessment.', 'prodstay'),
(2, 1, 'Assess the ten arm chairs according to how you perceive them. (1 of 6)', 'Now, the real assessment starts.', 'prodstay'),
(3, 1, 'Assess the ten arm chairs according to how you perceive them. (2 of 6)', NULL, 'prodstay'),
(4, 1, 'Assess the ten arm chairs according to how you perceive them. (3 of 6)', NULL, 'prodstay'),
(5, 1, 'Assess the ten arm chairs according to how you perceive them. (4 of 6)', NULL, 'prodstay'),
(6, 1, 'Assess the ten arm chairs according to how you perceive them. (5 of 6)', NULL, 'prodstay'),
(7, 1, 'Assess the ten arm chairs according to how you perceive them. (6 of 6)', NULL, 'prodstay');
-- --------------------------------------------------------
--
-- Struktur för tabell `pj_questionsimages`
--
CREATE TABLE IF NOT EXISTS `pj_questionsimages` (
`qid` int(11) NOT NULL,
`iid` int(11) NOT NULL,
KEY `qid` (`qid`,`iid`),
KEY `iid` (`iid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;
--
-- Data i tabell `pj_questionsimages`
--
INSERT INTO `pj_questionsimages` (`qid`, `iid`) VALUES
(1, 11),
(1, 12),
(1, 13),
(2, 1),
(2, 2),
(2, 3),
(2, 4),
(2, 5),
(2, 6),
(2, 7),
(2, 8),
(2, 9),
(2, 10),
(3, 1),
(3, 2),
(3, 3),
(3, 4),
(3, 5),
(3, 6),
(3, 7),
(3, 8),
(3, 9),
(3, 10),
(4, 1),
(4, 2),
(4, 3),
(4, 4),
(4, 5),
(4, 6),
(4, 7),
(4, 8),
(4, 9),
(4, 10),
(5, 1),
(5, 2),
(5, 3),
(5, 4),
(5, 5),
(5, 6),
(5, 7),
(5, 8),
(5, 9),
(5, 10),
(6, 1),
(6, 2),
(6, 3),
(6, 4),
(6, 5),
(6, 6),
(6, 7),
(6, 8),
(6, 9),
(6, 10),
(7, 1),
(7, 2),
(7, 3),
(7, 4),
(7, 5),
(7, 6),
(7, 7),
(7, 8),
(7, 9),
(7, 10);
-- --------------------------------------------------------
--
-- Struktur för tabell `pj_questionsusers`
--
CREATE TABLE IF NOT EXISTS `pj_questionsusers` (
`quid` int(11) NOT NULL AUTO_INCREMENT,
`qid` int(11) NOT NULL,
`uid` int(11) NOT NULL,
`stored` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`quid`),
KEY `qid` (`qid`,`uid`),
KEY `uid` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=1 ;
--
-- Data i tabell `pj_questionsusers`
--
-- --------------------------------------------------------
--
-- Struktur för tabell `pj_servers`
--
CREATE TABLE IF NOT EXISTS `pj_servers` (
`sid` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(140) COLLATE utf8_swedish_ci NOT NULL,
PRIMARY KEY (`sid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=2 ;
--
-- Data i tabell `pj_servers`
--
INSERT INTO `pj_servers` (`sid`, `name`) VALUES
(1, 'localhost/pj/');
-- --------------------------------------------------------
--
-- Struktur för tabell `pj_users`
--
CREATE TABLE IF NOT EXISTS `pj_users` (
`uid` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(140) COLLATE utf8_swedish_ci NOT NULL,
`firstname` varchar(140) COLLATE utf8_swedish_ci NOT NULL,
`lastname` varchar(140) COLLATE utf8_swedish_ci NOT NULL,
`password` varchar(140) COLLATE utf8_swedish_ci NOT NULL,
`level` int(11) NOT NULL,
`sid` int(11) NOT NULL,
PRIMARY KEY (`uid`),
KEY `sid` (`sid`),
KEY `sid_2` (`sid`),
KEY `sid_3` (`sid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=1 ;
--
-- Data i tabell `pj_users`
--
--
-- Restriktioner för dumpade tabeller
--
--
-- Restriktioner för tabell `pj_axis`
--
ALTER TABLE `pj_axis`
ADD CONSTRAINT `pj_axis_ibfk_1` FOREIGN KEY (`qid`) REFERENCES `pj_questions` (`qid`);
--
-- Restriktioner för tabell `pj_imagesanswers`
--
ALTER TABLE `pj_imagesanswers`
ADD CONSTRAINT `pj_imagesanswers_ibfk_3` FOREIGN KEY (`iid`) REFERENCES `pj_images` (`iid`),
ADD CONSTRAINT `pj_imagesanswers_ibfk_4` FOREIGN KEY (`quid`) REFERENCES `pj_questionsusers` (`quid`);
--
-- Restriktioner för tabell `pj_investigations`
--
ALTER TABLE `pj_investigations`
ADD CONSTRAINT `pj_investigations_ibfk_2` FOREIGN KEY (`orgid`) REFERENCES `pj_organization` (`orgid`);
--
-- Restriktioner för tabell `pj_particip`
--
ALTER TABLE `pj_particip`
ADD CONSTRAINT `pj_particip_ibfk_1` FOREIGN KEY (`inid`) REFERENCES `pj_investigations` (`inid`),
ADD CONSTRAINT `pj_particip_ibfk_2` FOREIGN KEY (`uid`) REFERENCES `pj_users` (`uid`);
--
-- Restriktioner för tabell `pj_questions`
--
ALTER TABLE `pj_questions`
ADD CONSTRAINT `pj_questions_ibfk_1` FOREIGN KEY (`inid`) REFERENCES `pj_investigations` (`inid`);
--
-- Restriktioner för tabell `pj_questionsimages`
--
ALTER TABLE `pj_questionsimages`
ADD CONSTRAINT `pj_questionsimages_ibfk_1` FOREIGN KEY (`qid`) REFERENCES `pj_questions` (`qid`),
ADD CONSTRAINT `pj_questionsimages_ibfk_2` FOREIGN KEY (`iid`) REFERENCES `pj_images` (`iid`);
--
-- Restriktioner för tabell `pj_questionsusers`
--
ALTER TABLE `pj_questionsusers`
ADD CONSTRAINT `pj_questionsusers_ibfk_1` FOREIGN KEY (`qid`) REFERENCES `pj_questions` (`qid`),
ADD CONSTRAINT `pj_questionsusers_ibfk_2` FOREIGN KEY (`uid`) REFERENCES `pj_users` (`uid`);
--
-- Restriktioner för tabell `pj_users`
--
ALTER TABLE `pj_users`
ADD CONSTRAINT `pj_users_ibfk_1` FOREIGN KEY (`sid`) REFERENCES `pj_servers` (`sid`);