Class: Router

mathex. Router

Given some steps the Router manages the navigation through the steps till the end of the exercise.

new Router(options) → {Object}

Exercises Router Class

Parameters:
Name Type Argument Description
options Object <optional>
Router options
Properties
Name Type Argument Default Description
widgets Boolean <optional>
true Whether or not to create the font and calculator widgets
Source:
Returns:
A Router instance
Type
Object

Methods

addSteps(s)

Adds steps

Parameters:
Name Type Description
s Array steps
Source:
Returns:
void

allSteps()

Executes all the steps in succession. Debugging purposes.

Source:
Returns:
void

endStep(callback)

Ends the execution of a step

Parameters:
Name Type Argument Description
callback Number <optional>
A callback function to call if it was the last step
Source:
Returns:
void

getCurrent() → {Number}

Gets the current step index

Source:
Returns:
The current step index
Type
Number

getSteps() → {Array}

Gets the steps

Source:
Returns:
The steps
Type
Array

init(s)

Initializes a Router instance

Parameters:
Name Type Description
s Array The exercise's steps
Source:
Returns:
void

startStep(index)

Starts the execution of a step

Parameters:
Name Type Argument Default Description
index Number <optional>
0 The index of the step to be executed, default 0
Source: