SessionReg

Source: SessionReg.js:38

This class encapsulates data of a user's working session, usually associated to a single JClicProject
It's main component is sequences, an array of SequenceReg objects.


Constructor

new SessionReg( project: module:project/JClicProject.JClicProject, code?: string, ): SessionReg

SessionReg constructor

Parameters


Instance Methods

getData(recalcInfo: boolean, includeEmpty: boolean): object

Builds a complex object with the results of all activities done during this working session

Parameters

  • recalcInfo (boolean) — When true, global variables (number of sequences, score, total time...)
    will be recalculated from the data stored in the SequenceReg objects.
  • includeEmpty (boolean) — When true, sequences without reported activities will be also included in the results

Returns

  • object

getInfo(): module:report/SessionReg.SessionRegInfo

Returns the info element associated to this SessionReg.

Returns

end()

Closes this session

endSequence()

This method should be called when the current working session finishes.

newSequence( ase: module:bags/ActivitySequenceElement.ActivitySequenceElement, )

This method should be invoked when a new sequence starts

Parameters

newActivity(act: module:Activity.Activity)

This method should be invoked when the user starts a new activity

Parameters

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 activity
  • solved (boolean) — true if the activity was finally solved, false otherwise.

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) — true if the action was OK, false, null or undefined otherwise

getCurrentSequenceTag(): string

Gets the name of the current sequence

Returns

  • string

getCurrentSequenceInfo( ): module:report/SequenceReg.SequenceRegInfo

Gets information about the current sequence

Returns

Instance Fields

reportableActs: number

Number of activities suitable to be reported in this session

actNames: Array.<string>

Array with unique names of the activities being reported in this session

sequences: Array.<module:report/SequenceReg.SequenceReg>

List of sequences done in this session

currentSequence: module:report/SequenceReg.SequenceReg

The sequence currently active

started: external:Date

Starting date and time of this session

projectName: string

Name of the JClicProject associated to this session

info: module:report/SessionReg.SessionRegInfo

Current session info

code: string

Optional code to be used with this session