Skip to main content

Java Gradescope Autograder Helper

A tool for creating, running, and packaging Java autograders for Gradescope.

PyPI license PyPI pyversions PyPI version Downloads Downloads Downloads

More easily and quickly create and test Gradescope autograders for Java assignments. By leveraging a reference solution and standard output, there is no need to hard code test cases. And, with a Python config file, you get the full benefits of writing tests in an easy-to-use coding language.

PyPi GitHub

Installation

pip install java-gradescope-autograder-helper

Quick Start

  1. Initialize the Gradescope environment locally: autograder init.
  2. Put reference solution with a main(String[] args) entry point and any other required files in autograder/source/.
  3. Edit autograder/source/tests.py.
  4. Put an example student submission in autograder/submission/.
  5. Test by navigating to /autograder and running autograder run tests.py.
  6. Check results in autograder/results/results.json.
  7. Zip the contents inside autograder/source/ by runinng autograder zip.
  8. Upload to Gradescope with "Base Image OS" Ubuntu 22.04 with "Base Image Variant" JDK 17.

The whole flow for working with this package rests on the structure Gradescope creates in the docker containers it spins up for each student submission. Having that structure locally allows you to quickly iterate without depending on uploading it to Gradescope. You can refer to the Gradescope autograder file hierarchy documentation for more information on how/why the autograder is structured this way.

More comprehensive documentation is available under the Examples section.

Commands

  • autograder: Display the help menu.
  • autograder init: Initialize the Gradescope environment in current directory.
  • autograder run <tests.py>: Run the autograder locally.
  • autograder zip: Zip the contents inside autograder/source/ when in base directory.

Features

The motivation for this package came after noticing the countless hours my professors had to spend creating Gradescope autograders for Java assignments. Additionally, I could not find packages that did exactly what I wanted online. I needed something with comprehensive documentation, that did not require much configuration. This package aims to provide a solution to these problems.

  • No need to hardcode test cases, simply provide a reference solution.
  • Independent of reference or student submission file structure, as long as it has the appropriate main(String[] args) entry point.
  • Easily test autograder locally.
  • Create custom functions for more versatility when testing student output.
  • Test student syntax with Checkstyle by providing a custom config. You can edit or extend the default config by downloading it at: GitHub/bowdoin-checks.
  • Easily package to uplaod to Gradescope.
  • Comprehensive documentation and examples.
  • Easily extensible because it uses a .py file for the configuration.
  • Individually time out test cases instead of the global-only Gradescope timeout.
  • TODO: Create custom style evaluation functions.

Examples

A comprehensive example is available on every execution of autograder init. Additionally, all generated files contain small descriptions and references to their purpose in the original Gradescope documentation.

Here is a sample of what autograder init generates: GitHub/examples.

The most important file is autograder/source/tests.py. This file contains all the configurations for the autograder and the test cases that will be run on the reference and student solutions.

Release Notes

  • 1.2.9:
    • Hide student stderr and most of student stdout to not allow students to expose sensitive autograder information.
    • Writing student stderr and stdout and reference stdout to an "extra_data" field that is not shown on Gradescope.
    • Add to compilation error message that it was likely caused due to different JDK versions. As of now, Gradescope uses JDK 17.
    • Set a default timeout of 1 second.
    • Stopped using default of 0 for "max_score" and instead made it required.
    • Create the "results" folder in case it does not exist when writing "results.json".
    • Print package stdout and stderr to stdout so that Gradescope can capture it.
  • 1.2.8:
    • Made autograder stdout visible to students.
  • 1.2.7:
    • Improved file searching. Now displays all paths when multiple matches are found and uses exact matching with forward slashes to prevent partial matches (e.g., "my_file" will match "path/to/my_file" but not "path/to/hello_my_file").
    • When running autograder init, it will first check if an autograder environment already exists to remove the risk of overriding.
    • Added a warning when executing the autograder run command outside of the autograder directory.
  • 1.2.6:
    • Removed dotenv dependency.
    • Now catches configuration error if javac is not installed.
  • 1.2.5: Added additional option to time out student submissions.

Release files for java-gradescope-autograder-helper 1.2.9.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for java-gradescope-autograder-helper 1.2.9.1
File Size Uploaded
java_gradescope_autograder_helper-1.2.9.1.tar.gz 17.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for java-gradescope-autograder-helper 1.2.9.1
File Interpreter ABI Platform
java_gradescope_autograder_helper-1.2.9.1-py3-none-any.whl Python 3 none any Details

Total release size: 35.5 MB

Release files / java_gradescope_autograder_helper-1.2.9.1.tar.gz

Download URL java_gradescope_autograder_helper-1.2.9.1.tar.gz
Size 17.8 MB
Tags Source
SHA-256 checksum
How to use checksums
c39b1c94f3542a784e0561a20366cfcb964f2f1bf2f463c67c1556a65034cb36
BLAKE2b-256 checksum
How to use checksums
bc1970cf846bf03d2a52165e7d11b26eddb1d7b1702b26cfdf9bde554b15fb01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.5

Release files / java_gradescope_autograder_helper-1.2.9.1-py3-none-any.whl

Download URL java_gradescope_autograder_helper-1.2.9.1-py3-none-any.whl
Size 17.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
908d8a532f8a203815d5a54bd4d43ccb2a16b56024e89f4e703b0f2ff5e1d057
BLAKE2b-256 checksum
How to use checksums
cf09fc1642d9d6bee46a10cc3d704c857e174f0b2feffb12233da14dcfd18f91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.5

Release history Release notifications | RSS feed

This release

1.2.9.1 This release

2 release files

1.2.9

2 release files

1.2.8

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page