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

« back to all changes in this revision

Viewing changes to examples/db/sample.sql

  • Committer: William Grant
  • Date: 2009-12-14 04:09:57 UTC
  • Revision ID: me@williamgrant.id.au-20091214040957-lpj8koijlkgs616n
So like Python, yet so unlike it, configobj's list syntax is Different®.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
-- PostgreSQL database dump
3
3
--
4
4
 
 
5
SET statement_timeout = 0;
5
6
SET client_encoding = 'UTF8';
6
7
SET standard_conforming_strings = off;
7
8
SET check_function_bodies = false;
14
15
-- Name: assessed_assessedid_seq; Type: SEQUENCE SET; Schema: public; Owner: -
15
16
--
16
17
 
17
 
SELECT pg_catalog.setval('assessed_assessedid_seq', 1, true);
 
18
SELECT pg_catalog.setval('assessed_assessedid_seq', 1, false);
18
19
 
19
20
 
20
21
--
91
92
-- Name: suite_variable_varid_seq; Type: SEQUENCE SET; Schema: public; Owner: -
92
93
--
93
94
 
94
 
SELECT pg_catalog.setval('suite_variable_varid_seq', 2, true);
 
95
SELECT pg_catalog.setval('suite_variable_varid_seq', 1, false);
95
96
 
96
97
 
97
98
--
98
99
-- Name: test_case_part_partid_seq; Type: SEQUENCE SET; Schema: public; Owner: -
99
100
--
100
101
 
101
 
SELECT pg_catalog.setval('test_case_part_partid_seq', 10, true);
 
102
SELECT pg_catalog.setval('test_case_part_partid_seq', 1, false);
102
103
 
103
104
 
104
105
--
105
106
-- Name: test_case_testid_seq; Type: SEQUENCE SET; Schema: public; Owner: -
106
107
--
107
108
 
108
 
SELECT pg_catalog.setval('test_case_testid_seq', 10, true);
 
109
SELECT pg_catalog.setval('test_case_testid_seq', 1, false);
109
110
 
110
111
 
111
112
--
112
113
-- Name: test_suite_suiteid_seq; Type: SEQUENCE SET; Schema: public; Owner: -
113
114
--
114
115
 
115
 
SELECT pg_catalog.setval('test_suite_suiteid_seq', 5, true);
 
116
SELECT pg_catalog.setval('test_suite_suiteid_seq', 1, false);
116
117
 
117
118
 
118
119
--
119
120
-- Name: worksheet_exercise_ws_ex_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
120
121
--
121
122
 
122
 
SELECT pg_catalog.setval('worksheet_exercise_ws_ex_id_seq', 2, true);
 
123
SELECT pg_catalog.setval('worksheet_exercise_ws_ex_id_seq', 1, false);
123
124
 
124
125
 
125
126
--
126
127
-- Name: worksheet_worksheetid_seq; Type: SEQUENCE SET; Schema: public; Owner: -
127
128
--
128
129
 
129
 
SELECT pg_catalog.setval('worksheet_worksheetid_seq', 1, true);
130
 
 
 
130
SELECT pg_catalog.setval('worksheet_worksheetid_seq', 1, false);
 
131
 
 
132
 
 
133
--
 
134
-- Data for Name: login; Type: TABLE DATA; Schema: public; Owner: -
 
135
--
 
136
 
 
137
SET SESSION AUTHORIZATION DEFAULT;
 
138
 
 
139
ALTER TABLE login DISABLE TRIGGER ALL;
 
140
 
 
141
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);
 
142
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);
 
143
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);
 
144
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);
 
145
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);
 
146
 
 
147
 
 
148
ALTER TABLE login ENABLE TRIGGER ALL;
 
149
 
 
150
--
 
151
-- Data for Name: semester; Type: TABLE DATA; Schema: public; Owner: -
 
152
--
 
153
 
 
154
ALTER TABLE semester DISABLE TRIGGER ALL;
 
155
 
 
156
INSERT INTO semester (semesterid, year, semester, state) VALUES (1, '2009', '1', 'past');
 
157
INSERT INTO semester (semesterid, year, semester, state) VALUES (2, '2009', '2', 'current');
 
