For teachers · Questions
Write a question the autograder can mark
· 6 min read · For teachers
The practice bank covers the syllabus. When you want a question in your own wording, with your own data, you write it and the tests mark it. Students never receive your solution, and they never see a test you marked hidden.
What a student sees
On New question you write the description, a starter program, the solution, and the tests. Students see the description, the starter and the visible tests. The solution and the hidden tests stay on the server. A saved question is yours: it does not appear in the public practice list.
Saving and editing need a paid teacher plan. If a plan lapses you cannot create or edit, but questions you already saved still run on assignments that include them.
A test is an input and the exact output
- Each test has its inputs, one value per line, and the output the program must print.
- Tick Hidden for a test the student should not read in advance. Use those for the cases that would give the algorithm away.
- Leave at least one test visible, so a student can see the shape of a correct run.
- You can add up to 30 tests.
The solution has to pass every test, visible and hidden, before the question can be saved. Run solution against tests does that check without saving. If a test fails, the message is the same hint a student would see, plus what the program actually printed.
FUNCTION Double(N : INTEGER) RETURNS INTEGER
RETURN N * 2
ENDFUNCTION
DECLARE X : INTEGER
INPUT X
OUTPUT Double(X)120
For that solution, one visible test is input 5 with output 10. A hidden test might be 0 → 0, and another -2 → -6, so a program that always prints 10 fails even though it passes the sample the student can see.
Then assign it
A saved question can be put on a class assignment the same way as a practice question. Homework still defaults to no timer. The steps for the class and the join link are in set homework that marks itself.
Use it with a class
Open Classes to share a join link, or write a question and assign it. Students get a mark as they submit.
More from the blog
- How to fill a trace table the way the mark scheme doesFor students
- Cambridge arrays start at 1For students
- The validation checks Paper 2 actually asks forFor students