Documentation
Line Selection
Description
The Line Selection module allows users to add selectable lines to the presentation. This can be used either as an activity or a simulation.
Properties
The list starts with the common properties. Learn more about them by visiting the Modules description section. The other available properties are described below.
| Property name | Description |
|---|---|
| Lines | Here you define the coordinates of the lines. They should be listed in a column and contain the x, y values of both their start and end points, as well as 0 if a line should not be selected or 1 if it should. For example: x1;y1-x2;y2-0 x3;y3-x4;y4-1 |
| Is activity | This property allows defining whether the module is an activity or not. When it is not defined as an activity, the answers given are not considered in the overall result. It is helpful when, e.g., creating simulations. |
| Is disabled | Allows disabling the module so that the user is not able to interact with it. |
| Single Mode | If checked, only one line can be selected at a time. Otherwise, the user can select many lines. |
Events
The Line Selection module sends the ValueChanged type events to the Event Bus when a line is selected or deselected.
| Field name | Description |
|---|---|
| Item | ID of the line (lines are numbers as they are put in the Lines property). |
| Value | 1 for selection, 0 for deselection. |
| Score | 1 for correct answer, 0 for wrong. |
When the user selects all lines properly without any error, the module sends the 'ALL OK' event.
| Field name | Description |
|---|---|
| Item | all |
| Value | N/A |
| Score | N/A |
Supported commands
| Command name | Params | Description |
|---|---|---|
| show | --- | Shows the module if it is hidden. |
| hide | --- | Hides the module if it is visible. |
| reset | --- | Resets the module. |
| enable | --- | Enables the module. |
| disable | --- | Disables the module. |
| isAllOK | --- | Returns true if all lines are made correctly and there are no mistakes, otherwise false |
| select | index | Selects the line with a given index. |
| deselect | index | Deselects the line with a given index. |
Scoring
The Line Selection module allows creating exercises. To set the module in an exercise mode, mark its 'Is activity' property. If the module is not in an exercise mode, all of the below methods return 0!
| Property | Description |
|---|---|
| maxScore | The sum of all lines that should be selected. |
| score | The sum of all selected lines that have 1 at the end of their definition in the 'Lines' property. |
| errorCount | The sum of all selected lines that have 0 at the end of their definition in the 'Lines' property. |
Show Answers
This module is fully compatible with the Show Answers module and displays correct answers when an adequate event is sent.
CSS classes
| Class name | Description |
|---|---|
| .lines_selection | DIV containing the whole module. |
| .lines_wrapper | SVG containing the lines. |
| .disabled | Additional class for lines-selection for the disabled module. |
| .lines_wrapper .line | Indicates the look of the line. |
| .lines_wrapper .lines.selected |
Additional class for the line. Indicates the look of the selected line. |
| .lines_wrapper .lines.correct |
Additional class for the line. Indicates the look of the correctly selected line in the error checking mode. |
| .lines_wrapper .lines.wrong |
Additional class for the line. Indicates the look of the incorrectly selected line in the error checking mode. |
| .lines_wrapper .lines.show_answers_ok |
Additional class for the line. Indicates the look of the line that should be selected in the Show Answers mode. |
Demo presentation
Demo presentation contains examples of how to use the Line Selection module.