98
98
-- Name: test_case_part_partid_seq; Type: SEQUENCE SET; Schema: public; Owner: -
101
SELECT pg_catalog.setval('test_case_part_partid_seq', 10, true);
101
SELECT pg_catalog.setval('test_case_part_partid_seq', 6, true);
105
105
-- Name: test_case_testid_seq; Type: SEQUENCE SET; Schema: public; Owner: -
108
SELECT pg_catalog.setval('test_case_testid_seq', 10, true);
108
SELECT pg_catalog.setval('test_case_testid_seq', 6, true);
112
112
-- Name: test_suite_suiteid_seq; Type: SEQUENCE SET; Schema: public; Owner: -
115
SELECT pg_catalog.setval('test_suite_suiteid_seq', 5, true);
115
SELECT pg_catalog.setval('test_suite_suiteid_seq', 3, true);
119
119
-- Name: worksheet_exercise_ws_ex_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
122
SELECT pg_catalog.setval('worksheet_exercise_ws_ex_id_seq', 2, true);
122
SELECT pg_catalog.setval('worksheet_exercise_ws_ex_id_seq', 1, true);
187
187
f = int(raw_input())
188
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.
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);
194
191
ALTER TABLE exercise ENABLE TRIGGER ALL;
386
383
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
384
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
385
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);
393
388
ALTER TABLE test_case ENABLE TRIGGER ALL;
404
399
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
400
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
401
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);
411
404
ALTER TABLE test_case_part ENABLE TRIGGER ALL;
420
413
INSERT INTO test_suite (suiteid, exerciseid, description, seq_no, function, stdin) VALUES (1, 'factorial', 'Test fac(4)', 0, 'fac', '');
421
414
INSERT INTO test_suite (suiteid, exerciseid, description, seq_no, function, stdin) VALUES (3, 'factorial', 'Test main', 2, 'main', '4
423
INSERT INTO test_suite (suiteid, exerciseid, description, seq_no, function, stdin) VALUES (4, 'hello', 'Prints "Hello, world!" exactly', 0, '', '');
426
418
ALTER TABLE test_suite ENABLE TRIGGER ALL;
432
424
ALTER TABLE worksheet DISABLE TRIGGER ALL;
434
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.
436
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".
438
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".
440
Beginning a line with ``.. exercise:: <exercise-name>`` embeds an exercise in a worksheet, like this:
444
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.
446
Here is a second exercise. This one involves writing functions, and has multiple parts. The test suite will test each part individually.
448
.. exercise:: factorial
426
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.
428
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".
430
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".
432
Beginning a line with ``.. exercise:: <exercise-name>`` embeds an exercise in a worksheet, like this:
434
.. exercise:: factorial
436
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.', true, 0, 'rst');
452
439
ALTER TABLE worksheet ENABLE TRIGGER ALL;
458
445
ALTER TABLE worksheet_exercise DISABLE TRIGGER ALL;
460
INSERT INTO worksheet_exercise (ws_ex_id, worksheetid, exerciseid, seq_no, active, optional) VALUES (2, 1, 'hello', 0, true, false);
461
447
INSERT INTO worksheet_exercise (ws_ex_id, worksheetid, exerciseid, seq_no, active, optional) VALUES (1, 1, 'factorial', 0, true, false);
464
450
ALTER TABLE worksheet_exercise ENABLE TRIGGER ALL;
469
453
-- PostgreSQL database dump complete