mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Classroom details analytics
This commit is contained in:
parent
b21c20c08d
commit
3fb85463fa
3 changed files with 12 additions and 1 deletions
|
@ -11,6 +11,10 @@ module.exports = class AddLevelSystemModal extends ModalView
|
|||
|
||||
initialize: (options) ->
|
||||
@classroom = options.classroom
|
||||
if @classroom
|
||||
application.tracker?.trackEvent 'Classroom started edit settings', category: 'Courses', classroomID: @classroom.id
|
||||
else
|
||||
application.tracker?.trackEvent 'Classroom started edit settings', category: 'Courses'
|
||||
|
||||
onClickSaveSettingsButton: ->
|
||||
name = $('.settings-name-input').val()
|
||||
|
|
|
@ -99,6 +99,7 @@ module.exports = class ClassroomView extends RootView
|
|||
})
|
||||
@openModalView(modal)
|
||||
modal.once 'redeem-users', -> document.location.reload()
|
||||
application.tracker?.trackEvent 'Classroom started enroll students', category: 'Courses'
|
||||
|
||||
onClickActivateSingleLicenseButton: (e) ->
|
||||
userID = $(e.target).data('user-id')
|
||||
|
@ -110,6 +111,7 @@ module.exports = class ClassroomView extends RootView
|
|||
})
|
||||
@openModalView(modal)
|
||||
modal.once 'redeem-users', -> document.location.reload()
|
||||
application.tracker?.trackEvent 'Classroom started enroll student', category: 'Courses', userID: userID
|
||||
|
||||
onClickEditClassDetailsLink: ->
|
||||
modal = new ClassroomSettingsModal({classroom: @classroom})
|
||||
|
@ -149,11 +151,13 @@ module.exports = class ClassroomView extends RootView
|
|||
onClickAddStudentsButton: (e) ->
|
||||
modal = new InviteToClassroomModal({classroom: @classroom})
|
||||
@openModalView(modal)
|
||||
application.tracker?.trackEvent 'Classroom started add students', category: 'Courses', classroomID: @classroom.id
|
||||
|
||||
onClickEnableButton: (e) ->
|
||||
courseInstance = @courseInstances.get($(e.target).data('course-instance-cid'))
|
||||
userID = $(e.target).data('user-id')
|
||||
$(e.target).attr('disabled', true)
|
||||
application.tracker?.trackEvent 'Course assign student', category: 'Courses', courseInstanceID: courseInstance.id, userID: userID
|
||||
|
||||
onCourseInstanceCreated = =>
|
||||
courseInstance.addMember(userID)
|
||||
|
@ -179,6 +183,7 @@ module.exports = class ClassroomView extends RootView
|
|||
onStudentRemoved: (e) ->
|
||||
@users.remove(e.user)
|
||||
@render()
|
||||
application.tracker?.trackEvent 'Classroom removed student', category: 'Courses', courseInstanceID: @courseInstance.id, userID: e.user.id
|
||||
|
||||
levelPopoverContent: (level, session, i) ->
|
||||
return null unless level
|
||||
|
|
|
@ -4,7 +4,7 @@ template = require 'templates/courses/invite-to-classroom-modal'
|
|||
module.exports = class InviteToClassroomModal extends ModalView
|
||||
id: 'invite-to-classroom-modal'
|
||||
template: template
|
||||
|
||||
|
||||
events:
|
||||
'click #send-invites-btn': 'onClickSendInvitesButton'
|
||||
'click #copy-url-btn, #join-url-input': 'copyURL'
|
||||
|
@ -23,6 +23,7 @@ module.exports = class InviteToClassroomModal extends ModalView
|
|||
url = @classroom.url() + '/invite-members'
|
||||
@$('#send-invites-btn, #invite-emails-textarea').addClass('hide')
|
||||
@$('#invite-emails-sending-alert').removeClass('hide')
|
||||
application.tracker?.trackEvent 'Classroom invite via email', category: 'Courses', classroomID: @classroom.id, emails: emails
|
||||
|
||||
$.ajax({
|
||||
url: url
|
||||
|
@ -39,6 +40,7 @@ module.exports = class InviteToClassroomModal extends ModalView
|
|||
try
|
||||
document.execCommand('copy')
|
||||
@$('#copied-alert').removeClass('hide')
|
||||
application.tracker?.trackEvent 'Classroom copy URL', category: 'Courses', classroomID: @classroom.id, url: @joinURL
|
||||
catch err
|
||||
console.log('Oops, unable to copy', err)
|
||||
@$('#copy-failed-alert').removeClass('hide')
|
||||
|
|
Loading…
Reference in a new issue