Documentation

TrueFalse

Description

This addon is an alternative for the Choice module. It allows putting a single or a multiple-choice activity in a presentation.

Properties

Property name Description
Multi Indicates whether an activity is in a multiple or single choice mode. For a single choice activity it is enough to leave the box unchecked.
Choices Choice options list. i.e. True and False as possible choices.
Questions Questions list. Here you can insert your questions and answers.
Question Single question.
Answer This is a number. It's an index of a correct answer. i.e. in case of 3 possible choices A, B, C "1" indicates the first choice option (A), "2" the second (B), and so on (always counted from left to right). For instance, if "C" is the correct answer, "3" is the number that should be inserted in the "Answer" field. In case of a multiple choice mode, the indexes should be comma separated.
Is not an activity With this option, the selected score and errors will not be returned by addon.
Lang attribute This property allows to define the language for this addon (different than the language of the lesson).
Speech texts List of speech texts: Selected, Deselected, Correct, Incorrect.
This texts will be read by Text to Speech addon after a user performs an action.

Supported commands

Command name Params Description
isAllOK --- Returns true if all answers are selected correctly and there are no mistakes, otherwise false.
isAttempted --- Returns true if any answer to any question is selected.
reset --- Resets the module.
show --- Shows the module.
hide --- Hides the module.

Custom Scoring

The True/False addon supports Custom Scoring scripts. For more information about Custom Scoring see documentation.

Command name Params Description
isSelected questionIndex - index of row
answerIndex - index of answer
Returns true if answer is selected, otherwise false.
markAsCorrect questionIndex - index of row
answerIndex - index of answer
Marks answer as correct.
markAsWrong questionIndex - index of row
answerIndex - index of answer
Marks answer as wrong.
markAsEmpty questionIndex - index of row
answerIndex - index of answer
Marks answer as empty.
removeMark questionIndex - index of row
answerIndex - index of answer
Removes answer's mark.

Events

The True/False addon sends events to Event Bus when a user selects an option. If the answer has already been selected and a question has only one answer possible (Multi option deselected), then the event isn't sent.

Field name Description
Item <Question_number>-<Answer_number< (i.e. 2-3 means that the 3rd answer has been (de)selected for the 2nd question)
Value 1 for selection, 0 for deselection
Score 1 for correct answer, 0 for wrong

When a user selects all answers properly without any error, the addon sends the 'ALL OK' event. This event is different from the normal True/False event and its structure is shown below.

Field name Description
Item all
Value N/A
Score N/A

The second event which is different from others is the 'ROW OK' event. This event is sent when all answers in a single row are correct.

Field name Description
Item <row_number>-all (i.e. 2-all means that all answers were correct for the 2nd row.)
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.

CSS classes

Class name Description
.addon_TrueFalse .tf_radio, .tf_checkbox indicates the look of the table
.addon_TrueFalse .tf_radio_text, .tf_checkbox_text indicates the look of the table cell containing Choice
.addon_TrueFalse .tf_radio_image, .tf_checkbox_image indicates the look of the table cell containing single/multi Choice icon. Icons are inner DIV elements with 'background-image' property pointing to icons URL addresses
.addon_TrueFalse .tf_radio_image.last, .tf_checkbox_image.last indicates the look of the last table cell containing single/multi Choice icon
.addon_TrueFalse .tf_radio_question, .tf_checkbox_question indicates the look of the table cell containing question
.addon_TrueFalse .up Standard state of Choice icon.
.addon_TrueFalse .up.disabled State when choice isn't selected and check answers is pressed.
.addon_TrueFalse .down State when choice is selected.
.addon_TrueFalse .down.wrong State when choice is selected and it's wrong answer.
.addon_TrueFalse .down.correct State when choice is selected and it's correct answer.
.addon_TrueFalse .down.correct-answer State when correct answers are displayed after ShowAnswers event was sent.
.addon_TrueFalse .mouse-hover State of choice on mouse hover

Demo presentation

Demo presentation contain examples of how the True/False Addon can be used.