Documentation

Writing Calculations

Description

The Writing Calculations module allows for creating writing calculations. You can create multiplication, division, addition, or subtraction activities.

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
Value Simple text to convert. Description of all symbols:
Symbol Description
_ (underscore) empty space
= (equality) line
[x] (square brackets) input box, x is a number which is correct answer
{x} (curly brackets) input help box, x is the default number. The help box can be defined without a default value. Unlike input boxes with square brackets, these boxes are not scored.
+ (plus) plus
- (hyphen) minus
: (colon) or ) (right parenthesis) divisibility
* (asterisk) multiplication
# (hash) equals sign
Signs Here you can change the default sign/symbol assigned to a given type of calculation.
Name Symbol Default
Addition + (plus) \(+\)
Subtraction - (hyphen) \(-\)
Division : (colon) or ) (right parenthesis) \(\big)\)
Multiplication * (asterisk) \(\times\)
Equals = (equality) \(\=\)
Styles Specifying custom CSS classes and inline styles for the subset of cells:
Name Description
Column Coma-separated numbers of columns to be styled.
Row Coma-separated numbers of rows to be styled.
Class Additional CSS class for selected cells.
Style Inline CSS style for selected cells.
Commutativity This property allows users to fill in the inputs in any order (changing rows) in case of addition or multiplication.
Is not activity With this option checked, the module is not an activity, therefore it doesn't mark (in)correct answers nor returns score points (maximum score, score and error count).
Enable more digits in gap Enables to write more digits than one in a gap.
Use numeric keyboard When enabled, gaps will activate the virtual numeric keyboard on mobile devices when selected. This will also cause the gaps to only accept numeric values.
Show all answers in gradual show answers mode If this property is marked, then the Gradual Show Answer module displays the complete solution after using this button only once.

Example value

_[2]0__
=====
_40:2
-[4]0__
=====
_--__

OR

____[3][9]
======
16)624
__-[4][8]_
======
___[1][4][4]
__-[1][4][4]
======
_____0

The eKeyboard integration

It is possible to enter values using the eKeyboard module.

See the documentation of eKeyboard module »

Supported commands

Command name Params Description
isAllOK --- Returns true if all gaps are filled in correctly.
hide --- Hides the module if it is visible.
show --- Shows the module if it is hidden.

Show Answers

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

Scoring

The Writing Calculations module allows the creation of exercises as well as activities.

Property Description
maxScore Number of defined input fields.
score It's 1 point for each properly filled input field.
errorCount It's 1 error point for each input field filled incorrectly.

Events

The Writing Calculations module sends the ValueChanged type events to the Event Bus when a user fills in either one of the fields.

Field name Description
Item Field identifier in <row_number>-<gap_number> format, i.e. 1-2 means input with row = 1 and gap = 2 (each gap is counted in a particular row, not from the beginning of the equation). Both row and gap numbers are counted from 1 to n.
Value Filled value.
Score It's 1 if the filled value was correct, otherwise 0.

When the user fills in all fields properly, the module sends the 'ALL OK' event. This event is different, so its structure is shown below.

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

CSS classes

Class name Description
.wrapper-cell Wrapper for a single cell.
.container-emptyBox Container with single input representing input box (square brackets).
.container-helpBox Container with single input representing help box (curly brackets).
.writing-calculations-input Single input (defined by square and curly brackets).
.wrapper-row Single row.
.cell-#number Which column.
.row-#number Which row.
.incorrect Subclass for an incorrect answer input.
.correct Subclass for a correct answer input.
.empty Subclass for an empty input.
.writing-calculations_show-answers Added in the show answers mode.

It's possible to give other columns and rows different styles.
Columns and rows are numbered. Each of them has its own number.

For example:
The first row has class: row-1, the second row has class: row-2
The first column has class: cell-1, and the second column has class: cell-2.
An example CSS style for the third column:

.addon_WritingCalculations .cell-3 {
      background: #a1f9ff;
 }

Demo presentation

Demo presentation contains examples of how to use the Writing Calculations module.