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, scroll to the bottom and select Custom Autograder Edit.
  3. Click to enable the toggle labeled Python General Autograder to begin making changes.
  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.