Members
audioStatus :boolean
Turns game audio ON/OFF
Type:
- boolean
- Source:
canvas :object
HTMLCanvasElement : Canvas where all the game elements are rendered.
Type:
- object
- Source:
(constant) colors :object
Preset colors for graphic elements.
Type:
- object
- Source:
completedLevels :number
Number of finished levels in the map
Type:
- number
- Source:
(constant) debugMode :boolean
Turns console messages ON/OFF (for debug purposes only)
Type:
- boolean
- Source:
fractionLabel :boolean
Turns displaying the fraction labels on levels ON/OFF
Type:
- boolean
- Source:
gameDifficulty :number
Holds game overall difficulty. 1 (easier) -> n (harder).
In squareOne can be: 1..3.
In circleOne/squareTwo can be: 1..5.
In squareOne can be: 1..3.
In circleOne/squareTwo can be: 1..5.
Type:
- number
- Source:
gameMode :string
Holds selected game mode.
In squareOne/circleOne can be: 'A' (click on the floor) or 'B' (click on the amount to go/stacked figures).
In squareTwo can be: 'A' (more subdivisions on top) or 'B' (more subdivisions on bottom).
In squareOne/circleOne can be: 'A' (click on the floor) or 'B' (click on the amount to go/stacked figures).
In squareTwo can be: 'A' (more subdivisions on top) or 'B' (more subdivisions on bottom).
Type:
- string
- Source:
gameOperation :string
Holds game math operation.
In squareOne can be: 'Plus' (green tractor goes right) or 'Minus' (red tractor goes left).
In circleOne can be: 'Plus' (green tractor goes right), 'Minus' (red tractor goes left) or 'Mixed' (green tractor goes both sides).
In squareTwo can be: 'Equals' (compares two rectangle subdivisions).
In squareOne can be: 'Plus' (green tractor goes right) or 'Minus' (red tractor goes left).
In circleOne can be: 'Plus' (green tractor goes right), 'Minus' (red tractor goes left) or 'Mixed' (green tractor goes both sides).
In squareTwo can be: 'Equals' (compares two rectangle subdivisions).
Type:
- string
- Source:
gameShape :string
Used for text and game information.
Shape that makes the name of the game - e.g in 'squareOne' it is 'square'.
Can be: 'circle' or 'square'.
Shape that makes the name of the game - e.g in 'squareOne' it is 'square'.
Can be: 'circle' or 'square'.
Type:
- string
- Source:
gameType :object
Selected game.
Can be the objects: squareOne, squareTwo or circleOne.
Can be the objects: squareOne, squareTwo or circleOne.
Type:
- object
- Source:
gameTypeString :string
Name of the selected game.
Can be: 'squareOne', 'squareTwo' or 'circleOne'.
Can be: 'squareOne', 'squareTwo' or 'circleOne'.
Type:
- string
- Source:
(constant) iLMparameters
[Functions used by iAssign]
Holds the parameters passed by the iAssign to the iLM via URL.
- Source:
(constant) info :object
Metadata for all games
Type:
- object
- Source:
langString :string
String that contains the selected language.
It is the name of the language file.
It is the name of the language file.
Type:
- string
- Source:
mapMove :boolean
When true, the character can move to next position in the map
Type:
- boolean
- Source:
mapPosition :number
Character position on the map, aka game levels (1..4: valid; 5: end)
Type:
- number
- Source:
(constant) moodle
FOR MOODLE
iFractions can run on a server or inside moodle through iAssign.
This variable should be set according to where it is suposed to run:
- if true, on moodle
- if false, on a server
iFractions can run on a server or inside moodle through iAssign.
This variable should be set according to where it is suposed to run:
- if true, on moodle
- if false, on a server
- Source:
playerName :string
Player's name
Type:
- string
- Source:
self :object
Holds the current state.
Is used as if it was a 'this' inside state functions.
Is used as if it was a 'this' inside state functions.
Type:
- object
- Source:
(constant) textStyles :object
Preset text styles for game text.
Contains: font, size, text color and text align.
Contains: font, size, text color and text align.
Type:
- object
- Source:
(constant) url :object
List of URL for all media in the game.
Divided: 1st by the state that loads the media / 2nd by the media type.
Divided: 1st by the state that loads the media / 2nd by the media type.
Type:
- object
- Source:
Methods
breakString(text)
Receives the text from the assignment file,
breaks the string into a key/value
and sends it to updateGlobalVariables()
to update game variables before showing the screen.
Parameters:
Name | Type | Description |
---|---|---|
text |
string | content of the .frc file |
- Source:
getAnswer() → {string}
[Functions used by iAssign]
This function is automaticaly called by iAssign in two different times:
- When a PROFESSOR finishes creating an new iLM and clicks "save".
Returns: the iLM created (aka the values set by the professor in text form).
- When a STUDENT finishes solving an assignment and clicks "send".
Returns: data about the student's progress (aka the student's progress in text form).
- When a PROFESSOR finishes creating an new iLM and clicks "save".
Returns: the iLM created (aka the values set by the professor in text form).
- When a STUDENT finishes solving an assignment and clicks "send".
Returns: data about the student's progress (aka the student's progress in text form).
- Source:
Returns:
the data that will be received by iAssign and stored on the database (a game file with extension .frc)
- Type
- string
getEvaluation() → {number}
[Functions used by iAssign]
This function must be present if the iMA uses automatic evaluation.
It is is called by iAssign after the student submits a solution and the data is sent to the moodle database.
It is is called by iAssign after the student submits a solution and the data is sent to the moodle database.
- Source:
Returns:
student's grade for the current assignment : real number between 0.0 and 1.0
- Type
- number
getiLMContent()
Makes a GET request for the assignment file
and sends it to breakString() to treat its content.
- Source:
getParameterByName()
[Functions used by iAssign]
The iLM will be included in the HTML page as an iFrame,
therefore some parameters are going to be passed by the iAssign to the iLM via URL.
This method will read these parameters.
This method will read these parameters.
- Source:
sendToDB(extraData)
Sends game information to database
Parameters:
Name | Type | Description |
---|---|---|
extraData |
string | player information for the current game |
- Source:
updateGlobalVariables(info, infoResults)
Updates game variables before starting the activity, then:
- calls state 'customMenu' if the assignment WAS NOT previously completed.
- calls state 'studentReport' otherwise.
- calls state 'customMenu' if the assignment WAS NOT previously completed.
- calls state 'studentReport' otherwise.
Parameters:
Name | Type | Description |
---|---|---|
info |
object | game information |
infoResults |
undefined | object | student answer (if there is any) |
- Source: