Documentation

Points and Lines

Description

A Points and Lines addon enables you to present a set of points on a plane where by choosing two points you can draw or remove a segment connecting the two points. This can be used as an activity or as a presentation/simulation.

The Addon supports both click & click and drag & drop operating methods. You may choose a more convenient gesture depending on the situation and the device being used.

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
Points' coordinates Here you define the points' coordinates. Put the coordinates in brackets and separate them with a comma. Put each point in a new line, for example:
[30,60]
[70,120]
[50,200]
Points' indexes This property allows to add indexes to the points. Separate the indexes with commas, e.g. A, B, C, D, E. Remember that the number of indexes must be equal to the number of points.
If left empty, the points will appear without indexes.
Starting lines This property allows to define the segments that will be visible at the beginning.
Define a segment by writing the numbers of its endpoints separated with a dash (points are numbered in the order they appear in the Points' coordinates). Definitions of different segments should be comma separated.
If you want the line to be nonremovable, add an asterisk (*) after the second point.
e.g.: 1-2, 1-3, 1-4*
Answer This property allows to define the segments that are to be drawn as an answer. Define the segment by writing the numbers of its endpoints separated with a dash (points are numbered in the order they appear in the Points' coordinates). Definitions of different segments should be comma separated.
Show all answers in GSA mode If this property is selected the gradual show answer button will show correct answers for entire addon.
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.
Blocked lines This property allows to define the segments that cannot be drawn.
Define a segment by writing the numbers of its endpoints separated with a dash (points are numbered in the order they appear in the Points' coordinates). Definitions of different segments should be comma separated.
Block wrong answers With this option checked, wrong answers are removed and the "on wrong" event is sent.
Single Connection With this option checked, only one line can go out from a point.
Alternative texts This property allows to add points descriptions used in TTS mode. Put each description in a new line, for example:
Point 1
Point 2
Point 3
If no value is defined for this property then values from the property 'Points' indexes' or numbers will be used to describe the points, which will read as follows:
'Point A', where 'A' is a point index defined in 'Points' indexes'
'Point 1', where '1' is a index of point when not defined 'Points' indexes'
It is not necessary to declare alternative text for all points. A point without alternative text will read as previously presented. For example:
Point A

Point C
will be read as:
Point A
Point 1
Point C
Lang attribute Allows you to set the langauge used to read the points descriptions via the TTS module.
Speech texts Sets the values of speech texts - predefined phrases providing additional context while using the module in the TTS mode. Speech texts are always read using the content's default language.

Events

The Points and Lines addon sends ValueChanged type events to Event Bus when a line is drawn or removed.

Field name Description
Source module ID
Item the name of the line defined as: line_ponit1_point2
Value 1 when a line is drawn, 0 when a line is removed
Score 1 if the added line should be drawn or if the removed line should be removed, otherwise 0

When a user makes 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.
markAsCorrect --- Mark the addon as correct.
markAsWrong --- Mark the addon as wrong.
markAsNeutral --- Mark the addon as neutral.
isConnected --- index1, index2 (integers from 1 to the number of points defined)
Returns true if the points 'index1' and 'index2' are connected with a line, otherwise false.
isEmpty --- Returns true if no line was added or removed by a student, otherwise false.
isAttempted --- Returns true if any segment is selected.

Scoring

Points and Lines addon allows 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 given in the 'Answer' property that are not defined in the 'Starting lines' property and the lines provided in 'Starting lines' (not marked with an asterisk) that are not defined in 'Answer'.
score The sum of all drawn lines given in the 'Answer' property that are not defined in the 'Starting lines' property and the removed lines entered in 'Starting lines' (not marked with an asterisk) that are not defined in 'Answer'.
errorCount The sum of all drawn lines that are not defined in the 'Answer' property or the 'Starting lines' property and the removed lines given both in 'Starting lines' and 'Answer'.

CSS classes

Class name Description
.pointslines DIV containing the points
.disabled additional class for a disabled addon
.point_container DIV element, a child of pointslines adding more styling possibilities
.point indicates the look of the point
.point_index indicates the look of the index of the point
.line indicates the look of the line
.selected additional class for a selected point
.correct additional class for pointslines for an activity solved correctly
.wrong additional class for pointslines for an activity not solved completely
.noremovable additional class for a nonremovable line
.correctLine additional class for a correct line
.wrongLine additional class for a wrong line

Demo presentation

Demo presentation contains examples of how to use the Points and Lines module.