Overview

This is an advanced guide to creating an autograder for a Python Coding Exercise on the CodeHS platform, detailing how to program an autograder and the what tests are available. It is intended for those with some prior experience working with autograders.

<aside>

❓ Looking for autograders specific to Python with Turtle Graphics? Check out our Turtle Graphics Autograder Guide here:

Turtle Graphics Autograders

</aside>

Accessing the Custom Autograder Edit Window

  1. Go to a created assignment within the Create tool or the Assignments tool and choose Edit.
  2. In the following window, select Autograder from the navigation menu and click Edit Autograder. If there currently are no autograders on that assignment, the button will say Create Autograder instead.
  3. Find the autograder files on the left-hand menu under Custom Autograders and begin making your changes. If there are no autograders, click Add to create one.
  4. Don't forget to click Save Autograder Config when you're finished!

Basic Autograder Setup

This is what you see when you first add an autograder to a program. It already contains examples of how to write tests:

The Parameters of before_run and after_run

Basic Test Case Structure

Test cases will be added to one of two places within a Suite - in the before_run function or the after_run function.