Skip to main content

Adding and Editing Custom Autograders and Preset Configs

Learn how to add and edit a custom autograder and preset configs to check student code using the Autograder Editor.

Zach Galant avatar
Written by Zach Galant
Updated this week
Banner: This is a free feature

Overview

CodeHS allows teachers to create customized autograders to help grade student work. Most CodeHS coding exercises come with their own pre-written autograder to help guide students and teachers through the curriculum.

Learn more about CodeHS Autograders and what they can check in this article: CodeHS Autograders 📖

Navigating to the Autograder Editor

You can view the autograder editor from the Autograder Editor tool in the Create App or by clicking the Edit Autograder button in the activity edit modal from the Assignments App.

image displaying Edit Autograder button in the Edit Activity Modal from the Assignments App

When you initialize the Autograder, you will see a code editor with documentation for your chosen language. Use this documentation and our language-specific guides to help you build your own custom autograder.

Using the Autograder Editor

The Autograder Editor allows you to build custom autograders to test your students' code and the results it produces. The editor provides a variety of controls to help you manage your tests and assignments.

Quick Actions

Below the assignment name, you can preview, edit, or assign the activity, and view how many courses the assignment is assigned to.

image displaying the preview and assign buttons in the autograder editor tool

Above the autograder code editor window, you can preview the activity, preview the test case, or expand the code editor window.

image displaying the buttons to preview the test case, preview the activity, and expand the editor window

Adding Autograder Files

Each custom autograder file will contain at least one test case that checks student code. You can add or edit the code to include a new test case to the assignment’s overall autograder. To add a new autograder file:

  1. Click the blue "+Add" button in the lefthand panel or click the green duplicate button next to an existing autograder file.

  2. Navigate to the correct program file in the autograder code editor.

  3. Add or edit the test case(s) code in the program file.

  4. (Pro) Set Visibility and Feedback Level in the top right of the code editor window.

  5. Be sure to press the blue "Save Autograder Code" button at the top right of the editor.

gif displaying duplicating an Autograder file and adding a test case to the code

Preset Configs

⚠️ This feature is limited to JavaScript, Python, HTML, and Java exercises.

Some assignments may include Preset Config autograders below the custom autograder files. These are pre-built tests that perform simple checks on a student's program. For example, they can verify if a student used a while loop or wrote the specified minimum number of comments.

You can toggle Preset Configs on or off, and edit their options by clicking the pencil icon next to each field.

image displaying how to edit a Preset Config test

Language Specific Guides for Autograders

Each language has its own way of creating and defining autograders with code. Check out these articles for more information on creating language specific autograders:

For an advanced guide to creating Custom Autograders, take a look at our Autograder Guides 📚.

image indicating "This is a Pro Feature"

Autograder Visibility and Feedback Level

Set the autograder's Feedback Level and Visbility settings in the top-right of the Autograder Editor or from the Autograders tool in the Code Review App.


Still have questions? Contact our team at hello@codehs.com to learn more!

Did this answer your question?