Documentation

Line Selection

Description

This addon 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' ending points and decide if the line should be selected or not.
It's a new line separated property. Each single line should contain x, y values of both 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 Enables to define whether the module is an activity or not.
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, user can select many lines.

Events

The Line Selection Addon sends the ValueChanged type events to 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 a user selects all lines properly without any error, the addon 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 addon.
hide --- Hides the addon.
reset --- Resets the addon.
enable --- Enables the addon.
disable --- Disables the addon.
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 Delects the line with a given index.

Scoring

The Line Selection Addon allows you to create exercises. To set the module in an excercise mode, choose the 'Is activity' property. If the addon is not in an excercise 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 ddefinition in the Lines property.

Show Answers

This module is fully compatible with the Show Answers module and displays correct answers when a relevant event is sent.

CSS classes

Class name Description
.lines_selection DIV containing the whole addon
.lines_wrapper SVG containting the lines
.disabled Additional class for lines-selection for disabled addon
.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 addon.