Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A framework for building exercises to work with Khan Academy.
HTML JavaScript CSS Python Shell Makefile
Latest commit eb7d469 @brownhead brownhead Reintroduce offline cheating detection.
We removed the offline cheating detection because it was misfiring too
often. I've come up with two potential causes of this misfiring and
fixed both of them:

1) We were not keying the `OfflineHintRecord` on the user ID (doh).
2) We were not checking the the `userExercise` object had a name (when
   content creators look at a preview in Perseus One the exercise
   name will be undefined).

Because the symptoms of this bug are somewhat severe (students being
unable to get X in a row succsefully) I'm rolling this out tentatively.
Every time we detect cheating, we'll send a message to the server that
will make its way into our logs. I'll look at the frequency of these
logs, as well as the percentage of coached users (most likely to cheat)
that are caught with this, to see if the code is working or not.

Test Plan:
1) Open up any exercise.
2) Disconnect from the internet or kill your app server.
3) Take a hint.
4) Close the tab (or refresh to get a blank screen)
5) Reconnect or bring back up your app server
6) See no hints, but see that the added Ajax request fired succesfully.

Reviewers: eliana

Reviewed By: eliana

Subscribers: #sat

Differential Revision:
Failed to load latest commit information.
build Fix $_ in local i18n.js so that Perseus can use it when running locally
css Update khan-exercises to remove all references to Jed.
exercises Add some text to ellipse_intuition to help explain the exercise better.
fonts Move all answer area content to the bottom of the question area
genfiles Change from $._ and $.ngettext over to i18n._ and i18n.ngettext.
images Update badge images and fix clipping
local-only Update khan-exercises to remove all references to Jed.
test Tests: Make tests run again
third_party Revert change to remove mathzoom from khan-exercises
tools Add tools/, which will be automatically run by khan-linter.
utils Change from $._ and $.ngettext over to i18n._ and i18n.ngettext.
.arcconfig Fix the Show Answers button when reporting an exercise issue.
.arclint Fix the regexp for arc lint to correctly only match a single line.
.gitignore Fixed a few TODOs.
.gitmodules Move qunit to a more-global directory
.travis.yml Send Travis alerts to Slack instead of HipChat
Makefile Get rid of an obsolete comment. Cleanup README and make status clearer.
exercises-stub.js Add a bunch of eslint-disable comments for legacy code.
history.js Change from $._ and $.ngettext over to i18n._ and i18n.ngettext.
interface.js Reintroduce offline cheating detection.
khan-exercise.js Add support for two new problem-error types.
lint_blacklist.txt Add MathZoom.js to MathJax for real
main.js Use requirejs for module loading
package.json Rewrite pack.rb in javascript, to remove the main ruby dep on our cod…
requirements.txt First pass at creating a new script for our i18n e…

Khan Academy Exercises

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.

This repo consists of two parts:

  • Various HTML files that describe exercises.
  • A jQuery plugin for generating a usable, interactive, exercise from any of the HTML files.

Current Status

Khan Exercises is no longer used for development of new exercises at Khan Academy. We're always looking to improve the exercises that are currently built with Khan Exercises, but at this time we don't intend to add any new exercises. New exercises on Khan Academy are written by many content experts using Perseus and stored in our datastore as individual questions.


Copyright (c) 2015 Khan Academy

The exercise framework is MIT licensed.

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

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.


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.