Documentation

Writing Calculations

Description

This addon allows you to create writing calculations. You can create multiplication, division, addition, or subtraction activities.

Properties

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
+ (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 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 addiition 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.

Example value

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

OR

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

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.
show --- Shows the module.
hide --- Hides the module.

Show Answers

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

Scoring

Writing Calculations addon allows creating exercises as well as activities.

Property Description
maxScore number of defined input fields
score 1 point for each properly filled input field
errorCount 1 error point for each input field incorrectly filled

Events

The Writing Calculations addon sends ValueChanged type events to 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 1 if filled value was correct, otherwise 0

When a user fills in all fields properly, the addon 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
.writing-calculations-input single input
.wrapper-row single row
.cell-#number which one column
.row-#number which one 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, 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 this addon.