~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to examples/db/sample.sql

  • Committer: Matt Giuca
  • Date: 2009-02-24 02:02:03 UTC
  • mto: This revision was merged to the branch mainline in revision 1119.
  • Revision ID: matt.giuca@gmail.com-20090224020203-aqdcjnsj6y7wl32o
Added a new look to the IVLE header bar. Mmmm... Web 2.0.
Added top-level directory image-source, containing SVG and script files for
    generating the images.
ivle/webapp/coremedia/images: Added 'chrome' directory containing the rendered
    images.
Modified ivle/webapp/base/ivle-headings.html and
    ivle/webapp/coremedia/ivle.css to support the new images.
    Note that the H1 and H2 at the top of the page are no longer displayed
    (and their custom styles have been removed). There is a heading image
    instead.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
--
2
 
--
3
 
 
4
 
SET client_encoding = 'UTF8';
5
 
SET standard_conforming_strings = off;
6
 
SET check_function_bodies = false;
7
 
SET client_min_messages = warning;
8
 
SET escape_string_warning = off;
9
 
 
10
 
SET search_path = public, pg_catalog;
11
 
 
12
 
--
13
 
--
14
 
 
15
 
SELECT pg_catalog.setval('assessed_assessedid_seq', 1, false);
16
 
 
17
 
 
18
 
--
19
 
--
20
 
 
21
 
SELECT pg_catalog.setval('login_unixid_seq', 5004, true);
22
 
 
23
 
 
24
 
--
25
 
--
26
 
 
27
 
SELECT pg_catalog.setval('login_loginid_seq', 5, true);
28
 
 
29
 
 
30
 
--
31
 
--
32
 
 
33
 
SELECT pg_catalog.setval('offering_offeringid_seq', 6, true);
34
 
 
35
 
 
36
 
--
37
 
--
38
 
 
39
 
SELECT pg_catalog.setval('project_extension_extensionid_seq', 1, false);
40
 
 
41
 
 
42
 
--
43
 
--
44
 
 
45
 
SELECT pg_catalog.setval('project_group_groupid_seq', 1, true);
46
 
 
47
 
 
48
 
--
49
 
--
50
 
 
51
 
SELECT pg_catalog.setval('project_projectid_seq', 3, true);
52
 
 
53
 
 
54
 
--
55
 
--
56
 
 
57
 
SELECT pg_catalog.setval('project_set_projectsetid_seq', 2, true);
58
 
 
59
 
 
60
 
--
61
 
--
62
 
 
63
 
SELECT pg_catalog.setval('project_submission_submissionid_seq', 1, false);
64
 
 
65
 
 
66
 
--
67
 
--
68
 
 
69
 
SELECT pg_catalog.setval('semester_semesterid_seq', 4, true);
70
 
 
71
 
 
72
 
--
73
 
--
74
 
 
75
 
SELECT pg_catalog.setval('subject_subjectid_seq', 4, true);
76
 
 
77
 
 
78
 
--
79
 
--
80
 
 
81
 
SELECT pg_catalog.setval('suite_variable_varid_seq', 2, true);
82
 
 
83
 
 
84
 
--
85
 
--
86
 
 
87
 
SELECT pg_catalog.setval('test_case_part_partid_seq', 6, true);
88
 
 
89
 
 
90
 
--
91
 
--
92
 
 
93
 
SELECT pg_catalog.setval('test_case_testid_seq', 6, true);
94
 
 
95
 
 
96
 
--
97
 
--
98
 
 
99
 
SELECT pg_catalog.setval('test_suite_suiteid_seq', 3, true);
100
 
 
101
 
 
102
 
--
103
 
--
104
 
 
105
 
SELECT pg_catalog.setval('worksheet_exercise_ws_ex_id_seq', 1, false);
106
 
 
107
 
 
108
 
--
109
 
--
110
 
 
111
 
SELECT pg_catalog.setval('worksheet_worksheetid_seq', 1, false);
112
 
 
113
 
 
114
 
--
115
 
--
116
 
 
117
 
ALTER TABLE assessed DISABLE TRIGGER ALL;
118
 
 
119
 
 
120
 
 
121
 
ALTER TABLE assessed ENABLE TRIGGER ALL;
122
 
 
123
 
--
124
 
--
125
 
 
126
 
ALTER TABLE enrolment DISABLE TRIGGER ALL;
127
 
 
128
 
