Skip to main content

Python autograder for Purdue ECE department

Project description

Module Interface

This grader can load specified tests in a desired loaction that match a specified pattern then run them against source code in another module. The results are collected in CSV format with configurable overrides for each test. Test runs can also change based on a custom submission name (e.g. student name). If grading the submission fails, it will fallback to grading a sepcified template submission directory. It can load a config file that can rename the submission directory to a custom label and can assign weights to individual tests. The help output for the grader is below:

usage: grader [-h] [--submission SUBMISSION] [--tests TESTS] [--test-pattern TEST_PATTERN] [--output OUTPUT] [--log LOG] [--config CONFIG] path

positional arguments:
  path                  Path of the module to grade. Defaults to ./

optional arguments:
  -h, --help            show this help message and exit
  --submission SUBMISSION
                        Submission name to grade.
  --tests TESTS         Path of tests to run. Defaults to ./
  --test-pattern TEST_PATTERN
                        Test name pattern to match. Defaults to "test*.py"
  --output OUTPUT       Output file for scores. Defaults to stdout.
  --log LOG             Log file to use. Defaults to stdout.
  --config CONFIG       Config file to use.

Tests Discovery

Tests to run can be located anywhere using a combination of the --tests and --test-pattern args. By default, they are searched for under the current directory and match the test*.py pattern. Tests are discovered using the unittest module.

Grader Config

The grader config can be specified with the --config arg. It is a json file that can specify what happens when a certain test runs or when a certain submission is graded. Individual test configs should be under the "tests" map and the key should be of the form: testFunction (test_filename.TestCaseName). Inividual submission configs should be under the "submissions" map and match the name of the submission. An example format is below:

{
    "tests": {
        "testSimple1 (test_simple.TestSimpleTestCase)": {
            "name": "Simple Test 1",
            "weight": 2
        }
    },
    "submissions": {
        "submission_name": {
            "name": "custom label here"
        }
    }
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grader-purdueece-0.0.2.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

grader_purdueece-0.0.2-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file grader-purdueece-0.0.2.tar.gz.

File metadata

  • Download URL: grader-purdueece-0.0.2.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for grader-purdueece-0.0.2.tar.gz
Algorithm Hash digest
SHA256 009656e73b81eb8bd1e1b53833e9e7c3488f882663a7074d11c3327af93d27fe
MD5 130fd243b776c37b06428348f85a08b9
BLAKE2b-256 8bfc53a7a0d55acac7f3fafec1f58c8ff2fd5913cb6caa13cb29203321b4770c

See more details on using hashes here.

File details

Details for the file grader_purdueece-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for grader_purdueece-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 30b300176fb94b8f1588cab9dc91c88c02283cdedf8b84c17c696da60d703d64
MD5 9066db58efd4b94939a4661d58910fc8
BLAKE2b-256 5faafb80c3073c0f923aba1824c05fd7e4e89493a19d3502c8f63b9e58f2aa64

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page