Class: QuestionModel

QuestionModel(setup, ctrl)

Class representing a question model.

Constructor

new QuestionModel(setup, ctrl)

Create a question model.

Parameters:
Name Type Description
setup Object

The setup object.

Properties
Name Type Description
id string

The question ID.

type string

The question type (default, form-control).

text string

The question text.

required boolean

Whether the question is required.

next string

The ID of the next question.

events EventsHandlers

The events handlers object.

formCtrl PoolForm

The pool form object.

ctrl Object

The control object.

Source:

Members

parentPool :ViewCLI

The command-line interface control object.

Type:
Source:

tools :ToolsCLI

The tools object.

Type:
Source:

Methods

createPool(setup) → {PoolForm}

Parameters:
Name Type Description
setup PoolForm

New PoolForm setup.

Source:
Returns:
Type
PoolForm

getQuestion(id) → {QuestionModel}

Gets a question by ID.

Parameters:
Name Type Description
id string

The ID of the question to get.

Source:
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.

Source:
Returns:

The value of the key.

Type
*

(async) goNext() → {*}

Goes to the next question.

Source:
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.

Source:

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.

Source:

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.

Source:

(async) trigger() → {*}

Triggers the question.

Source:
Returns:

The result of the question trigger.

Type
*