Skip to content

apluslms/python-grader-utils

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Graderutils

Python library that handles grader test suite management, file validation and test feedback formatting. Originally developed to enable HTML feedback for programming exercise grading output for courses served on the A+ platform. The A+ platform is not required to run graderutils.

Features

  • Running unittest.TestCase tests and producing generic JSON results that may be converted into HTML.
  • Validation tasks before running tests.
  • Restricting allowed Python syntax using black- and whitelists of AST node names.
  • Formatting tracebacks and exception messages to include only essential information (the full, unformatted traceback is also available).
  • Testing input and output of a program against a model program's input and output using IOTester.

Results from examples/01_simple rendered with the default theme:

Grading feedback screenshot

Quickstart

Install

git clone --depth 1 https://github.com/apluslms/python-grader-utils.git
cd python-grader-utils
pip install .

Examples

Using graderutils_format without graderutils

Any JSON strings that validate successfully against the "Grading feedback" JSON schema can be converted to human readable form using graderutils_format.

E.g.

cat results.json | python3 -m graderutils_format.html > results.html

Outline of the grading feedback JSON contents:

Grading feedback JSON schema object diagram

About

Run unit tests to grade Python exercises and get feedback in JSON, which can be converted to HTML

Resources

License

Stars

Watchers

Forks

Packages

No packages published