report/SessionReg. SessionReg

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, codeopt)

SessionReg constructor

Parameters:
NameTypeAttributesDescription
projectmodule:project/JClicProject.JClicProject

The JClicProject referenced by this session.

codestring<optional>

Optional code to be used by this SessionReg

Members

actNames :Array.<string>

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

Type:
  • Array.<string>

code :string

Optional code to be used with this session

Type:
  • string

currentSequence :module:report/SequenceReg.SequenceReg

The sequence currently active

info :module:report/SessionReg.SessionRegInfo

Current session info

projectName :string

Name of the JClicProject associated to this session

Type:
  • string

reportableActs :number

Number of activities suitable to be reported in this session

Type:
  • number

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

List of sequences done in this session

started :external:Date

Starting date and time of this session

Methods

end()

Closes this session

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.

Parameters:
NameTypeDescription
scorenumber

The final score, usually in a 0-100 scale.

numActionsnumber

The total number of actions done by the user to solve the activity

solvedboolean

true if the activity was finally solved, false otherwise.

endSequence()

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

getCurrentSequenceInfo() → {module:report/SequenceReg.SequenceRegInfo}

Gets information about the current sequence

getCurrentSequenceTag() → {string}

Gets the name of the current sequence

Returns:
Type: 
string

getData(recalcInfo, includeEmpty) → {object}

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

Parameters:
NameTypeDescription
recalcInfoboolean

When true, global variables (number of sequences, score, total time...)
will be recalculated from the data stored in the SequenceReg objects.

includeEmptyboolean

When true, sequences without reported activities will be also included in the results

Returns:
  • An object containing the full session data
Type: 
object

getInfo() → {module:report/SessionReg.SessionRegInfo}

Returns the info element associated to this SessionReg.

newAction(type, +, +, ok)

Reports a new action done by the user while playing the current activity

Parameters:
NameTypeDescription
typestring

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)

okboolean

true if the action was OK, false, null or undefined otherwise

newActivity(act)

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

Parameters:
NameTypeDescription
actmodule:Activity.Activity

The Activity that has just started

newSequence(ase)

This method should be invoked when a new sequence starts

Parameters:
NameTypeDescription
asemodule:bags/ActivitySequenceElement.ActivitySequenceElement

The ActivitySequenceElement referenced by this sequence.