What is a Session?
A session is one complete play-through of single scenario. Different modules handle this in different ways, but the main idea is that a session should be the scenario itself; not the process of selecting an experience.
- Lobby — Some modules have a lobby that a user loads into after authentication and returns to after running through a scenario. Time in the lobby should not count towards any session; the session begins when you choose an experience from the lobby, and the session ends when you finish the experience (either by completing it or using a menu option to return to the lobby).
- Front-End Menu — Other modules just have a front end menu, but the concept is the same; the session begins once you have selected the experience from the menu.
Every time a user enters a scenario (whether directly from the login screen, from a lobby, from a front-end menu, or from any other system you have set up), you need to call JoinSession. Similarly, once they have finished a scenario you need to call CompleteSession.
Functions
There are four functions used for manipulating session and data reporting:
-
JoinSession() — used to indicate the start of a session. It also includes information about the module and user.
-
CompleteSession() — used to indicate the end of a session. It also includes information about the user's session, such as length, completion status and score.
-
SendSessionEvent() — used during a session to signal events or report module specific data. This requires nearly a fully described xAPI Statement to be passed in.
-
SendSimpleSessionEvent() — used during a session to signal events or report module specific data. This is a simplified version of SendSessionEvent().