Constructor
new QuestionModel(setup, ctrl)
Create a question model.
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
setup |
Object | The setup object. Properties
|
||||||||||||||||||||||||
ctrl |
Object | The control object. |
Members
parentPool :ViewCLI
The command-line interface control object.
Type:
tools :ToolsCLI
The tools object.
Type:
Methods
createPool(setup) → {PoolForm}
Parameters:
| Name | Type | Description |
|---|---|---|
setup |
PoolForm | New PoolForm setup. |
Returns:
- Type
- PoolForm
getQuestion(id) → {QuestionModel}
Gets a question by ID.
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string | The ID of the question to get. |
Returns:
The question model object.
- Type
- QuestionModel
getValue(key) → {*}
Gets the value of a key.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | The key to get the value for. |
Returns:
The value of the key.
- Type
- *
(async) goNext() → {*}
Goes to the next question.
Returns:
The next question.
- Type
- *
overrideListener(eventName, action)
Overrides the listener for the specified event.
Parameters:
| Name | Type | Description |
|---|---|---|
eventName |
string | The name of the event to override the listener for. |
action |
function | The new action to perform when the event is triggered. |
setListener(eventName, action)
Sets a listener for the specified event.
Parameters:
| Name | Type | Description |
|---|---|---|
eventName |
string | The name of the event to set the listener for. |
action |
function | The action to perform when the event is triggered. |
setValue(key, value)
Sets the value of a key.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | The key to set the value for. |
value |
* | The value to set. |
(async) trigger() → {*}
Triggers the question.
Returns:
The result of the question trigger.
- Type
- *