CourseLab CourseLab 3.5. User's Guide Previous topic Next topic

IF

Conditional action IF enables launching of different dependent actions (or sequences of actions) with regards to the condition being evaluated. Conditions used in IF action could be of several types:

Logical expression

Condition is the expression constructed by JavaScript syntax rules. Expression can contain CourseLab variable (#var_name, where var_name - variable name) or Object's property ($OBJ_ID.property, where OBJ_ID - Object ID and property - existing Object's property) or expressions.

Confirm dialog

In this case the confirmation dialog window (with the specified Text and OK and Cancel buttons) will be displayed. Action sequence will be paused, until user press one of the buttons.

Dragged Object

The only parameter is the ID of the Object.

Scoring

Select the Objective and set condition on Score value. You can use the whole Objective Score value (in this case leave the Source field empty), or the Score of particular interaction (if the source was set by this interaction when saving the score).

Completion status

Select the Objective and status value to check.

Success status

Select the Objective and status value to check.

Syntax

Action sequence, which is to be managed by IF action, must be indented at one position from IF. To launch alternative sequence of actions (when condition is not met) use ELSE action.

Example