Creating a Programming Assignment
Set up an auto-graded coding assignment: languages, SQL Lab, sample and hidden test cases, boilerplate code, time limit, and what learners see.
A programming assignment is a coding question that marks itself. Learners write code in the browser, and Edmingle runs it against the test cases you define and awards marks for each one that passes. This article covers every setting and what learners see.
Programming assignments run code through Judge0. Connect it first in Connecting Judge0. The authoring screens do not warn you if it is missing, so learners would only find out when they try to run their code.
Add a programming assignment
Open the course's Modules tab, then the module and section where it belongs.
Add a material and choose Programming Assignment.
Setup has two steps: Add Basic Test Data and Add Question.
Step 1: Add Basic Test Data
Basic Details
Assignment Name: required, up to 100 characters.
Time Limit: switch on and enter hours (up to 24), minutes and seconds. When time runs out, the learner's code is submitted automatically.
Maximum Marks: required.
How marks are distributed: marks are split equally across all your test cases, sample and hidden together. A test case earns its share only if it passes. For example, a 10-mark assignment with 3 sample and 2 hidden test cases gives 2 marks per test case.
Assignment Instructions
Skip Declaration: learners start straight away instead of first accepting the test declaration.
General Instruction: rich text shown before they start.
Programming assignments always allow unlimited attempts. They have no due date, attendance or result declaration settings.
Step 2: Add Question
Question
Write the problem statement in Question. This is required. Include the input format, the output format and any constraints, because learners' output must match yours exactly.
Choose the lab type
Regular Lab: learners code in one of the languages you allow. Tick any of C, C++, JAVA, Python, PHP, Python 3, Javascript, Typescript and Python for ML (3.13.2).
SQL Lab: learners write SQLite (3.48.0) queries against a database you provide. Click Upload Database File and upload a ZIP archive that contains a single file named
db.sqlite, in.sqliteformat.
Test cases
Test Cases (Regular Lab): sample cases learners can see. Each has an Input and an Output, and both are required. Use Add Test Case for more.
Hidden Test Cases: cases learners never see, used to check that the solution works beyond the examples. Each has an input and a required Output. Use Add Hidden Test Case for more. In SQL Lab, the hidden test case is the expected output of the learner's query.
Keep sample cases simple and put the edge cases (empty input, large numbers, boundary values) in hidden cases. That rewards solutions that genuinely work rather than ones written to match the examples.
Boilerplate code
For each allowed language, you can add starter code that is filled in when the learner opens the assignment, such as a function signature or the code that reads input.
What learners see
The card is labelled PROGRAMMING ASSIGNMENT. Learners open it, read the instructions and start.
The coding screen shows the question, the sample input and output, and a code editor pre-filled with your boilerplate. They choose a Language from the ones you allowed. Changing language erases the code they have written, so they are asked to confirm.
Run Code runs their code against the sample cases, or against their own case using Custom Test Case (they enter both an input and the expected output), and shows the result in the Console. Running does not submit.
Submit Code submits the solution after a confirmation. It is then run against all test cases, sample and hidden, and marked automatically.
Every Run and every Submit is a separate Judge0 execution, and each test case counts as one more. Check your Judge0 plan's quota before a graded session with a whole class.
What's next
Review attempts and adjust marks in Grading Quizzes, Exercises & Programming Assignments. For file-based tasks graded by hand, see Creating an Assignment.