158
INSERT INTO semester (semesterid, year, semester, state) VALUES (3, '2010', '1', 'future');
 
159
INSERT INTO semester (semesterid, year, semester, state) VALUES (4, '2010', '2', 'future');
 
160
 
 
161
 
 
162
ALTER TABLE semester ENABLE TRIGGER ALL;
 
163
 
 
164
--
 
165
-- Data for Name: subject; Type: TABLE DATA; Schema: public; Owner: -
 
166
--
 
167
 
 
168
ALTER TABLE subject DISABLE TRIGGER ALL;
 
169
 
 
170
INSERT INTO subject (subjectid, subj_code, subj_name, subj_short_name, url) VALUES (1, '100101', 'Introduction to IVLE', 'ivle-101', 'http://www.ivle.org/example/101');
 
171
INSERT INTO subject (subjectid, subj_code, subj_name, subj_short_name, url) VALUES (2, '100102', 'Intermediate IVLE', 'ivle-102', 'http://www.ivle.org/example/102');
 
172
INSERT INTO subject (subjectid, subj_code, subj_name, subj_short_name, url) VALUES (3, '100201', 'Advanced IVLE', 'ivle-201', 'http://www.ivle.org/example/201');
 
173
INSERT INTO subject (subjectid, subj_code, subj_name, subj_short_name, url) VALUES (4, '100202', 'Mastering IVLE', 'ivle-202', 'http://www.ivle.org/example/202');
 
174
 
 
175
 
 
176
ALTER TABLE subject ENABLE TRIGGER ALL;
 
177
 
 
178
--
 
179
-- Data for Name: offering; Type: TABLE DATA; Schema: public; Owner: -
 
180
--
 
181
 
 
182
ALTER TABLE offering DISABLE TRIGGER ALL;
 
183
 
 
184
INSERT INTO offering (offeringid, subject, semesterid, groups_student_permissions) VALUES (1, 1, 1, 'none');
 
185
INSERT INTO offering (offeringid, subject, semesterid, groups_student_permissions) VALUES (2, 2, 2, 'none');
 
186
INSERT INTO offering (offeringid, subject, semesterid, groups_student_permissions) VALUES (3, 1, 3, 'none');
 
187
INSERT INTO offering (offeringid, subject, semesterid, groups_student_permissions) VALUES (4, 3, 3, 'none');
 
188
INSERT INTO offering (offeringid, subject, semesterid, groups_student_permissions) VALUES (5, 2, 4, 'none');
 
189
INSERT INTO offering (offeringid, subject, semesterid, groups_student_permissions) VALUES (6, 4, 4, 'none');
 
190
 
 
191
 
 
192
ALTER TABLE offering ENABLE TRIGGER ALL;
 
193
 
 
194
--
 
195
-- Data for Name: project_set; Type: TABLE DATA; Schema: public; Owner: -
 
196
--
 
197
 
 
198
ALTER TABLE project_set DISABLE TRIGGER ALL;
 
199
 
 
200
INSERT INTO project_set (projectsetid, offeringid, max_students_per_group) VALUES (1, 2, NULL);
 
201
INSERT INTO project_set (projectsetid, offeringid, max_students_per_group) VALUES (2, 2, 3);
 
202
 
 
203
 
 
204
ALTER TABLE project_set ENABLE TRIGGER ALL;
 
205
 
 
206
--
 
207
-- Data for Name: project; Type: TABLE DATA; Schema: public; Owner: -
 
208
--
 
209
 
 
210
ALTER TABLE project DISABLE TRIGGER ALL;
 
211
 
 
212
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');
 
