Create a coding assignment from a Git repository, with hidden tests
A good programming exercise is usually a small project: starter code, a few helper files, a package file, and a folder of tests. If you already keep yours in Git, there is no need to copy it into the browser file by file. Load the repository into a task, say which files are tests students must not see, and hand it out.
This works with the Git server that comes with the platform, for staff and students of a college. Any coding task can be loaded this way, including one a student will clone and push to, which has a page of its own.
Load a task from a repository
In the task’s editor press Load from Git, choose one of the repositories you can read, then one of its branches or tags, and press Load. Which files are hidden from students and which are protected is read from the repository itself. Once it has loaded, the dialog lists every file that was left out and why: not text, too large, or a name that cannot be used. Closing it reloads the editor.
Loading copies the files once, folders and package file included. After that the task is like any other, with one difference: a task from Git is not autosaved. Press Commit, write a message, and your edits are saved and committed together to the branch you loaded from, so the repository and the task do not drift apart. A task with no repository has Push to Git in the same row: it saves the task, makes a repository named after the module and the task and pushes the task to it. Open in Git, beside it, shows the repository, and Sync loads the branch again so what others pushed is here. If you leave with edits that are not committed the browser asks first, and Discard changes in the Commit window puts the task back to what the repository has. A tag or a commit cannot be committed to: load from a branch. Loading itself never writes to the repository. Students who already have the task keep theirs until you press Update students' copies: choose to update their copies too, with Hand back submitted copies ticked unless you untick it, and your message goes to them. Their own extra files are kept, and a copy in a repository gets a commit. The same limits apply as for any project, 50 files of up to 64 KB each.
- Open the task in its editor. Press Load from Git among the tools above the code.
- Choose the repository and the branch or tag. Pick from every repository you can read, then from its branches and tags.
- Put the lists in the repository. hidden-files.txt and protected-files.txt at its root, one pattern a line: a folder like tests/, a name like test_*.py, or a path.
- Load. Press Load. What was left out is listed afterwards, and the editor reloads.
- Hand it out. Each student gets their own copy, without the hidden files.
Hidden test files, and files students cannot change
Which files students never see, and which they see but cannot change the result with, are two lists kept in the repository itself: hidden-files.txt and protected-files.txt at its root, one pattern a line, such as tests/ or test_*.py, and # for a comment. Loading or updating reads them and nothing else, so a repository without them hides and protects nothing. Hidden files are never handed out, and never put in a student’s repository.
Whenever a student’s work is tested or marked, your hidden and protected files are put back from the task first, so editing a test in their own copy changes nothing that counts. For Python, Java, Go and JavaScript on Node, hidden test files are run by the language’s own test runner, pytest, JUnit, go test or Node’s, beside the task’s Tests tab.
The two files are not files of the task and no student sees them. When you commit a task from the browser to its own repository they are written for you from the task’s lists, and a list that is emptied removes its file. A student’s repository keeps its main branch protected: nobody, you included, can delete it or force-push over it.
Updating the task from a later commit
The task remembers which commit it came from. Update from Git loads a later one and replaces what was edited in the browser since. Students who already have the task keep their own copies, so a fix to the starter code reaches whoever is handed it next.
What it costs, and how to try it
A school or college has its first 365 days free, for up to 50 students and with no card, and everything on this page is part of it. After that the price is per student a year, with staff free and labs, virtual machines and AI included on a fair-use basis. The pricing page has the figure in your currency and a calculator.
Questions people ask
- Can I load a task from GitHub?
- From the platform’s own Git server. To use a project that is on GitHub, push it to a repository on our Git server first, which is one git remote add and one git push.
- Do students see my repository?
- No. They get their own copy of the task, without the hidden files. If you let them clone the task, each gets a new repository made from their own copy, never yours.
- Can a student change the tests they are marked with?
- No. Hidden test files are never given to them, and whenever their work is tested or marked your hidden and protected files are put back from the task.