/courses analytics
This commit is contained in:
parent
6d6f6138b1
commit
44cd64e00e
3 changed files with 31 additions and 16 deletions
app
|
@ -22,7 +22,10 @@ module.exports = class CourseInstance extends CocoModel
|
||||||
}
|
}
|
||||||
_.extend options, opts
|
_.extend options, opts
|
||||||
@fetch(options)
|
@fetch(options)
|
||||||
me.get('courseInstances').push(@id) if userID is me.id
|
if userID is me.id
|
||||||
|
unless me.get('courseInstances')
|
||||||
|
me.set('courseInstances', [])
|
||||||
|
me.get('courseInstances').push(@id)
|
||||||
|
|
||||||
removeMember: (userID, opts) ->
|
removeMember: (userID, opts) ->
|
||||||
options = {
|
options = {
|
||||||
|
|
|
@ -22,5 +22,6 @@ module.exports = class ChangeCourseLanguageModal extends ModalView
|
||||||
@onLanguageSettingSaved()
|
@onLanguageSettingSaved()
|
||||||
|
|
||||||
onLanguageSettingSaved: ->
|
onLanguageSettingSaved: ->
|
||||||
|
application.tracker?.trackEvent 'Student changed language', category: 'Courses', label: @chosenLanguage
|
||||||
@trigger('set-language')
|
@trigger('set-language')
|
||||||
@hide()
|
@hide()
|
||||||
|
|
|
@ -68,17 +68,25 @@ module.exports = class CoursesView extends RootView
|
||||||
else
|
else
|
||||||
modal = new ChooseLanguageModal()
|
modal = new ChooseLanguageModal()
|
||||||
@openModalView(modal)
|
@openModalView(modal)
|
||||||
@listenToOnce modal, 'set-language', @startHourOfCodePlay
|
@listenToOnce modal, 'set-language', =>
|
||||||
|
@startHourOfCodePlay()
|
||||||
|
application.tracker?.trackEvent 'Automatic start hour of code play', category: 'Courses', label: 'set language'
|
||||||
|
application.tracker?.trackEvent 'Start New Game', category: 'Courses'
|
||||||
|
|
||||||
onClickLogInButton: ->
|
onClickLogInButton: ->
|
||||||
modal = new StudentLogInModal()
|
modal = new StudentLogInModal()
|
||||||
@openModalView(modal)
|
@openModalView(modal)
|
||||||
modal.on 'want-to-create-account', @openSignUpModal, @
|
modal.on 'want-to-create-account', @openSignUpModal, @
|
||||||
|
application.tracker?.trackEvent 'Started Student Login', category: 'Courses'
|
||||||
|
|
||||||
openSignUpModal: ->
|
openSignUpModal: ->
|
||||||
modal = new StudentSignUpModal({ willPlay: true })
|
modal = new StudentSignUpModal({ willPlay: true })
|
||||||
@openModalView(modal)
|
@openModalView(modal)
|
||||||
modal.once 'click-skip-link', @startHourOfCodePlay, @
|
modal.once 'click-skip-link', (=>
|
||||||
|
@startHourOfCodePlay()
|
||||||
|
application.tracker?.trackEvent 'Automatic start hour of code play', category: 'Courses', label: 'skip link'
|
||||||
|
), @
|
||||||
|
application.tracker?.trackEvent 'Started Student Signup', category: 'Courses'
|
||||||
|
|
||||||
startHourOfCodePlay: ->
|
startHourOfCodePlay: ->
|
||||||
@$('#main-content').hide()
|
@$('#main-content').hide()
|
||||||
|
@ -114,7 +122,7 @@ module.exports = class CoursesView extends RootView
|
||||||
|
|
||||||
onJoinClassroomError: (classroom, jqxhr, options) ->
|
onJoinClassroomError: (classroom, jqxhr, options) ->
|
||||||
@state = null
|
@state = null
|
||||||
application.tracker?.trackEvent 'Failed to join classroom with code', status: jqxhr.status
|
application.tracker?.trackEvent 'Failed to join classroom with code', category: 'Courses', status: jqxhr.status
|
||||||
if jqxhr.status is 422
|
if jqxhr.status is 422
|
||||||
@errorMessage = 'Please enter a code.'
|
@errorMessage = 'Please enter a code.'
|
||||||
else if jqxhr.status is 404
|
else if jqxhr.status is 404
|
||||||
|
@ -125,7 +133,9 @@ module.exports = class CoursesView extends RootView
|
||||||
|
|
||||||
onJoinClassroomSuccess: (newClassroom, jqxhr, options) ->
|
onJoinClassroomSuccess: (newClassroom, jqxhr, options) ->
|
||||||
application.tracker?.trackEvent 'Joined classroom', {
|
application.tracker?.trackEvent 'Joined classroom', {
|
||||||
classroomID: newClassroom.id,
|
category: 'Courses'
|
||||||
|
classCode: @classCode
|
||||||
|
classroomID: newClassroom.id
|
||||||
classroomName: newClassroom.get('name')
|
classroomName: newClassroom.get('name')
|
||||||
ownerID: newClassroom.get('ownerID')
|
ownerID: newClassroom.get('ownerID')
|
||||||
}
|
}
|
||||||
|
@ -153,6 +163,7 @@ module.exports = class CoursesView extends RootView
|
||||||
setTimeout(f, 10)
|
setTimeout(f, 10)
|
||||||
|
|
||||||
onClickChangeLanguageLink: ->
|
onClickChangeLanguageLink: ->
|
||||||
|
application.tracker?.trackEvent 'Student clicked change language', category: 'Courses'
|
||||||
modal = new ChangeCourseLanguageModal()
|
modal = new ChangeCourseLanguageModal()
|
||||||
@openModalView(modal)
|
@openModalView(modal)
|
||||||
modal.once 'hidden', @render, @
|
modal.once 'hidden', @render, @
|
Reference in a new issue