Jump to navigation

Namespace: display

Numbas.display

Members

(static) control_focus

Should Numbas control the browser's scroll and focus? Set to true if the page only contains this Numbas exam. Disable this if the exam is embedded in a page.

Source:

(static) font_options

List of options for the display font.

Source:

Methods

(static) die(e)

The Numbas exam has failed so much it can't continue - show an error message and the error.

Parameters:
Name Type Description
e Error
Source:

(static) init()

Initialise the display.

Source:

(static) makeHTMLFromXML(xml, template, scope, contextDescription, root_element) → {Promise}

Make HTML from an XML node and bind it to the given scope and display object. Variables are substituted from the given scope using Numbas.jme.variables.DOMcontentsubvars.

Parameters:
Name Type Description
xml Element
template XMLDocument
scope Numbas.jme.Scope
contextDescription string

Description of the JME context, for error messages.

root_element Element

The exam's root <numbas-exam> element - used to register lightbox handlers.

Returns:
Type Description
Promise
  • Resolves to the produced HTML element after variables have been substituted.
Source:

(static) showLoadProgress()

Update the progress bar when loading.

Source:

(static) showScoreFeedback(obj, settings) → {Numbas.display_util.scoreFeedback}

Update a score feedback box.

Parameters:
Name Type Description
obj Numbas.display_util.feedbackable

Object to show feedback about.

settings Numbas.display_util.showScoreFeedback_settings
Returns:
Type Description
Numbas.display_util.scoreFeedback
Source:

(static) typeset(elementopt, callback)

Make MathJax typeset any maths in the selector.

Parameters:
Name Type Attributes Description
element Element <optional>

Element to typeset. If not given, the whole page is typeset.

callback function

Function to call when typesetting is finished.

Source: