Jump to navigation

Numbas API documentation

Files

runtime/scripts/controls.js

Wrappers for the various navigation actions the user can do.

The assumption is that these should only be called in response to some event the user triggers, by clicking or whatever.

Provides Numbas.controls

Source:

runtime/scripts/exam.js

Defines the Numbas.Exam object.

Source:

runtime/scripts/jme.js

Sets up the JME compiler and evaluator.

Provides Numbas.jme

Source:

runtime/scripts/jme-builtins.js

Sets up JME built-in functions.

Provides Numbas.jme

Source:

runtime/scripts/jme-display.js

Stuff to do with displaying JME expressions - convert to TeX, simplify, or convert syntax trees back to JME

Provides Numbas.jme.display

Source:

runtime/scripts/jme-rules.js

Code to do with JME pattern-matching rules.

Provides Numbas.jme.rules

Source:

runtime/scripts/jme-variables.js

Stuff to do with making new functions from JME or JavaScript code, generating question variables, and substituting variables into maths or the DOM

Provides Numbas.jme.variables

Source:

runtime/scripts/json.js

Stuff to do with loading from JSON objects. Provides Numbas.json.

Source:

runtime/scripts/math.js

Mathematical functions, providing stuff that the built-in Math object doesn't, as well as vector and matrix math operations.

Provides Numbas.math, Numbas.vectormath and Numbas.matrixmath

Source:

runtime/scripts/numbas.js

Contains code to load in the other script files, and initialise the exam.

Creates the global Numbas object, inside which everything else is stored, so as not to conflict with anything else that might be running in the page.

Source:

runtime/scripts/parts/custom_part_type.js

The Numbas.parts. object

Source:

runtime/scripts/parts/extension.js

The Numbas.parts. object

Source:

runtime/scripts/parts/gapfill.js

runtime/scripts/parts/information.js

The Numbas.parts. object

Source:

runtime/scripts/parts/jme.js

runtime/scripts/parts/matrixentry.js

runtime/scripts/parts/multipleresponse.js

runtime/scripts/parts/numberentry.js

runtime/scripts/parts/patternmatch.js

runtime/scripts/question.js

runtime/scripts/schedule.js

runtime/scripts/scorm-storage.js

Provides a storage API Numbas.storage.SCORMStorage which interfaces with SCORM

Source:

runtime/scripts/start-exam.js

runtime/scripts/timing.js

A few functions to do with time and date, and also performance timing. Provides Numbas.timing.

Source:

runtime/scripts/util.js

Convenience functions, extensions to javascript built-ins, etc. Provides Numbas.util. Includes es5-shim.js

Source:

runtime/scripts/xml.js

Stuff to do with loading XML, and getting data out of XML. Provides Numbas.xml.

Source:

themes/default/files/scripts/display.js