213
INSERT INTO project (projectid, short_name, name, synopsis, url, projectsetid, deadline) VALUES (2, 'phase2', 'Phase 2', 'This is the second project in Intermediate IVLE.
 
214
Get into groups of 3.', NULL, 2, '2009-09-11 18:00:00');
 
215
INSERT INTO project (projectid, short_name, name, synopsis, url, projectsetid, deadline) VALUES (3, 'phase3', 'Phase 3', 'This is the final project in Intermediate IVLE.
 
216
Complete this with the same group as Phase 2.', NULL, 2, '2009-09-25 18:00:00');
 
217
 
 
218
 
 
219
ALTER TABLE project ENABLE TRIGGER ALL;
 
220
 
 
221
--
 
222
-- Data for Name: project_group; Type: TABLE DATA; Schema: public; Owner: -
 
223
--
 
224
 
 
225
ALTER TABLE project_group DISABLE TRIGGER ALL;
 
226
 
 
227
INSERT INTO project_group (groupnm, groupid, projectsetid, nick, createdby, epoch) VALUES ('group1', 1, 2, 'group1', 2, '2009-12-08 17:04:42.981005');
 
228
 
 
229
 
 
230
ALTER TABLE project_group ENABLE TRIGGER ALL;
131
231
 
132
232
--
133
233
-- Data for Name: assessed; Type: TABLE DATA; Schema: public; Owner: -
135
235
 
136
236
ALTER TABLE assessed DISABLE TRIGGER ALL;
137
237
 
138
 
INSERT INTO assessed (assessedid, loginid, groupid, projectid) VALUES (1, 2, NULL, 1);
139
238
 
140
239
 
141
240
ALTER TABLE assessed ENABLE TRIGGER ALL;
162
261
 
163
262
ALTER TABLE exercise DISABLE TRIGGER ALL;
164
263
 
165
 
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.::
166
 
 
167
 
    >>> fac(4)
168
 
    24
169
 
 
170
 
Then, write a function `main`, which reads a number from stdin, and writes its factorial to stdout. e.g.::
171
 
 
172
 
    >>> main()
173
 
    4
174
 
    24
175
 
', 'def fac(n):
176
 
    pass
177
 
 
178
 
def main():
179
 
    pass
180
 
', 'def fac(n):
181
 
    if n == 0:
182
 
        return 1
183
 
    else:
184
 
        return n * fac(n-1)
185
 
 
186
 
def main():
187
 
    f = int(raw_input())
188
 
    print fac(f)', '', 12);
189
 
INSERT INTO exercise (identifier, name, description, partial, solution, include, num_rows) VALUES ('hello', 'Hello world', 'Write a program which prints out "Hello, world!" when it is run.
190
 
 
191
 
Note that if you print anything with the words "Hello world", but with wrong punctuation and capitalization, you will get some positive feedback, but still fail overall. You need to print an exact match.', 'print "..."', 'print "Hello, world!"', 'import re', 4);
192
264
 
193
265
 
194
266
ALTER TABLE exercise ENABLE TRIGGER ALL;
195
267
 
196
268
--
 
269
-- Data for Name: worksheet; Type: TABLE DATA; Schema: public; Owner: -
 
270
--
 
271
 
 
272
ALTER TABLE worksheet DISABLE TRIGGER ALL;
 
273
 
 
274
 
 
275
 
 
276
ALTER TABLE worksheet ENABLE TRIGGER ALL;
 
277
 
 
278
--
 
279
-- Data for Name: worksheet_exercise; Type: TABLE DATA; Schema: public; Owner: -
 
280
--
 
281
 
 
282
ALTER TABLE worksheet_exercise DISABLE TRIGGER ALL;
 
283
 
 
284
 
 
285
 
 
286
ALTER TABLE worksheet_exercise ENABLE TRIGGER ALL;
 
287
 
 
288
--
197
289
-- Data for Name: exercise_attempt; Type: TABLE DATA; Schema: public; Owner: -
198
290
--
199
291
 
236
328
ALTER TABLE group_member ENABLE TRIGGER ALL;
237
329
 
238
330
--
239
 
--
240
 
 
241
 
ALTER TABLE login DISABLE TRIGGER ALL;
242
 
 
243
 
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);
244
 
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);
245
 
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);
246
 
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);
247
 
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);
248
 
 
249
 
 
250
 
ALTER TABLE login ENABLE TRIGGER ALL;
251
 
 
252
 
--
253
 
--
254
 
 
255
 
ALTER TABLE offering DISABLE TRIGGER ALL;
256
 
 
257
 
