Constructor
new ActivityReg(act)
ActivityReg constructor
Name | Type | Description |
---|---|---|
act | module:Activity. | The |
- Source
Members
actions :Array.<module:report/ActionReg.ActionReg>
Collection of actions done by the user while playing the activity
- Source
closed :boolean
true
when the activity has finished, false
for the activity that is currently playing
- boolean
- Source
code :string
Optional code assigned to this activity, used for later filtering
- string
- Source
lastAction :module:report/ActionReg.ActionReg
Last ActionReg
performed by the user in this activity
- Source
minActions :number
Minimum number of actions needed to solve the activity
- number
- Source
name :string
Name of the associated activity
- string
- Source
numActions :number
Number of actions done by the user playing this activity
- number
- Source
reportActions :boolean
true
when this type of activity should record specific actions done by the users
- boolean
- Source
score :number
Final score obtained by the current user in this activity
- number
- Source
solved :boolean
true
only when the user has finished and solved the activity
- boolean
- Source
startTime :number
Timestamp when the user starts playing the activity
- number
- Source
totalTime :number
Total time spent by the user in the activity, measured in milliseconds
- number
- Source
Methods
$getXML() → {external:jQuery}
Provides the data associated with the current activity in an XML format suitable for a
JClic Reports Server.
- Source
- Type:
- external:jQuery
closeActivity()
Closes the current activity, adjusting total time if needed
- Source
endActivity(score, numActions, solved)
This method should be called when the current activity finishes. Data about user's final results
on the activity will then be saved.
Name | Type | Description |
---|---|---|
score | number | The final score, usually in a 0-100 scale. |
numActions | number | The total number of actions done by the user to solve the activity |
solved | boolean |
|
- Source
getActionReg(index) → {module:report/ActionReg.ActionReg}
Retrieves a specific ActionReg
element from actions
Name | Type | Description |
---|---|---|
index | number | The nth action to be retrieved |
- Source
getData() → {object}
Builds an object with relevant data about the results obtained by the current student in this activity
- Source
- The results of this activity
- Type:
- object
getPrecision() → {number}
calculates the final score obtained by the user in this activity.
The algorithm used takes in account the minimal number of actions needed, the actions
really done by the user, and if the activity was finally solved or not.
- Source
- Type:
- number
newAction(type, +, +, ok)
Reports a new action done by the user while playing the current activity
Name | Type | Description |
---|---|---|
type | string | Type of action ( |
+ | string | source - Description of the object on which the action is done. |
+ | string | dest - Description of the object that acts as a target of the action (used in pairings) |
ok | boolean |
|
- Source
setProperties($xml)
Fills this ActivityReg with data provided in XML format
Name | Type | Description |
---|---|---|
$xml | external:jQuery | The XML element to be processed, already wrapped as jQuery object |
- Source