Constructor
new Reporter(ps)
Reporter constructor
Name | Type | Description |
---|---|---|
ps | module:JClicPlayer. | The |
- Source
Members
MAX_USERID_PROMPT_ATTEMPTS :number
Maximum number of incorrect UserID attempts
- number
- Source
SCORM
A valid SCORM bridge, or null
if no SCORM API detected.
- Source
bUserBased :boolean
true
if the system is connected to a database with user's data.
When false
, a generic ID will be used.
- boolean
- Source
currentSession :module:report/SessionReg.SessionReg
Currently active session
- Source
descriptionDetail :string
Additional info to display after the reporter's description
- string
- Source
descriptionKey :string
Description of this reporting system
- string
- Source
groupCodeFilter :string
Optional filter key to be used in the group selection dialog
- string
- Source
info :module:report/Reporter.ReporterInfo
The ReporterInfo
used to calculate and store global results.
- Source
initiated :boolean
true
if the system was successfully initiated, false
otherwise
- boolean
- Source
ps :module:JClicPlayer.JClicPlayer
The JClicPlayer
used to retrieve messages
- Source
sessionContext :string
A second optional key to be reported as a field in session records
- string
- Source
sessionKey :string
Optional key to be added as a field in session records
- string
- Source
sessions :Array.<module:report/SessionReg.SessionReg>
Array of sessions included in this report
- Source
started :external:Date
Starting date and time of this report
- Source
userCodeFilter :string
Another optional filter key to be used in the user selection dialog
- string
- Source
userId :string
User ID currently associated with this reporting system
- string
- Source
(static) CLASSES :object
Static list of classes derived from Reporter. It should be filled by Reporter classes at declaration time.
- object
- Source
Methods
end() → {external:Promise}
Closes this reporting system
- Source
- A Promise object to be fullfilled when all pending tasks are finished.
- Type:
- external:Promise
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
endSequence()
Finalizes the current sequence
- Source
endSession()
Finalizes the current session
- Source
getBooleanProperty(key, +) → {boolean}
Gets a specific boolean property from this reporting system
Name | Type | Description |
---|---|---|
key | string | Requested property |
+ | boolean | defaultValue - Default return when requested property does not exist |
- Source
- Type:
- boolean
getCurrentSequenceInfo() → {module:report/SequenceReg.SequenceRegInfo}
Gets information about the current sequence
- Source
getCurrentSequenceTag() → {string}
Gets the name of the current sequence
- Source
- Type:
- string
getData() → {object}
Builds a complex object containing all the results reported while playing activities
- Source
- The current results
- Type:
- object
getGroupData(_groupId) → {external:Promise}
Gets extended data associated with a specific group or organization. This
is a method intended to be implemented in subclasses.
Name | Type | Description |
---|---|---|
_groupId | string | The requested group ID |
- Source
- When fulfilled, an object with group data is returned.
- Type:
- external:Promise
getGroups() → {external:Promise}
Gets the list of groups or organizations currently registered in the system. This
method should be implemented by classes derived of Reporter
.
- Source
- When fulfilled, an array of group data is returned as a result
- Type:
- external:Promise
getInfo() → {module:report/Reporter.ReporterInfo}
Returns the info
element associated to this Reporter.
- Source
getProperty(key, +) → {string}
Gets a specific property from this reporting system
Name | Type | Description |
---|---|---|
key | string | Requested property |
+ | string | defaultValue - Default return value when requested property does not exist |
- Source
- Type:
- string
getUserData(_userId) → {external:Promise}
Gets extended data associated with a specific user. This is a method intended to be
implemented in subclasses.
Name | Type | Description |
---|---|---|
_userId | string | The requested user ID |
- Source
- When fulfilled, an object with user data is returned.
- Type:
- external:Promise
getUsers(+) → {external:Promise}
Gets the list of users currently registered in the system, optionally filtered by
a specific group ID. This method should be implemented by classes derived of Reporter
.
Name | Type | Description |
---|---|---|
+ | string | groupId - Optional group ID to be used as a filter criteria |
- Source
- When fulfilled, an object with a collection of user data records
is returned
- Type:
- external:Promise
init(optionsopt) → {external:Promise}
Initializes this report system with an optional set of parameters.
Returns a Promise, fulfilled when the reporter is fully initialized.
Name | Type | Attributes | Description |
---|---|---|---|
options | object | <optional> | Initial settings passed to the reporting system |
- Source
- Type:
- external:Promise
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 reporter acts as a target of the action (usually in pairings) |
ok | boolean |
|
- Source
newActivity(act)
This method should be invoked when the user starts a new activity
Name | Type | Description |
---|---|---|
act | module:Activity. | The |
- Source
newGroup(_gd)
Creates a new group (method to be implemented in subclasses)
Name | Type | Description |
---|---|---|
_gd | object |
- Source
newSequence(ase)
This method should be invoked when a new sequence starts
Name | Type | Description |
---|---|---|
ase | module:bags/ActivitySequenceElement. | The |
- Source
newSession(jcp)
This method should be invoked when a new session starts.
Name | Type | Description |
---|---|---|
jcp | module:project/JClicProject. | The |
- Source
newUser(_ud)
Creates a new user (method to be implemented in subclasses)
Name | Type | Description |
---|---|---|
_ud | object |
- Source
promptForNewGroup() → {external:Promise}
Allows the current user to create a new group, and asks his name
- Source
- When fulfilled, the chosen name for the new group is returned.
- Type:
- external:Promise
promptForNewUser() → {external:Promise}
Allows the current user to create a new user ID, and asks his ID and password
- Source
- When fulfilled, an object with the new user ID and password
is returned.
- Type:
- external:Promise
promptGroupId() → {external:Promise}
Allows the current user to select its group or organization from the current groups list
- Source
- Type:
- external:Promise
promptUserId(+) → {external:Promise}
Asks for a valid user ID fulfilling the promise if found, rejecting it otherwise
Name | Type | Description |
---|---|---|
+ | boolean | forcePrompt - Prompt also if |
- Source
- Type:
- external:Promise
userBased() → {boolean}
Checks if this reporting system manages its own database of users and groups. Defaults to false
- Source
- Type:
- boolean
(static) getReporter(className, ps) → {module:report/Reporter.Reporter}
Creates a new Reporter of the requested class
The resulting object must be prepared to operate with a call to its init
method.
Name | Type | Description |
---|---|---|
className | string | Class name of the requested reporter. When |
ps | module:JClicPlayer. | The |
- Source
(static) registerClass(reporterName, reporterClass) → {module:report/Reporter.Reporter}
Registers a new type of reporter
Name | Type | Description |
---|---|---|
reporterName | string | The name used to identify this reporter |
reporterClass | function | The reporter class, usually extending Reporter |
- Source
- The provided reporter class