Unitgrade
Easy-to-use, easy-to-build report evaluations in a framework building on pythons unittest classes
All
- 100% Python; no binary dependencies
- No configuration or test-files needed to use or develop
- For students:
- Easy to use for students: Run tests, obtain score, upload results as a single file with no risk of accidential tampering
- All tests are simple classes so it will integrates well with debugger and any IDE
- Easy to use for teacher: New tests can be build in 100% python, with no need to specify expected output
What it looks like to a student
Homework is broken down into reports. A report is a collection of questions which are individually scored. Each question may in turn involve multiple tests.
Students obtain an overall score for the report, as well as a .token
file which they upload.
In practice, a report consist of an ordinary python file which they simply run. It looks like this:
python report1.py
This create console output which tells the students their current score for each test. It is easy to navigate the code to find which tests fail and solve the problems.
Once students are happy with the result, they run an alternative, not-easy-to-tamper-with script with the _grade
extension to obtain their score. It looks as follows:
python report1_grade.py
This generates a file report1.token
which they upload to campusnet or any other file sharing service.
This file contains the results of the report evaluation, the script output, and so on.
How to develop tests
A unittest consist of three things: The result of the users code, the expected result, and a comparison of the two which may either fail or succeed.
for the comparison I build on top of pythons unittest
framework to obtain a wide variety of well-documented comparisons.
To get the expected result, one option is to specify it yourself, however the recommended (and much easier option) is to maintain a working branch of the code where all the funtionality the students must implement works, and then use
the output of that branch as the expected output in the test.
To see how this works, consider the following minimal example:
sadf