INSERT INTO offering (offeringid, subject, semesterid, description, url, groups_student_permissions, show_worksheet_marks, worksheet_cutoff) VALUES (1, 1, 1, 'This subject will introduce you to the basics of IVLE.', 'http://www.ivle.org/example/101', 'none', false, NULL);
258
 
INSERT INTO offering (offeringid, subject, semesterid, description, url, groups_student_permissions, show_worksheet_marks, worksheet_cutoff) 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', false, NULL);
259
 
INSERT INTO offering (offeringid, subject, semesterid, description, url, groups_student_permissions, show_worksheet_marks, worksheet_cutoff) VALUES (3, 1, 3, 'This subject will introduce you to the basics of IVLE, again.', 'http://www.ivle.org/example/101', 'none', false, NULL);
260
 
INSERT INTO offering (offeringid, subject, semesterid, description, url, groups_student_permissions, show_worksheet_marks, worksheet_cutoff) VALUES (4, 3, 3, 'This subject will provide you with a working knowledge of advanced IVLE concepts.', 'http://www.ivle.org/example/201', 'none', false, NULL);
261
 
INSERT INTO offering (offeringid, subject, semesterid, description, url, groups_student_permissions, show_worksheet_marks, worksheet_cutoff) 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', false, NULL);
262
 
INSERT INTO offering (offeringid, subject, semesterid, description, url, groups_student_permissions, show_worksheet_marks, worksheet_cutoff) VALUES (6, 4, 4, 'After undertaking this subject, you should be a master of all things IVLEy.', 'http://www.ivle.org/example/202', 'none', false, NULL);
263
 
 
264
 
 
265
 
ALTER TABLE offering ENABLE TRIGGER ALL;
266
 
 
267
 
--
268
 
--
269
 
 
270
 
ALTER TABLE project DISABLE TRIGGER ALL;
271
 
 
272
 
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, '3009-08-21 18:00:00');
273
 
