Documentation

Text Selection

Description

The Text Selection addon allows marking / selecting parts of text as correct and wrong phrases.

You can work in two modes:

  • 'Mark phrases to select', where you can mark wrong and correct answers,
  • 'All selectable', where all phrases are selectable and you can mark only the correct answers

and two selection types:

  • 'Single select', where you can select only one phrase,
  • 'Multiselect', where you are able to select multiple phrases.

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 Description
Mode 'Mark phrases to select' or 'All selectable'
Selection type 'Single select' or 'Multiselect'
Text Input text
Enable letters selection This property enables user to specify single letters in a given word that are to be marked as correct or wrong.
Is Not Activity When checked, no score (done, errors) is returned by the addon.
Enable scroll on mobile devices When checked, the addon allows you to scroll after touching the text.

Configuration

Each text element has to be marked with keywords \correct{} (if the word or phrase is correct) and \wrong{} (if the word or phrase is wrong).

\wrong{} is available only in 'Mark phrases to select' mode. In 'All selectable' mode you can mark only the correct phrases and the remaining phrases are wrong.

Selection type: 'Single select' allows you to select only one word or phrase. If one phrase is selected and student selects another one, then only the last phrase will be selected. In 'Multiselect' selection type you can select multiple numbers of phrases.

Supported commands

Command name Params Description
show --- Shows the addon.
hide --- Hides the addon
isAllOK --- Returns true if all correct words are selected, otherwise false.
isAttempted --- Returns true if a user tries to solve the module.

AllOk Event

This event contains the following fields

Field name Description
Source module id
Item value: "all"
Value N/A
Score N/A

Show Answers

This module is fully compatible with Show Answers module and displays correct answers when an adequate event is sent.

Scoring

Property Description
maxScore maximum score is equal to number of phrases marked as correct
score score is equal to number of selected correct phrases
errorCount errorCount is equal to number of selected wrong phrases

CSS classes

Class name Description
.addon_Text_Selection .selectable Phrases are available to be selected in player.
.addon_Text_Selection .selected Phrases are selected.
.addon_Text_Selection .wrong A phrase marked as wrong.
.addon_Text_Selection .correct A phrase marked as correct.
.addon_Text_Selection .hover When a selectable phrase is on mouse hover.
.addon_Text_Selection .correct-answer A phrase marked in the show answers mode.

Styles from the sample presentation

 .addon_Text_Selection .selectable {
       border-radius: 5px;
 }

 .addon_Text_Selection .selected {
       background-color: #FAFAD2; /* yellow */
 }

 .addon_Text_Selection .wrong {
       background-color: #FF6347; /* red */
 }

 .addon_Text_Selection .correct {
       background-color: #7CFC00; /* green */
 }

 .addon_Text_Selection .hover {
       background-color: orange;
       cursor: pointer;
 }

Demo presentation

Demo presentation contains examples of how to use the Text Selection addon.