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

« back to all changes in this revision

Viewing changes to examples/db/sample.sql

  • Committer: Matt Giuca
  • Date: 2010-02-11 03:17:12 UTC
  • Revision ID: matt.giuca@gmail.com-20100211031712-79c74lgh3mj7507s
docs: Tour of IVLE: Added lecturer tour (complete).

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
-- Name: test_case_part_partid_seq; Type: SEQUENCE SET; Schema: public; Owner: -
99
99
--
100
100
 
101
 
SELECT pg_catalog.setval('test_case_part_partid_seq', 10, true);
 
101
SELECT pg_catalog.setval('test_case_part_partid_seq', 6, true);
102
102
 
103
103
 
104
104
--
105
105
-- Name: test_case_testid_seq; Type: SEQUENCE SET; Schema: public; Owner: -
106
106
--
107
107
 
108
 
SELECT pg_catalog.setval('test_case_testid_seq', 10, true);
 
108
SELECT pg_catalog.setval('test_case_testid_seq', 6, true);
109
109
 
110
110
 
111
111
--
112
112
-- Name: test_suite_suiteid_seq; Type: SEQUENCE SET; Schema: public; Owner: -
113
113
--
114
114
 
115
 
SELECT pg_catalog.setval('test_suite_suiteid_seq', 5, true);
 
115
SELECT pg_catalog.setval('test_suite_suiteid_seq', 3, true);
116
116
 
117
117
 
118
118
--
119
119
-- Name: worksheet_exercise_ws_ex_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
120
120
--
121
121
 
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);
123
123
 
124
124
 
125
125
--
186
186
def main():
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.
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
189
 
193
190
 
194
191
ALTER TABLE exercise ENABLE TRIGGER ALL;
256
253
 
257
254
ALTER TABLE offering DISABLE TRIGGER ALL;
258
255
 
259
 
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);
260
 
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);
261
 
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);
262
 
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);
263
 
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);
264
 
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);
 
256
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');
 
257
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');
 
258
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');
 
259
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');
 
260
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');
 
261
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');
265
262
 
266
263
 
267
264
ALTER TABLE offering 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);
391
386
 
392
387
 
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);
409
402
 
410
403
 
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
422
415
');
423
 
INSERT INTO test_suite (suiteid, exerciseid, description, seq_no, function, stdin) VALUES (4, 'hello', 'Prints "Hello, world!" exactly', 0, '', '');
424
416
 
425
417
 
426
418
ALTER TABLE test_suite ENABLE TRIGGER ALL;
431
423
 
432
424
ALTER TABLE worksheet DISABLE TRIGGER ALL;
433
425
 
434
 
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.
435
 
 
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 "the ``print`` statement in Python lets you print text to the screen".
437
 
 
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 the ``print`` statement in the following exercise".
439
 
 
440
 
Beginning a line with ``.. exercise:: <exercise-name>`` embeds an exercise in a worksheet, like this:
441
 
 
442
 
.. exercise:: hello
443
 
 
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.
445
 
 
446
 
Here is a second exercise. This one involves writing functions, and has multiple parts. The test suite will test each part individually.
447
 
 
448
 
.. exercise:: factorial
449
 
', true, 0, 'rst', true);
 
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.
 
427
 
 
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".
 
429
 
 
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".
 
431
 
 
432
Beginning a line with ``.. exercise:: <exercise-name>`` embeds an exercise in a worksheet, like this:
 
433
 
 
434
.. exercise:: factorial
 
435
 
 
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');
450
437
 
451
438
 
452
439
ALTER TABLE worksheet ENABLE TRIGGER ALL;
457
444
 
458
445
ALTER TABLE worksheet_exercise DISABLE TRIGGER ALL;
459
446
 
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);
462
448
 
463
449