INSERT INTO project (projectid, short_name, name, synopsis, url, projectsetid, deadline) VALUES (2, 'phase2', 'Phase 2', 'This is the second project in Intermediate IVLE.
274
 
Get into groups of 3.', NULL, 2, '3009-09-11 18:00:00');
275
 
INSERT INTO project (projectid, short_name, name, synopsis, url, projectsetid, deadline) VALUES (3, 'phase3', 'Phase 3', 'This is the final project in Intermediate IVLE.
276
 
Complete this with the same group as Phase 2.', NULL, 2, '2009-09-25 18:00:00');
277
 
 
278
 
 
279
 
ALTER TABLE project ENABLE TRIGGER ALL;
280
 
 
281
 
--
282
331
-- Data for Name: project_extension; Type: TABLE DATA; Schema: public; Owner: -
283
332
--
284
333
 
292
338
ALTER TABLE project_extension ENABLE TRIGGER ALL;
293
339
 
294
340
--
295
 
--
296
 
 
297
 
ALTER TABLE project_group DISABLE TRIGGER ALL;
298
 
 
299
 
INSERT INTO project_group (groupnm, groupid, projectsetid, nick, createdby, epoch) VALUES ('group1', 1, 2, 'group1', 2, '2009-12-08 17:04:42.981005');
300
 
 
301
 
 
302
 
ALTER TABLE project_group ENABLE TRIGGER ALL;
303
 
 
304
 
--
305
341
-- Data for Name: project_mark; Type: TABLE DATA; Schema: public; Owner: -
306
342
--
307
343
 
313
348
ALTER TABLE project_mark ENABLE TRIGGER ALL;
314
349
 
315
350
--
316
 
--
317
 
 
318
 
ALTER TABLE project_set DISABLE TRIGGER ALL;
319
 
 
320
 
INSERT INTO project_set (projectsetid, offeringid, max_students_per_group) VALUES (1, 2, NULL);
321
 
INSERT INTO project_set (projectsetid, offeringid, max_students_per_group) VALUES (2, 2, 3);
322
 
 
323
 
 
324
 
ALTER TABLE project_set ENABLE TRIGGER ALL;
325
 
 
326
 
--
327
351
-- Data for Name: project_submission; Type: TABLE DATA; Schema: public; Owner: -
328
352
--
329
353
 
335
358
ALTER TABLE project_submission ENABLE TRIGGER ALL;
336
359
 
337
360
--
338
 
--
339
 
 
340
 
ALTER TABLE semester DISABLE TRIGGER ALL;
341
 
 
342
 
INSERT INTO semester (semesterid, year, semester, state) VALUES (1, '2009', '1', 'past');
343
 
INSERT INTO semester (semesterid, year, semester, state) VALUES (2, '2009', '2', 'current');
344
 
INSERT INTO semester (semesterid, year, semester, state) VALUES (3, '2010', '1', 'future');
345
 
INSERT INTO semester (semesterid, year, semester, state) VALUES (4, '2010', '2', 'future');
346
 
 
347
 
 
348
 
ALTER TABLE semester ENABLE TRIGGER ALL;
349
 
 
350
 
--
351
 
--
352
 
 
353
 
ALTER TABLE subject DISABLE TRIGGER ALL;
354
 
 
355
 
INSERT INTO subject (subjectid, subj_code, subj_name, subj_short_name) VALUES (1, '100101', 'Introduction to IVLE', 'ivle-101');
356
 
INSERT INTO subject (subjectid, subj_code, subj_name, subj_short_name) VALUES (2, '100102', 'Intermediate IVLE', 'ivle-102');
357
 
INSERT INTO subject (subjectid, subj_code, subj_name, subj_short_name) VALUES (3, '100201', 'Advanced IVLE', 'ivle-201');
358
 
INSERT INTO subject (subjectid, subj_code, subj_name, subj_short_name) VALUES (4, '100202', 'Mastering IVLE', 'ivle-202');
359
 
 
360
 
 
361
 
ALTER TABLE subject ENABLE TRIGGER ALL;
 
361
-- Data for Name: test_suite; Type: TABLE DATA; Schema: public; Owner: -
 
362
--
 
363
 
 
364
ALTER TABLE test_suite DISABLE TRIGGER ALL;
 
365
 
 
366
 
 
367
 
 
368
ALTER TABLE test_suite ENABLE TRIGGER ALL;
362
369
 
363
370
--
364
371
-- Data for Name: suite_variable; Type: TABLE DATA; Schema: public; Owner: -
368
373
 
369
374
ALTER TABLE suite_variable DISABLE TRIGGER ALL;
370
375
 
371
 
INSERT INTO suite_variable (varid, suiteid, var_name, var_value, var_type, arg_no) VALUES (1, 1, '', '4', 'arg', 0);
372
 
INSERT INTO suite_variable (varid, suiteid, var_name, var_value, var_type, arg_no) VALUES (2, 2, '', '5', 'arg', 0);
373
376
 
374
377
 
375
378
ALTER TABLE suite_variable ENABLE TRIGGER ALL;
380
383
 
381
384
ALTER TABLE test_case DISABLE TRIGGER ALL;
382
385
 
383
 
INSERT INTO test_case (testid, suiteid, passmsg, failmsg, test_default, seq_no) VALUES (1, 1, 'Calculates factorial correctly', 'Wrong answer', 'ignore', 0);
384
 
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);
385
 
INSERT INTO test_case (testid, suiteid, passmsg, failmsg, test_default, seq_no) VALUES (3, 2, 'Calculates factorial correctly', 'Wrong answer', 'ignore', 0);
386
 
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);
387
 
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);
388
 
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);
389
 
INSERT INTO test_case (testid, suiteid, passmsg, failmsg, test_default, seq_no) VALUES (7, 4, 'Prints the correct words', 'Didn''t print the words "Hello world" at all', 'ignore', 0);
390
 
INSERT INTO test_case (testid, suiteid, passmsg, failmsg, test_default, seq_no) VALUES (10, 4, 'Prints "Hello, world!" exactly', 'Did not print "Hello, world!" exactly', 'ignore', 1);
391
386
 
392
387
 
393
388
ALTER TABLE test_case ENABLE TRIGGER ALL;
398
393
 
399
394
ALTER TABLE test_case_part DISABLE TRIGGER ALL;
400
395
 
401
 
INSERT INTO test_case_part (partid, testid, part_type, test_type, data, filename) VALUES (1, 1, 'result', 'match', '', NULL);
402
 
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);
403
 
