Overview

This guide is an in-depth overview of the basics of creating a JavaScript Karel autograder and extends the knowledge base article for Creating a Karel Exercise. It is recommended that you read the knowledge base article, specifically the Add and Edit a Custom Autograder section, before continuing.

❗️Before writing the solution code and setting up the autograder, you should have written the exercise directions and built the starting and ending worlds for Karel.

We will review each of the following items below to learn more about creating fun and basic Karel autograders. The first item, Custom Autograder, is a more advanced feature, and will require intermediate understanding of JavaScript in order to further customize autograders. You are encouraged to preview CodeHS Karel activities that have the JavaScript General Autograder enabled to learn more.

Screenshot 2025-09-12 at 12.13.43 PM.png

Preset Autograder Items

Code Outside Start/Run

If this test is enabled, any code written outside of the start/run function that is not another function will cause the code to not pass.


Command Style

Ensures that the commands follow a specific style guide. Could check for things like proper spacing.

Screenshot 2025-02-14 at 6.51.27 AM.png


Empty Functions/Methods

Prevents students from submitting empty function definitions. Ensures they actually implement logic inside functions instead of placeholders.

Screenshot 2025-02-14 at 7.29.00 AM.png


For Loop

This would check if the student uses a for loop in their code and what the starting and ending conditions should be.

Screenshot 2025-09-12 at 12.15.09 PM.png

Screenshot 2025-02-14 at 7.25.44 AM.png


For Loops: Counting the Number of Loops