INSERT INTO enrolment (loginid, offeringid, role, result, special_result, supp_result, special_supp_result, notes, active) VALUES (2, 1, 'lecturer', NULL, NULL, NULL, NULL, NULL, true);
129
 
INSERT INTO enrolment (loginid, offeringid, role, result, special_result, supp_result, special_supp_result, notes, active) VALUES (2, 2, 'lecturer', NULL, NULL, NULL, NULL, NULL, true);
130
 
INSERT INTO enrolment (loginid, offeringid, role, result, special_result, supp_result, special_supp_result, notes, active) VALUES (3, 2, 'tutor', NULL, NULL, NULL, NULL, NULL, true);
131
 
INSERT INTO enrolment (loginid, offeringid, role, result, special_result, supp_result, special_supp_result, notes, active) VALUES (4, 1, 'student', NULL, NULL, NULL, NULL, NULL, true);
132
 
INSERT INTO enrolment (loginid, offeringid, role, result, special_result, supp_result, special_supp_result, notes, active) VALUES (4, 2, 'student', NULL, NULL, NULL, NULL, NULL, true);
133
 
INSERT INTO enrolment (loginid, offeringid, role, result, special_result, supp_result, special_supp_result, notes, active) VALUES (5, 2, 'student', NULL, NULL, NULL, NULL, NULL, true);
134
 
 
135
 
 
136
 
ALTER TABLE enrolment ENABLE TRIGGER ALL;
137
 
 
138
 
--
139
 
--
140
 
 
141
 
ALTER TABLE exercise DISABLE TRIGGER ALL;
142
 
 
143
 
