ActivityReg
Source: ActivityReg.js:39
This class stores miscellaneous data obtained by the current user playing an Activity.
Constructor
new ActivityReg(act: module:Activity.Activity): ActivityRegActivityReg constructor
Parameters
act(module:Activity.Activity) — The Activity referenced by this object.
Instance Methods
$getXML(): external:jQuery
Provides the data associated with the current activity in an XML format suitable for a
JClic Reports Server.
Returns
getData(): object
Builds an object with relevant data about the results obtained by the current student in this activity
Returns
object
setProperties($xml: external:jQuery)
Fills this ActivityReg with data provided in XML format
Parameters
$xml(external:jQuery) — The XML element to be processed, already wrapped as jQuery object
newAction(type: string, +: string, +: string, ok: boolean)
Reports a new action done by the user while playing the current activity
Parameters
type(string) — Type of action (click,write,move,select...)+(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) —trueif the action was OK,false,nullorundefinedotherwise
getActionReg(index: number): module:report/ActionReg.ActionReg
Retrieves a specific ActionReg element from actions
Parameters
index(number) — The nth action to be retrieved
Returns
closeActivity()
Closes the current activity, adjusting total time if needed
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.
Returns
number
endActivity(score: number, numActions: number, solved: boolean)
This method should be called when the current activity finishes. Data about user's final results
on the activity will then be saved.
Parameters
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 activitysolved(boolean) —trueif the activity was finally solved,falseotherwise.
Instance Fields
name: string
Name of the associated activity
code: string
Optional code assigned to this activity, used for later filtering
startTime: number
Timestamp when the user starts playing the activity
totalTime: number
Total time spent by the user in the activity, measured in milliseconds
actions: Array.<module:report/ActionReg.ActionReg>
Collection of actions done by the user while playing the activity
solved: boolean
true only when the user has finished and solved the activity
lastAction: module:report/ActionReg.ActionReg
Last ActionReg performed by the user in this activity
score: number
Final score obtained by the current user in this activity
minActions: number
Minimum number of actions needed to solve the activity
closed: boolean
true when the activity has finished, false for the activity that is currently playing
reportActions: boolean
true when this type of activity should record specific actions done by the users
numActions: number
Number of actions done by the user playing this activity