Skip to main content

grade student submissions based on check50 json reports.

Project description

grade50

This is a small tool to be used in combination with the CS50 automarker check50. It allows to grade a student's submission based on check50's json report and a given grading scheme.

Synopsis

usage: grade50 [-h] [-v] [-o {ansi,json}] [-t TEMPLATE] [-V] scheme report

grade student submissions based on check50 json reports.


positional arguments:
  scheme
  report

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose
  -o {ansi,json}, --output {ansi,json}
                        output format
  -t TEMPLATE, --template TEMPLATE
                        jinja2 template for ansi output
  -V, --version         output version information and exit

Installation

pip install grade50

Grading Schemes

are given in YAML format and have to contain a list of parts, each of which is a dictionary defining a name and a list of checks. A check is a dictionary with

  • name a string, has to appear as check name in the check50 report file. This means our problem set has a check (python function) by that name.
  • points, an integer, the number of points given if the check passes. Can be zero.
  • fail_comment (optional), a string that will be added as a feedback comment in case the check fails. This may contain variables that will be replaced by the contend of the check50 check. For instance, "{log}" for the logging strings or "{cause[rationale]}" for the rationale in failing checks. This will default to "{cause[rationale]}" if not given, i.e. the short string produced by check50 on the console if the check fails.
  • pass_comment (optional), a string that will be added as a feedback comment in case the check passes. Sometimes it is nice to say "well done for X". This will default to no comment if unset.

Example:

- name: "Part 1"
  checks:
    - name: caesar_exists
      points: 0
      fail_comment: "Caesar.java was not submitted"
    - name: caesar_compiles
      points: 0
      fail_comment: "Caesar.java does not compile\n{log}"


- name: "Part 2"
  checks:
    - name: caesar_rotate_string_shift_5
      points: 2
      # no fail_comment set. This is equivalent to
      # fail_comment: {cause[rationale]}
      pass_comment: Your rotation seems to work. Well done!

    - name: caesar_many_args
      points: 2
      fail_comment: |
        Caesar does not print the right error message whe run with too many arguments (too many newlines/spaces?).
        expected was
        ---
        {cause[expected]}
        actual was
        ---
        {cause[actual]}

Output

grade50 can output either plain text or json data for further use in scripts.

json

use grad50 -o json to output json data. This will be a dictionary mapping points and points_possible to the total score and total possible score, respectively. Further, it maps parts to a list of dicts, each with

  • name
  • points
  • points_possible
  • comments (a list of comment strings for all checks in this part)

text

Textual output is the default. It is based on the above and the default template (see grade50/templates/default.jinja2). You can pass any other jinja2 template as by means of the --template option. This way one can easily generate for example latex sources that can be compiled into pdf feedback files for students.

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

grade50-0.4.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

grade50-0.4-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file grade50-0.4.tar.gz.

File metadata

  • Download URL: grade50-0.4.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for grade50-0.4.tar.gz
Algorithm Hash digest
SHA256 f872829352178eac474c3939dce79da8d4bdddbfd16bdf68e42288fb60d69f0f
MD5 cdb9660362e681857013e5d331424aef
BLAKE2b-256 5462090085a71489c710b009bfac008c1cb9966cc5179e3602dd8bef8d7bae42

See more details on using hashes here.

File details

Details for the file grade50-0.4-py3-none-any.whl.

File metadata

  • Download URL: grade50-0.4-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for grade50-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 14634064f290c7cd47cc964dcd577d50c7ee103babdbd915da82d202ae27a416
MD5 5f07d71aae9e671b1895a6007013af87
BLAKE2b-256 95b18566d8597a981fec0bead7b8ffe78000f94700f0813e3afff9e06f464b89

See more details on using hashes here.

Supported by

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