Module: smartcomponent/PageComponentContext

This is the main context, that will be received by a SmartComponent instance as the context parameter.

Members

<inner> configuration :Object

This context provides functionality and information according to the current configuration.

Type:
  • Object
See:

<inner> device :Object

This context provides functionality and information according to the current device.

Type:
  • Object
See:

<inner> page :Object

This context provides functionality and information according to the current page.

Type:
  • Object
See:

<inner> quiz :Object

This context provides functionality and information according to a quiz.

Type:
  • Object
See:

<inner> stage :Object

This context provides functionality and information according to the stage, like page sequencing and navigation.

Type:
  • Object
See:

<inner> student :Object

This context provides functionality and information according to the current user.

Type:
  • Object
See:

Methods

<inner> getApiVersion() → {object}

Gets the SmartComponent API version.

Returns:

version object

Type
object

<inner> getChildren() → {Array.<HTMLElement>}

Gets an array of the elements, that are attached as children (document editor).

Returns:

shell element

Type
Array.<HTMLElement>

<inner> getElement(selector) → {HTMLElement}

Gets the shell element. Append your SmartComponent-DOM to this element as a child.

Parameters:
Name Type Description
selector string

for child elements, 'null' for the component element.

Returns:

shell element

Type
HTMLElement

<inner> getPath() → {string}

Gets the path to the component folder.

Returns:

file path

Type
string

<inner> getPlayerName() → {string}

Gets the name of the SmartComponent player.

Returns:

"standard" for the standard player or "html5" for the HTML5 player

Type
string

<inner> getPositioningElement() → {HTMLElement}

Gets the element for positioning the SmartComponent.
This element can be used to set and get positions for the component.
The content, classes and attributes should not be changed.

Returns:

positioning element

Type
HTMLElement