Skip to content

Writing Exercises: Modules

beneater edited this page Oct 31, 2011 · 8 revisions

Using Modules

Depending upon the type of exercise that you're writing you'll likely need to load one or more utility modules in order to render the exercise correctly. This can be done by specifying a data-require="..." attribute on the HTML element of the page.

There are an ever-increasing number of modules (you can find them in the utils/ directory) but the ones that you'll most-likely need are:

  • math (for math-related formulas and utility methods)
  • math-format (often used for formatting fractions)
  • graphie (for everything from drawing geometric shapes to plotting functions)
  • word-problems (for word problems)

There are also utils for angles, calculus, exponents, kinematics, probability, etc.

<!DOCTYPE html>
<html data-require="math word-problems"> <!-- Your modules go on this line... -->
<head>
	<title>Name of Your Exercise</title>
	<script src="../khan-exercise.js"></script>
</head>

Back to Writing Exercises: Home