Skip to content

Instantly share code, notes, and snippets.

@arsduo
Created September 24, 2018 00:52
Show Gist options
  • Save arsduo/2f0bc9b32df4ff7323ce3a98d631edcb to your computer and use it in GitHub Desktop.
Save arsduo/2f0bc9b32df4ff7323ce3a98d631edcb to your computer and use it in GitHub Desktop.
Event Logging in Javascript
playVideo() {
this.videoPlayer.play()
// eventLogger calls out to the server, which adds data about the
// user, their device, their school, etc. etc. etc.
eventLogger.log(“Student started video”, {
videoId: this.videoPlayer.videoId
})
}
selectQuizAnswer(questionId, answerId) {
updateQuestionState(questionId, answerId).then(() => {
eventLogger.log(“Student chose quiz answer”, {
questionId: questionId,
activityId: activityId
});
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment