Skip to main content
Auto-graded exercises are a core LearnPack feature. They give learners instant feedback as they progress. Write tests with Jest (HTML, CSS, React, JavaScript, DOM) or pytest (Python).
What this covers: grading modes available in LearnPack, and how to validate unit tests with the CLI. ✅

Grading modes

LearnPack supports three grading modes. Pick the one that matches your flow.
ModeWhat it doesWhen to use
IncrementalYou cannot move forward until the current exercise passes its tests. Later steps depend on earlier knowledge.Linear tutorials where each concept builds on the previous one.
IsolatedEach exercise is independent, open any step in any order.Drill practice, reference packs, non-linear paths.
No gradingExercises have no tests.Reading tasks, demos, exploratory content.
incremental-example
Tip: Start with Incremental for structured courses, and use Isolated for optional practice modules.

Test frameworks

Language or contentRecommended framework
HTML, CSS, React, JavaScript, DOMJest
Pythonpytest
Keep assertions clear and deterministic so feedback stays fast and readable.

Validate your unit tests

Use the CLI to audit each exercise’s tests. Ensure each exercise includes a hidden solution file so the command can assert against it.
learnpack test
How it works: when a solution.hide file exists in an exercise, learnpack test runs the test suite against that solution to confirm your checks are correct and aligned with the expected outcome.
Outcome: reliable auto-grading, consistent feedback, and fewer false negatives during learner submissions.

Next up

See also