Class: LogRetriever

LogRetriever

This API can be used for log retrieval of action logs. The action logs are retrieved from a database (the data warehouse of the Go-Lab learning analytics server). The connection to the data base is specified in @link{../config.js}. During the initialization, the logRetriever connects to the database. Usually, the log retrieval is performed from within the LA server through analytics services or agents. The following example can be used to retrieve a list of actors from a certain space (exemplary).

var LogRetriever = require("./LogRetrieval");    //import LogRetrieval.js!
var logRetriever = new LogRetriever();
logRetriever.getActorsForSpace("547f0de4b5012d08f3a1119f",
     function (docs) {
            console.log("actors: ");
            console.log(docs);
      },
     function (msg) {
           console.log("error: " + msg);
      });
See LogRetrieverTester for further example calls.

Constructor

new LogRetriever()

Constructs a plain LogRetriever object. During the initialization, the logRetriever connects to the database. Initialize it with:

var logRetriever = new LogRetriever();
Source:

Methods

getActorsForSpace(spaceId, onSuccess, onError)

This function retrieves all actors from a certain space. The retrieved actors will be passed as an array to the callback.
Parameters:
Name Type Description
spaceId string The Graasp Space ID that is mapped to Activity Streams with the key "provider.id".
onSuccess getLogsCb The callback with the array of documents (param docs) that is called when the query is processed.
onError getLogsErrorCb The error callback when the query could not be performed.
Source:

getLogs(spaceId, actorId, onSuccess, onError)

This function retrieves all action logs of a single user from a certain space. The retrieved logs will be passed to the callback.
Parameters:
Name Type Description
spaceId string The Graasp Space ID that is mapped to Activity Streams with the key "provider.id".
actorId string The Graasp Actor ID that is mapped to Activity Streams with the key "actor.id".
onSuccess getLogsCb The callback with the array of documents (param docs) that is called when the query is processed.
onError getLogsErrorCb The error callback when the query could not be performed.
Source:

getLogsForSpace(spaceId, onSuccess, onError)

This function retrieves all action logs of all actors from a certain space. The retrieved logs will be passed to the callback.
Parameters:
Name Type Description
spaceId string The Graasp Space ID that is mapped to Activity Streams with the key "provider.id".
onSuccess getLogsCb The callback with the array of documents (param docs) that is called when the query is processed.
onError getLogsErrorCb The error callback when the query could not be performed.
Source:

getOmittedPhases(lpm) → {Array.<number>}

Extract omitted phases from a given learning process model.
Parameters:
Name Type Description
lpm learningProcessModelGeneratorService A learning process model (LPM) retrieved by the @link.
Source:
Returns:
An array containing a sequence of phase numbers representing the omitted phases.
Type
Array.<number>

getPhaseSequence(lpm, reEncoding, usePhaseLinks) → {Array.<number>}

Convert a Learning Process Model to a sequence of the phases. This method is for convenience to handle simpler and smaller objects for sequence analysis.
Parameters:
Name Type Description
lpm learningProcessModelGeneratorService A learning process model (LPM) retrieved by the @link.
reEncoding boolean Indicates if there needs to be a re-encoding of the phases (e.g., to be consistent with other codings).
usePhaseLinks boolean Use phase links or all ordered links (incl. app links) from the learning process model.
Source:
Returns:
An array containing a sequence of phase numbers.
Type
Array.<number>

getPhaseVisitsFromLPS(lpm) → {Array.<number>}

Extract visited phases from a given learning process model.
Parameters:
Name Type Description
lpm learningProcessModelGeneratorService A learning process model (LPM) retrieved by the @link.
Source:
Returns:
An array containing a sequence of phase numbers representing the visited phases.
Type
Array.<number>

getTimeInPhases(lpm, phaseSpec) → {Array}

This function extracts the timings in phases from a given learning process model (LPM)
Parameters:
Name Type Description
lpm learningProcessModelGeneratorService a learning process model (LPM) retrieved by the @link.
phaseSpec Array.<number> The phaseSpec is an array of phase encoding for reordering the phases. In the current implementation this is not used.
Source:
Returns:
Ordered timing of phases
Type
Array

retrieveLPMs(spaceId, actorId, onSuccess, onError)

This function retrieves all learning process models (LPMs) from actors from a certain space. The retrieved LPMs will be passed as an array to the callback. The LPMs follow the same structure as required by the "My Learning Process" app and it uses the @link{learningProcessModelGeneratorService}.
Parameters:
Name Type Description
spaceId string The Graasp Space ID that is mapped to Activity Streams with the key "provider.id".
actorId string The Graasp Actor ID that is mapped to Activity Streams with the key "actor.id".
onSuccess getLogsCb The callback with the array of documents (param docs) that is called when the query is processed.
onError getLogsErrorCb The error callback when the query could not be performed.
Source:

retrieveLPMsForSpace(spaceId, actorId, onSuccess, onError)

This function retrieves all learning process models (LPMs) from all space members. The retrieved LPMs will be passed as an array to the callback. The LPMs follow the same structure as required by the "My Learning Process" app and it uses the @link{learningProcessModelGeneratorService}.
Parameters:
Name Type Description
spaceId string The Graasp Space ID that is mapped to Activity Streams with the key "provider.id".
actorId string The Graasp Actor ID that is mapped to Activity Streams with the key "actor.id".
onSuccess getLogsCb The callback with the array of documents (param docs) that is called when the query is processed.
onError getLogsErrorCb The error callback when the query could not be performed.
Source: