Members
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 |
(static) find_jme_scope(element) → {Numbas.jme.Scope}
Find the JME scope that applies to this element.
Looks for an element with a 'jme-scope'
data attribute.
Parameters:
Name | Type | Description |
---|---|---|
element |
Element |
Returns:
Type | Description |
---|---|
Numbas.jme.Scope |
(static) find_root_ancestor(element) → {Node}
Find the element's top ancestor node. For elements in the document, this will be the document object itself.
Parameters:
Name | Type | Description |
---|---|---|
element |
Element |
Returns:
Type | Description |
---|---|
Node |
(static) hide_lightbox()
Hide the lightbox.
(static) init()
Initialise the display. Called as soon as the page loads.
(static) makeHTMLFromXML(xml, template, scope, contextDescription) → {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. |
Returns:
Type | Description |
---|---|
Promise |
|
(static) register_lightbox(element)
Register event listeners to show the lightbox when images in this element are clicked.
Parameters:
Name | Type | Description |
---|---|---|
element |
Element |
(static) setJMEScope(element, scope)
Associate a JME scope with the given element.
Parameters:
Name | Type | Description |
---|---|---|
element |
Element | |
scope |
Numbas.jme.Scope |
(static) showAlert(msg, fnOK)
Show an alert dialog.
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | message to show the user |
fnOK |
function | callback when OK is clicked |
(static) showConfirm(msg, fnOK, fnCancel)
Show a confirmation dialog box.
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | message to show the user |
fnOK |
function | callback if OK is clicked |
fnCancel |
function | callback if cancelled |
(static) showConfirmEndExam(msg, fnEnd, fnCancel)
Show the end exam confirmation dialog box.
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | message to show the user |
fnEnd |
function | callback to end the exam |
fnCancel |
function | callback if cancelled |
(static) showLoadProgress()
Update the progress bar when loading.
(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 |
(static) showStyleModal()
Show the modal with styling options.
(static) show_lightbox(original)
Show the lightbox.
Parameters:
Name | Type | Description |
---|---|---|
original |
Element | The original image element which is going to be copied into the lightbox. |