Learning Module

Matt Karl edited this page Sep 1, 2015 · 6 revisions

The Learning module is designed to create a dynamically generated API to match an event specification for tracking Learning Analytic events. This makes it easy to implement as well as verify events coming from an application. The Learning modules create handy "tray" which can be use to check event validation when build in debug mode.



In order to use the Learning module, make sure to include the module's JavaScript file within the springroll.json file within your project. The module needs to be included after the core. Notice that learning.css is only added to the librariesDebug list.

"libraries": [
"librariesDebug": [

## Application Plugin

The Captions module options and properties that are added to the Application.


  • learningEvent Event dispatched when a new learning event has been dispatched.

  • @param object data The event data

  • @param string data.game_id The unique game id

  • @param string data.event_id The unique event id

  • @param object data.event_data The data attached to event

  • @param int data.event_data.event_code The code of the event


  • learning (springroll.Learning) The reference to main Learning object.

Default Event Codes

Here's the complete list of Learning Analytics event codes that are mapped to pre-existing methods.

	"2000": "startGame",
	"2010": "endGame",
	"2020": "startRound",
	"2030": "endRound",
	"2040": "startLevel",
	"2050": "endLevel",
	"2060": "startTutorial",
	"2070": "endTutorial",
	"2075": "skipTutorial",
	"2080": "startMovie",
	"2081": "skipMovie",
	"2083": "endMovie",
	"3010": "startInstruction",
	"3110": "endInstruction",
	"3020": "startIncorrectFeedback",
	"3120": "endIncorrectFeedback",
	"3021": "startCorrectFeedback",
	"3121": "endCorrectFeedback",
	"4010": "selectLevel",
	"4020": "selectAnswer",
	"4030": "startDrag",
	"4035": "endDragOutside",
	"4070": "offClick",
	"4080": "dwellTime",
	"4090": "clickHelp",
	"4095": "clickReplay",
	"4100": "submitAnswer"


Custom Named Events

There some some generic named events like event2025. Not all event codes have a baked-in name. If you would like to create a human-readable name for your event, create a specDictionary.json file in your config folder (along side spec.json). See Learning config setup for an example.

Measuring Durations

It's common for many events to ask for the duration of a user or computer initiated event. The Learning module has convenience methods for measuring duration. Check out the methods startTimer, stopTimer, pollTimer, removeTimer. These timer methods keep into account the pause state of the game, so there's no bother needing to worry about that.