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;
10
SET search_path = public, pg_catalog;
15
SELECT pg_catalog.setval('assessed_assessedid_seq', 1, true);
21
SELECT pg_catalog.setval('login_unixid_seq', 5004, true);
27
SELECT pg_catalog.setval('login_loginid_seq', 5, true);
33
SELECT pg_catalog.setval('offering_offeringid_seq', 6, true);
39
SELECT pg_catalog.setval('project_extension_extensionid_seq', 1, false);
45
SELECT pg_catalog.setval('project_group_groupid_seq', 1, true);
51
SELECT pg_catalog.setval('project_projectid_seq', 3, true);
57
SELECT pg_catalog.setval('project_set_projectsetid_seq', 2, true);
63
SELECT pg_catalog.setval('project_submission_submissionid_seq', 1, false);
69
SELECT pg_catalog.setval('semester_semesterid_seq', 4, true);
75
SELECT pg_catalog.setval('subject_subjectid_seq', 4, true);
81
SELECT pg_catalog.setval('suite_variable_varid_seq', 2, true);
87
SELECT pg_catalog.setval('test_case_part_partid_seq', 10, true);
93
SELECT pg_catalog.setval('test_case_testid_seq', 10, true);
99
SELECT pg_catalog.setval('test_suite_suiteid_seq', 5, true);
105
SELECT pg_catalog.setval('worksheet_exercise_ws_ex_id_seq', 2, true);
111
SELECT pg_catalog.setval('worksheet_worksheetid_seq', 1, true);
117
ALTER TABLE assessed DISABLE TRIGGER ALL;
119
INSERT INTO assessed (assessedid, loginid, groupid, projectid) VALUES (1, 2, NULL, 1);
122
ALTER TABLE assessed ENABLE TRIGGER ALL;
127
ALTER TABLE enrolment DISABLE TRIGGER ALL;
129
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);
130
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);
131
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);
132
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);
133
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);
134
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);
137
ALTER TABLE enrolment ENABLE TRIGGER ALL;
142
ALTER TABLE exercise DISABLE TRIGGER ALL;
144
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.::
149
Then, write a function `main`, which reads a number from stdin, and writes its factorial to stdout. e.g.::
167
print fac(f)', '', 12);
168
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.
170
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);
173
ALTER TABLE exercise ENABLE TRIGGER ALL;
178
ALTER TABLE exercise_attempt DISABLE TRIGGER ALL;
182
ALTER TABLE exercise_attempt ENABLE TRIGGER ALL;
187
ALTER TABLE exercise_save DISABLE TRIGGER ALL;
191
ALTER TABLE exercise_save ENABLE TRIGGER ALL;
196
ALTER TABLE group_invitation DISABLE TRIGGER ALL;
200
ALTER TABLE group_invitation ENABLE TRIGGER ALL;
205
ALTER TABLE group_member DISABLE TRIGGER ALL;
207
INSERT INTO group_member (loginid, groupid) VALUES (4, 1);
208
INSERT INTO group_member (loginid, groupid) VALUES (5, 1);
211
ALTER TABLE group_member ENABLE TRIGGER ALL;
216
ALTER TABLE login DISABLE TRIGGER ALL;
218
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);
219
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);
220
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);
221
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);
222
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);
225
ALTER TABLE login ENABLE TRIGGER ALL;
230
ALTER TABLE offering DISABLE TRIGGER ALL;
232
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');
233
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');
234
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');
235
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');
236
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');
237
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');
240
ALTER TABLE offering ENABLE TRIGGER ALL;
245
ALTER TABLE project DISABLE TRIGGER ALL;
247
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');
248
INSERT INTO project (projectid, short_name, name, synopsis, url, projectsetid, deadline) VALUES (2, 'phase2', 'Phase 2', 'This is the second project in Intermediate IVLE.
249
Get into groups of 3.', NULL, 2, '3009-09-11 18:00:00');
250
INSERT INTO project (projectid, short_name, name, synopsis, url, projectsetid, deadline) VALUES (3, 'phase3', 'Phase 3', 'This is the final project in Intermediate IVLE.
251
Complete this with the same group as Phase 2.', NULL, 2, '2009-09-25 18:00:00');
254
ALTER TABLE project ENABLE TRIGGER ALL;
259
ALTER TABLE project_extension DISABLE TRIGGER ALL;
263
ALTER TABLE project_extension ENABLE TRIGGER ALL;
268
ALTER TABLE project_group DISABLE TRIGGER ALL;
270
INSERT INTO project_group (groupnm, groupid, projectsetid, nick, createdby, epoch) VALUES ('group1', 1, 2, 'group1', 2, '2009-12-08 17:04:42.981005');
273
ALTER TABLE project_group ENABLE TRIGGER ALL;
278
ALTER TABLE project_mark DISABLE TRIGGER ALL;
282
ALTER TABLE project_mark ENABLE TRIGGER ALL;
287
ALTER TABLE project_set DISABLE TRIGGER ALL;
289
INSERT INTO project_set (projectsetid, offeringid, max_students_per_group) VALUES (1, 2, NULL);
290
INSERT INTO project_set (projectsetid, offeringid, max_students_per_group) VALUES (2, 2, 3);
293
ALTER TABLE project_set ENABLE TRIGGER ALL;
298
ALTER TABLE project_submission DISABLE TRIGGER ALL;
302
ALTER TABLE project_submission ENABLE TRIGGER ALL;
307
ALTER TABLE semester DISABLE TRIGGER ALL;
309
INSERT INTO semester (semesterid, year, semester, state) VALUES (1, '2009', '1', 'past');
310
INSERT INTO semester (semesterid, year, semester, state) VALUES (2, '2009', '2', 'current');
311
INSERT INTO semester (semesterid, year, semester, state) VALUES (3, '2010', '1', 'future');
312
INSERT INTO semester (semesterid, year, semester, state) VALUES (4, '2010', '2', 'future');
315
ALTER TABLE semester ENABLE TRIGGER ALL;
320
ALTER TABLE subject DISABLE TRIGGER ALL;
322
INSERT INTO subject (subjectid, subj_code, subj_name, subj_short_name) VALUES (1, '100101', 'Introduction to IVLE', 'ivle-101');
323
INSERT INTO subject (subjectid, subj_code, subj_name, subj_short_name) VALUES (2, '100102', 'Intermediate IVLE', 'ivle-102');
324
INSERT INTO subject (subjectid, subj_code, subj_name, subj_short_name) VALUES (3, '100201', 'Advanced IVLE', 'ivle-201');
325
INSERT INTO subject (subjectid, subj_code, subj_name, subj_short_name) VALUES (4, '100202', 'Mastering IVLE', 'ivle-202');
328
ALTER TABLE subject ENABLE TRIGGER ALL;
333
ALTER TABLE suite_variable DISABLE TRIGGER ALL;
335
INSERT INTO suite_variable (varid, suiteid, var_name, var_value, var_type, arg_no) VALUES (1, 1, '', '4', 'arg', 0);
336
INSERT INTO suite_variable (varid, suiteid, var_name, var_value, var_type, arg_no) VALUES (2, 2, '', '5', 'arg', 0);
339
ALTER TABLE suite_variable ENABLE TRIGGER ALL;
344
ALTER TABLE test_case DISABLE TRIGGER ALL;
346
INSERT INTO test_case (testid, suiteid, passmsg, failmsg, test_default, seq_no) VALUES (1, 1, 'Calculates factorial correctly', 'Wrong answer', 'ignore', 0);
347
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);
348
INSERT INTO test_case (testid, suiteid, passmsg, failmsg, test_default, seq_no) VALUES (3, 2, 'Calculates factorial correctly', 'Wrong answer', 'ignore', 0);
349
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);
350
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);
351
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);
352
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);
353
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);
356
ALTER TABLE test_case ENABLE TRIGGER ALL;
361
ALTER TABLE test_case_part DISABLE TRIGGER ALL;
363
INSERT INTO test_case_part (partid, testid, part_type, test_type, data, filename) VALUES (1, 1, 'result', 'match', '', NULL);
364
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);
365
INSERT INTO test_case_part (partid, testid, part_type, test_type, data, filename) VALUES (3, 3, 'result', 'match', '', NULL);
366
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);
367
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);
368
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);
369
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);
370
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);
373
ALTER TABLE test_case_part ENABLE TRIGGER ALL;
378
ALTER TABLE test_suite DISABLE TRIGGER ALL;
380
INSERT INTO test_suite (suiteid, exerciseid, description, seq_no, function, stdin) VALUES (2, 'factorial', 'Test fac(5)', 1, 'fac', '');
381
INSERT INTO test_suite (suiteid, exerciseid, description, seq_no, function, stdin) VALUES (1, 'factorial', 'Test fac(4)', 0, 'fac', '');
382
INSERT INTO test_suite (suiteid, exerciseid, description, seq_no, function, stdin) VALUES (3, 'factorial', 'Test main', 2, 'main', '4
384
INSERT INTO test_suite (suiteid, exerciseid, description, seq_no, function, stdin) VALUES (4, 'hello', 'Prints "Hello, world!" exactly', 0, '', '');
387
ALTER TABLE test_suite ENABLE TRIGGER ALL;
392
ALTER TABLE worksheet DISABLE TRIGGER ALL;
394
INSERT INTO worksheet (worksheetid, offeringid, identifier, name, data, assessable, seq_no, format) VALUES (1, 2, 'worksheet1', 'Worksheet Basics', 'IVLE allows lecturers and tutors to create worksheets, which are presented to students, optionally, for assessment.
396
Worksheets are reStructuredText (rich text) documents which can present students with information or tutorials, much like a textbook. For example, we might explain that "recursion is when a function calls itself".
398
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 recursion in the following exercise".
400
Beginning a line with ``.. exercise:: <exercise-name>`` embeds an exercise in a worksheet, like this:
404
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.
406
Here is a second exercise. This one involves writing functions, and has multiple parts. The test suite will test each part individually.
408
.. exercise:: factorial
412
ALTER TABLE worksheet ENABLE TRIGGER ALL;
417
ALTER TABLE worksheet_exercise DISABLE TRIGGER ALL;
419
INSERT INTO worksheet_exercise (ws_ex_id, worksheetid, exerciseid, seq_no, active, optional) VALUES (2, 1, 'hello', 0, true, false);
420
INSERT INTO worksheet_exercise (ws_ex_id, worksheetid, exerciseid, seq_no, active, optional) VALUES (1, 1, 'factorial', 0, true, false);
423
ALTER TABLE worksheet_exercise ENABLE TRIGGER ALL;