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

Add processText function.

This adds a `processText` function analogous to the
`processMath` function which allows labels which aren't mathy to be
re-rendered as non-mathy.

This is used for graphie label jipt, so we can re-render text labels
with the translated text.

Test Plan:
 - Visit http://exercises.ka.local/exercises/division_1.html
 - Take all the hints.
 - See that the "We can make a row of n circles" and "How many circles
   are there if we make m rows?" labels look good.
 - In the console, run
   `label = KhanUtil.currentGraph.label([0, 0], "test", "center", false)`
 - See that a label appears over the division, centered on the left
 - Run `label.processText("this is a longer string")`, see that the new
   string is rendered and is appropriately centered.

Reviewers: eater, emily

Reviewed By: eater

Subscribers: kevinb

Differential Revision:
Failed to load latest commit information.
build Revert change to remove mathzoom from khan-exercises
css Ensures that the "Show scratchpad" button works
exercises Fix rounding whole numbers
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 Upgrade katex in to v0.2.0
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 Add processText function.
.arcconfig Fix the Show Answers button when reporting an exercise issue.
.arclint add default .arclint file
.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. 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 Temporarily don't detect offline hints.
khan-exercise.js Revert change to remove mathzoom from khan-exercises
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

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.