Free Feature

An Autograder is a tool built into an exercise that tests student programs to identify errors in the code. The Autograder runs anytime the student checks their code or attempts to submit their Assignment. If any of the autograder's tests fail, the student will be prompted to fix their code before submitting.

For some Assignments, the Autograders may not thoroughly test the student code or may not be included in the exercise. In this case, teachers should make sure to review student submissions using our grading tools. Pro teachers can also adjust their Grading Settings to add submissions to their Fast Grade queue.

To learn more about Autograders and how to create you own, watch our webinar on creating Autograders or check out this article on Creating your Own Autograders!

Exercises Without Autograders

There are several reasons why an exercise may not include an Autograder, including:

  1. The Autograder could be easily defeated

  2. Adding an Autograder would limit an open-ended activity

  3. The type of problem does not lend itself to Autograders

What Autograders Can Check For

  • Program Output

  • Interaction with Methods & Functions

  • User Input

Program Output

When a program outputs to the console, Autograders can capture this output and compare it to expected results. For example, if the assignment description says that students should add 5 and 5, the Autograder checks that the output is 10.

However, Autograders cannot check the student code, which means that the Autograders cannot tell if the student adds 5 and 5, multiples 5 and 2, or just prints out 10.

Lessons that focus on comments, or other changes to the code that are not reflected in the output cannot be tested.

Interaction with Methods & Functions

Autograders can pass parameters and receive and test any return values. This allows the Autograder to test multiple calls to the function to verify that it responds correctly to different parameters. Autograders only test output from one method or function at a time.

For example, if an exercise asked the students to create a function or method to take miles as an input and return kilometers, the Autograder can pass different values to the student's function and verify that the return value is correct each time.

User Input

When a program prompts the user, the Autograder can provide input to the prompts. This is helpful for many problems as it allows the Autograder to check multiple runs with different inputs to prevent students from hardcoding answers.

Autograders in Web Design (HTML/CSS)

For certain exercises in Web Design, the Autograders may not thoroughly test the student code, and teachers should make sure to review student submissions.

Autograders can only check the index.html file.

For exercises that include multiple files, only the index.html file is checked. This includes CSS and JavaScript code that is written within the <style> and <script> tags. Autograders will not check an additional CSS or JavaScript file. It will also not check anything included in a second HTML page. In these cases, teachers can glance at the student submission to visually check that CSS elements are correct, or they can go to the additional CSS page and check the code itself.

Autograders in Java

Grader.java errors

Typically when you see a Grader.java error, it is because the student code is missing a key piece outlined in the instructions. When students get this error, we recommend that they go back and double-check the instructions.

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

Did this answer your question?