INSERT INTO exercise (identifier, name, description, partial, solution, include, num_rows) VALUES ('factorial', 'Factorial', 'Write a function, `fac`, to compute the **factorial** of a number. e.g.::
144
 
 
145
 
    >>> fac(4)
146
 
    24
147
 
 
148
 
Then, write a function `main`, which reads a number from stdin, and writes its factorial to stdout. e.g.::
149
 
 
150
 
    >>> main()
151
 
    4
152
 
    24
153
 
', 'def fac(n):
154
 
    pass
155
 
 
156
 
def main():
157
 
    pass
158
 
', 'def fac(n):
159
 
    if n == 0:
160
 
        return 1
161
 
    else:
162
 
        return n * fac(n-1)
163
 
 
164
 
def main():
165
 
    f = int(raw_input())
166
 
    print fac(f)', '', 12);
167
 
 
168
 
 
169
 
ALTER TABLE exercise ENABLE TRIGGER ALL;
170
 
 
171
 
--
172
 
--
173
 
 
174
 
ALTER TABLE exercise_attempt DISABLE TRIGGER ALL;
175
 
 
176
 
 
177
 
 
178
 
ALTER TABLE exercise_attempt ENABLE TRIGGER ALL;
179
 
 
180
 
--
181
 
--
182
 
 
183
 
ALTER TABLE exercise_save DISABLE TRIGGER ALL;
184
 
 
185
 
 
186
 
 
187
 
ALTER TABLE exercise_save ENABLE TRIGGER ALL;
188
 
 
189
 
--
190
 
--
191
 
 
192
 
ALTER TABLE group_invitation DISABLE TRIGGER ALL;
193
 
 
194
 
 
195
 
 
196
 
ALTER TABLE group_invitation ENABLE TRIGGER ALL;
197
 
 
198
 
--
199
 
--
200
 
 
201
 
ALTER TABLE group_member DISABLE TRIGGER ALL;
202
 
 
203
 
INSERT INTO group_member (loginid, groupid) VALUES (4, 1);
204
 
INSERT INTO group_member (loginid, groupid) VALUES (5, 1);
205
 
 
206
 
 
207
 
ALTER TABLE group_member ENABLE TRIGGER ALL;
208
 
 
209
 
--
210
 
--
211
 
 
212
 
ALTER TABLE login DISABLE TRIGGER ALL;
213
 
 
214
 
INSERT INTO login (loginid, login, passhash, state, admin, unixid, nick, pass_exp, acct_exp, last_login, svn_pass, email, fullname, studentid, settings) VALUES (1, 'admin', '5f4dcc3b5aa765d61d8327deb882cf99', 'enabled', true, 5000, 'Anne Admin', NULL, NULL, '2009-12-08 11:44:02.285862', 'password', NULL, 'Anne Admin', NULL, NULL);
215
 
INSERT INTO login (loginid, login, passhash, state, admin, unixid, nick, pass_exp, acct_exp, last_login, svn_pass, email, fullname, studentid, settings) VALUES (2, 'lecturer', '5f4dcc3b5aa765d61d8327deb882cf99', 'enabled', false, 5001, 'Larry Lecturer', NULL, NULL, '2009-12-08 12:12:16.375628', 'password', NULL, 'Larry Lecturer', NULL, NULL);
216
 
INSERT INTO login (loginid, login, passhash, state, admin, unixid, nick, pass_exp, acct_exp, last_login, svn_pass, email, fullname, studentid, settings) VALUES (3, 'tutor', '5f4dcc3b5aa765d61d8327deb882cf99', 'enabled', false, 5002, 'Terry Tutor', NULL, NULL, '2009-12-08 19:08:59.817505', 'password', NULL, 'Terry Tutor', NULL, NULL);
217
 
INSERT INTO login (loginid, login, passhash, state, admin, unixid, nick, pass_exp, acct_exp, last_login, svn_pass, email, fullname, studentid, settings) VALUES (4, 'studenta', '5f4dcc3b5aa765d61d8327deb882cf99', 'enabled', false, 5003, 'Alice Student', NULL, NULL, '2009-12-08 12:11:46.349133', 'password', NULL, 'Alice Student', NULL, NULL);
218
 
INSERT INTO login (loginid, login, passhash, state, admin, unixid, nick, pass_exp, acct_exp, last_login, svn_pass, email, fullname, studentid, settings) VALUES (5, 'studentb', '5f4dcc3b5aa765d61d8327deb882cf99', 'no_agreement', false, 5004, 'Bob Student', NULL, NULL, NULL, NULL, NULL, 'Bob Student', NULL, NULL);
219
 
 
220
 
 
221
 
ALTER TABLE login ENABLE TRIGGER ALL;
222
 
 
223
 
--
224
 
--
225
 
 
226
 
ALTER TABLE offering DISABLE TRIGGER ALL;
227
 
 
228
 
INSERT INTO offering (offeringid, subject, semesterid, description, url, groups_student_permissions) VALUES (1, 1, 1, 'This subject will introduce you to the basics of IVLE.', 'http://www.ivle.org/example/101', 'none');
229
 
INSERT INTO offering (offeringid, subject, semesterid, description, url, groups_student_permissions) VALUES (2, 2, 2, 'Enhancing your understanding of IVLE''s usage and operation, this subject will consolidate and expand your general IVLE knowledge.', 'http://www.ivle.org/example/102', 'none');
230
 
INSERT INTO offering (offeringid, subject, semesterid, description, url, groups_student_permissions) VALUES (3, 1, 3, 'This subject will introduce you to the basics of IVLE, again.', 'http://www.ivle.org/example/101', 'none');
231
 
INSERT INTO offering (offeringid, subject, semesterid, description, url, groups_student_permissions) VALUES (4, 3, 3, 'This subject will provide you with a working knowledge of advanced IVLE concepts.', 'http://www.ivle.org/example/201', 'none');
232
 
INSERT INTO offering (offeringid, subject, semesterid, description, url, groups_student_permissions) VALUES (5, 2, 4, 'Enhancing your understanding of IVLE''s usage and operation, this subject will consolidate and expand your general IVLE knowledge, again.', 'http://www.ivle.org/example/102', 'none');
233
 
INSERT INTO offering (offeringid, subject, semesterid, description, url, groups_student_permissions) VALUES (6, 4, 4, 'After undertaking this subject, you should be a master of all things IVLEy.', 'http://www.ivle.org/example/202', 'none');
234
 
 
235
 
 
236
 
ALTER TABLE offering ENABLE TRIGGER ALL;
237
 
 
238
 
--
239
 
--
240
 
 
241
 
ALTER TABLE project DISABLE TRIGGER ALL;
242
 
 
243
 
INSERT INTO project (projectid, short_name, name, synopsis, url, projectsetid, deadline) VALUES (1, 'phase1', 'Phase 1', 'This is the first project in Intermediate IVLE.', NULL, 1, '2009-08-21 18:00:00');
244
 
INSERT INTO project (projectid, short_name, name, synopsis, url, projectsetid, deadline) VALUES (2, 'phase2', 'Phase 2', 'This is the second project in Intermediate IVLE.
245
 
Get into groups of 3.', NULL, 2, '2009-09-11 18:00:00');
246
 
INSERT INTO project (projectid, short_name, name, synopsis, url, projectsetid, deadline) VALUES (3, 'phase3', 'Phase 3', 'This is the final project in Intermediate IVLE.
247
 
Complete this with the same group as Phase 2.', NULL, 2, '2009-09-25 18:00:00');
248
 
 
249
 
 
250
 
ALTER TABLE project ENABLE TRIGGER ALL;
251
 
 
252
 
--
253
 
--
254
 
 
255
 
ALTER TABLE project_extension DISABLE TRIGGER ALL;
256
 
 
257
 
 
258
 
 
259
 
ALTER TABLE project_extension ENABLE TRIGGER ALL;
260
 
 
261
 
--
262
 
--
263
 
 
264
 
ALTER TABLE project_group DISABLE TRIGGER ALL;
265
 
 
266
 
INSERT INTO project_group (groupnm, groupid, projectsetid, nick, createdby, epoch) VALUES ('group1', 1, 2, 'group1', 2, '2009-12-08 17:04:42.981005');
267
 
 
268
 
 
269
 
ALTER TABLE project_group ENABLE TRIGGER ALL;
270
 
 
271
 
--
272
 
--
273
 
 
274
 
ALTER TABLE project_mark DISABLE TRIGGER ALL;
275
 
 
276
 
 
277
 
 
278
 
ALTER TABLE project_mark ENABLE TRIGGER ALL;
279
 
 
280
 
--
281
 
--
282
 
 
283
 
ALTER TABLE project_set DISABLE TRIGGER ALL;
284
 
 
285
 
INSERT INTO project_set (projectsetid, offeringid, max_students_per_group) VALUES (1, 2, NULL);
286
 
INSERT INTO project_set (projectsetid, offeringid, max_students_per_group) VALUES (2, 2, 3);
287
 
 
288
 
 
289
 
ALTER TABLE project_set ENABLE TRIGGER ALL;
290
 
 
291
 
--
292
 
--
293
 
 
294
 
ALTER TABLE project_submission DISABLE TRIGGER ALL;
295
 
 
296
 
 
297
 
 
298
 
ALTER TABLE project_submission ENABLE TRIGGER ALL;
299
 
 
300
 
--
301
 
--
302
 
 
303
 
ALTER TABLE semester DISABLE TRIGGER ALL;
304
 
 
305
 
INSERT INTO semester (semesterid, year, semester, state) VALUES (1, '2009', '1', 'past');
306
 
INSERT INTO semester (semesterid, year, semester, state) VALUES (2, '2009', '2', 'current');
307
 
INSERT INTO semester (semesterid, year, semester, state) VALUES (3, '2010', '1', 'future');
308
 
INSERT INTO semester (semesterid, year, semester, state) VALUES (4, '2010', '2', 'future');
309
 
 
310
 
 
311
 
ALTER TABLE semester ENABLE TRIGGER ALL;
312
 
 
313
 
--
314
 
--
315
 
 
316
 
ALTER TABLE subject DISABLE TRIGGER ALL;
317
 
 
318
 
INSERT INTO subject (subjectid, subj_code, subj_name, subj_short_name) VALUES (1, '100101', 'Introduction to IVLE', 'ivle-101');
319
 
INSERT INTO subject (subjectid, subj_code, subj_name, subj_short_name) VALUES (2, '100102', 'Intermediate IVLE', 'ivle-102');
320
 
INSERT INTO subject (subjectid, subj_code, subj_name, subj_short_name) VALUES (3, '100201', 'Advanced IVLE', 'ivle-201');
321
 
INSERT INTO subject (subjectid, subj_code, subj_name, subj_short_name) VALUES (4, '100202', 'Mastering IVLE', 'ivle-202');
322
 
 
323
 
 
324
 
ALTER TABLE subject ENABLE TRIGGER ALL;
325
 
 
326
 
--
327
 
--
328
 
 
329
 
ALTER TABLE suite_variable DISABLE TRIGGER ALL;
330
 
 
331
 
INSERT INTO suite_variable (varid, suiteid, var_name, var_value, var_type, arg_no) VALUES (1, 1, '', '4', 'arg', 0);
332
 
INSERT INTO suite_variable (varid, suiteid, var_name, var_value, var_type, arg_no) VALUES (2, 2, '', '5', 'arg', 0);
333
 
 
334
 
 
335
 
ALTER TABLE suite_variable ENABLE TRIGGER ALL;
336
 
 
337
 
--
338
 
--
339
 
 
340
 
ALTER TABLE test_case DISABLE TRIGGER ALL;
341
 
 
342
 
INSERT INTO test_case (testid, suiteid, passmsg, failmsg, test_default, seq_no) VALUES (1, 1, 'Calculates factorial correctly', 'Wrong answer', 'ignore', 0);
343
 
INSERT INTO test_case (testid, suiteid, passmsg, failmsg, test_default, seq_no) VALUES (2, 1, 'Doesn''t use functools', 'You used functools, you arrogant git', 'ignore', 1);
344
 
INSERT INTO test_case (testid, suiteid, passmsg, failmsg, test_default, seq_no) VALUES (3, 2, 'Calculates factorial correctly', 'Wrong answer', 'ignore', 0);
345
 
INSERT INTO test_case (testid, suiteid, passmsg, failmsg, test_default, seq_no) VALUES (5, 3, 'Main worked correctly', 'Main printed something else as well. You should only print out the answer.', 'ignore', 1);
346
 
INSERT INTO test_case (testid, suiteid, passmsg, failmsg, test_default, seq_no) VALUES (4, 3, 'Main printout included the correct answer', 'Main didn''t print out the correct answer', 'ignore', 0);
347
 
INSERT INTO test_case (testid, suiteid, passmsg, failmsg, test_default, seq_no) VALUES (6, 1, 'Doesn''t use __import__', 'You used __import__, you subversive git!', 'ignore', 2);
348
 
 
349
 
 
350
 
ALTER TABLE test_case ENABLE TRIGGER ALL;
351
 
 
352
 
--
353
 
--
354
 
 
355
 
ALTER TABLE test_case_part DISABLE TRIGGER ALL;
356
 
 
357
 
INSERT INTO test_case_part (partid, testid, part_type, test_type, data, filename) VALUES (1, 1, 'result', 'match', '', NULL);
358
 
INSERT INTO test_case_part (partid, testid, part_type, test_type, data, filename) VALUES (2, 2, 'code', 'check', 'lambda solution, attempt: ''functools'' not in attempt', NULL);
359
 
INSERT INTO test_case_part (partid, testid, part_type, test_type, data, filename) VALUES (3, 3, 'result', 'match', '', NULL);
360
 
INSERT INTO test_case_part (partid, testid, part_type, test_type, data, filename) VALUES (5, 5, 'stdout', 'norm', 'lambda x: x.strip() # Allow leading or trailing whitespace', NULL);
361
 
INSERT INTO test_case_part (partid, testid, part_type, test_type, data, filename) VALUES (4, 4, 'stdout', 'check', 'lambda solution, attempt: solution.strip() in attempt   # Substring test', NULL);
362
 
INSERT INTO test_case_part (partid, testid, part_type, test_type, data, filename) VALUES (6, 6, 'code', 'check', 'lambda solution, attempt: ''__import__'' not in attempt', NULL);
363
 
 
364
 
 
365
 
ALTER TABLE test_case_part ENABLE TRIGGER ALL;
366
 
 
367
 
--
368
 
--
369
 
 
370
 
ALTER TABLE test_suite DISABLE TRIGGER ALL;
371
 
 
372
 
INSERT INTO test_suite (suiteid, exerciseid, description, seq_no, function, stdin) VALUES (2, 'factorial', 'Test fac(5)', 1, 'fac', '');
373
 
INSERT INTO test_suite (suiteid, exerciseid, description, seq_no, function, stdin) VALUES (1, 'factorial', 'Test fac(4)', 0, 'fac', '');
374
 
INSERT INTO test_suite (suiteid, exerciseid, description, seq_no, function, stdin) VALUES (3, 'factorial', 'Test main', 2, 'main', '4
375
 
');
376
 
 
377
 
 
378
 
ALTER TABLE test_suite ENABLE TRIGGER ALL;
379
 
 
380
 
--
381
 
--
382
 
 
383
 
ALTER TABLE worksheet DISABLE TRIGGER ALL;
384
 
 
385
 
 
386
 
 
387
 
ALTER TABLE worksheet ENABLE TRIGGER ALL;
388
 
 
389
 
--
390
 
--
391
 
 
392
 
ALTER TABLE worksheet_exercise DISABLE TRIGGER ALL;
393
 
 
394
 
 
395
 
 
396
 
ALTER TABLE worksheet_exercise ENABLE TRIGGER ALL;
397
 
 
398
 
--
399
 
--
400