Documentation
Sudoku
Description
This module allows users to create activities based on the Sudoku games.
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 |
---|---|
Row Values | This property allows the user to put the initial cell values. An empty cell is defined as “_“. If, for example, a whole row doesn’t have any initial value, it is enough to leave the row empty (empty values are defined automatically). | Is Disabled | Allows disabling the module so that the user cannot interact with it. |
Is Activity | Enables to define whether the Sudoku module is an activity, or not. |
Supported commands
Command name | Params | Description |
---|---|---|
isAllOk | --- | Returns true when all cells are filled in correctly. |
hide | --- | Hides the module if it is visible. |
show | --- | Shows the module if it is hidden. |
enable | --- | Enables the module. |
disable | --- | Disables the module. |
Show Answers
This module is fully compatible with Show Answers module and displays correct answers when a relevant event is sent.
Events
The Sudoku module sends events to the Event Bus when the user enters a value into the cell.
Field name | Description |
---|---|
Item | column_number - row_number |
Value | Current value |
Score | available only when the module is an activity: 1 when the module has a correct answer, 0 for other answers. |
AllOK Event
When all cells are filled in correctly, the module sends the allOk event.
Field name | Description |
---|---|
Item | n/a |
Value | allOk |
Score | n/a |
CSS classes
Property name | Description |
---|---|
sudoku-wrapper | Outer wrapper of the whole module. |
input.cell | Each cell in the module. |
input.filled | Each cell with value at the beginning. |
input.active | Each empty cell at the beginning. |
input.wrong | Style for the wrong answer. |
input.correct | Style for the correct answer. |
input.disable | Style for disabled cells. |
input.check | Style after clicking the Check button. |
Example styles
.Sudoku_example{
}
.Sudoku_example input.check{
opacity: 0.6;
}
.Sudoku_example input.disable{
opacity: 0.6;
}
.Sudoku_example input.wrong{
opacity: 1;
}
.Sudoku_example input.correct{
opacity: 1;
}
Demo presentation
Demo presentation contains examples of how to use the Sudoku module.