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. Read more to find out how autograders work!
An autograder is a test which runs on a student program to determine whether or not it can be submitted. When a student hits the Submit Code button, the autograder will run, and if any of the autograder's tests fail, then the student will be prompted to fix their code before submitting. (If an assignment doesn't have an autograder, the code will simply be submitted as is.)
An autograder with the right error messages can also help the student figure out what is wrong or missing in their code! Students can see if their code passes all the requirements of an autograder by hitting the Check Code Button.
An autograder can check for output, as well as if the student used the correct style and/or control structures in their code.
Unit Test Test Cases - Similar but Different
The Test Cases in our Unit Test or Practice assignments work a little differently. See General Autograder Test Cases and Unit Tests to learn more about the difference and see Create a Custom Practice Problem to learn more about creating Unit Tests.
Creating an Autograder
Autograders are language specific. With CodeHS Create, you can define autograders to test the content of your student’s code as well as the result that their code produces in any custom exercise that you create. Each language has its own way of creating and defining autograders with code. Once you initialize the Autograder, you will be brought to a code editor with documentation for your chosen language. Read the documentation and our guides carefully, and enjoy the ability to ensure that the code you need to grade is of a high quality!
To Create an Autograder:
First, you will need to create a Coding Exercise assignment and save your changes.
Click Edit next to the assignment. You may need to click the three dots next to the assignment to find the Edit option.
Choose Advanced Settings in the edit modal
Navigate to the Autograders tab. Note: Only coding assignments of the relevant type will have the Autograder tab
Click Add Autograder.
Write your code to create your Autograder and save your changes.
If your assignment is in a Playlist, you can click "..." next to the Playlist name and choose Legacy Edit. The assignments in the Playlist will appear on the left hand side and you can choose the problem you would like to edit.
Language Specific Guides for Autograders:
More Information on Creating Autograders:
Creating Autograders Webinar
Adding an Autograder to Your Custom Assignment Demo
Karel Autograder Demo
For more information, check out Autograders.
Still have questions? Contact our team at firstname.lastname@example.org to learn more!