Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A framework for building exercises to work with Khan Academy.

Close experiment in favor of clues (khan-exercises)

Khan-exercises companion to:
- webapp
- perseus


When the user answers incorrectly, we will now always show the clue (or rather, "rationale" as it's known to some) for why that answer was incorrect if that content exists. Though the experiment was only for perseus exercises, this khan-ex change is required because both rationales and "hey you, simplify your answer to be more correct" messages share some codes.

Not sure who owns this, so sending to Eater and CC'ing Michelle. Feel free to redirect.

Test Plan:
Test a perseus exercise with rationales:
Visit /exercise/naming-shapes-2, one of the exercises in targeted_clues_exercises.Exercise
Get the answer wrong
See that a rationale popped up

See that you can select the right answer and proceed

Test a perseus exercise without rationales:
Visit any other exercise, say /e/recognizing-shapes, that doesn't have rationales
Get some right / wrong and make sure nothing exploded

Test a khan-exercise exercise with a score.message
Visit /e/simplifying_fractions
Enter the correct fraction but unsimplified
See a message under the check answer button about simplifying

Answer correctly too

Test a khan-exercise exercises without triggering score.message
Visit /e/addition_1
Answer wrong and right successfully

Reviewers: eater

Reviewed By: eater

Subscribers: michelle

Differential Revision:
latest commit a7b7617e49
Marcia Lee marcia authored
Failed to load latest commit information.
build Change khan-exercises to use /api/internal everywhere
css Fix dropdown z-index
exercises Can't have <p> inside a <p>
fonts Move all answer area content to the bottom of the question area
genfiles Remove references to `USERNAME`
images Update badge images and fix clipping
local-only Send client local datetime when submitting problem attempts
test Tests: Make tests run again
third_party Use webpack to bundle JS together, not requirejs
tools Add tools/, which will be automatically run by khan-linter.
utils Something you can point to != interactive
.arcconfig update .arcconfig to https
.gitignore Fixed a few TODOs.
.gitmodules Move qunit to a more-global directory
.travis.yml Try a different room ID!
Gemfile Fixed a few TODOs.
Makefile Fixed a few TODOs. Link to careers page, not Jobvite
exercises-stub.js (khan-exercises) Replace top-level var declaration with explicit glob…
history.js Fix coach report answer correctness color
interface.js Close experiment in favor of clues (khan-exercises)
khan-exercise.js Determinstically choose problem type
lint_blacklist.txt Use webpack to bundle JS together, not requirejs
main.js Use requirejs for module loading
package.json Fixed a few TODOs.
requirements.txt First pass at creating a new script for our i18n e…

Khan Academy Exercises

Copyright (c) 2014 Khan Academy

The exercise framework is MIT licensed.

The exercises are under a Creative Commons by-nc-sa license.

Exercise Framework

Khan Academy has created a generic framework for building exercises. This framework, together with the exercises themselves, can be used completely independently of the Khan Academy application.

The framework exists in two components:

  • An HTML markup for specifying exercises.
  • A jQuery plugin for generating a usable, interactive, exercise from the HTML markup.

Using the Framework Locally

You need to serve the files from some sort of a server. You can't just open the files directly in a browser. For example:

cd khan-exercises
python -m SimpleHTTPServer # or python3 -m http.server

Now if you open your browser to http://localhost:8000 (or you should see the contents of the khan-exercises directory. Navigate to the exercises subfolder, and an HTML file under there to see an exercise.

Exercise Development

This framework supports over 450 of our current math exercises including updated versions of many exercises Sal built for his cousins before he made his first video! New exercises on Khan Academy, however, are now written by many content experts using Perseus and stored in our datastore as individual questions.


If you're passionate about providing a free world-class education for anyone, anywhere and want to apply to be a full-time or intern software developer at Khan Academy, please do so.

Something went wrong with that request. Please try again.