INSERT INTO test_case_part (partid, testid, part_type, test_type, data, filename) VALUES (3, 3, 'result', 'match', '', NULL);
404
 
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);
405
 
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);
406
 
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);
407
 
INSERT INTO test_case_part (partid, testid, part_type, test_type, data, filename) VALUES (10, 10, 'stdout', 'match', 'lambda solution, attempt: re.match("hello[^a-z]*world[^a-z]*", attempt.lower())', NULL);
408
 
INSERT INTO test_case_part (partid, testid, part_type, test_type, data, filename) VALUES (7, 7, 'stdout', 'check', 'lambda solution, attempt: re.match("hello[^a-z]*world[^a-z]*", attempt.lower())', NULL);
409
396
 
410
397
 
411
398
ALTER TABLE test_case_part ENABLE TRIGGER ALL;
412
399
 
413
400
--
414
 
--
415
 
 
416
 
ALTER TABLE test_suite DISABLE TRIGGER ALL;
417
 
 
418
 
INSERT INTO test_suite (suiteid, exerciseid, description, seq_no, function, stdin) VALUES (2, 'factorial', 'Test fac(5)', 1, 'fac', '');
419
 
INSERT INTO test_suite (suiteid, exerciseid, description, seq_no, function, stdin) VALUES (1, 'factorial', 'Test fac(4)', 0, 'fac', '');
420
 
INSERT INTO test_suite (suiteid, exerciseid, description, seq_no, function, stdin) VALUES (3, 'factorial', 'Test main', 2, 'main', '4
421
 
');
422
 
INSERT INTO test_suite (suiteid, exerciseid, description, seq_no, function, stdin) VALUES (4, 'hello', 'Prints "Hello, world!" exactly', 0, '', '');
423
 
 
424
 
 
425
 
ALTER TABLE test_suite ENABLE TRIGGER ALL;
426
 
 
427
 
--
428
 
--
429
 
 
430
 
ALTER TABLE worksheet DISABLE TRIGGER ALL;
431
 
 
432
 
INSERT INTO worksheet (worksheetid, offeringid, identifier, name, data, assessable, seq_no, format, published) VALUES (1, 2, 'worksheet1', 'Worksheet Basics', 'IVLE allows lecturers and tutors to create worksheets, which are presented to students, optionally, for assessment.
433
 
 
434
 
Worksheets are reStructuredText (rich text) documents which can present students with information or tutorials, much like a textbook. For example, we might explain that "the ``print`` statement in Python lets you print text to the screen".
435
 
 
436
 
We can use any reStructuredText markup, such as **bold** and `links <http://ivle.org>`_. We can also embed exercises. For example, we might invite students to "try out the ``print`` statement in the following exercise".
437
 
 
438
 
Beginning a line with ``.. exercise:: <exercise-name>`` embeds an exercise in a worksheet, like this:
439
 
 
440
 
.. exercise:: hello
441
 
 
442
 
Now, the student may try out the above exercise, and submit it as many times as (s)he wishes. Once they have it correct, they will receive a point on their assessment.
443
 
 
444
 
Here is a second exercise. This one involves writing functions, and has multiple parts. The test suite will test each part individually.
445
 
 
446
 
.. exercise:: factorial
447
 
', true, 0, 'rst', true);
448
 
 
449
 
 
450
 
ALTER TABLE worksheet ENABLE TRIGGER ALL;
451
 
 
452
 
--
453
 
--
454
 
 
455
 
ALTER TABLE worksheet_exercise DISABLE TRIGGER ALL;
456
 
 
457
 
INSERT INTO worksheet_exercise (ws_ex_id, worksheetid, exerciseid, seq_no, active, optional) VALUES (2, 1, 'hello', 0, true, false);
458
 
INSERT INTO worksheet_exercise (ws_ex_id, worksheetid, exerciseid, seq_no, active, optional) VALUES (1, 1, 'factorial', 0, true, false);
459
 
 
460
 
 
461
 
ALTER TABLE worksheet_exercise ENABLE TRIGGER ALL;
462
 
 
463
 
--
464
401
-- PostgreSQL database dump complete
465
402
--
466
403