mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 08:50:58 -05:00
Added replays to the campaign editor level analytics drilldowns for particular sessions.
This commit is contained in:
parent
b42061e0ee
commit
8f996a44b0
2 changed files with 10 additions and 0 deletions
|
@ -59,6 +59,7 @@
|
|||
td Playtime
|
||||
td Complete
|
||||
td Changed
|
||||
td Replay
|
||||
tbody
|
||||
- for (var i = 0; i < analytics.recentSessions.data.length; i++)
|
||||
tr.recent-session(data-player-id=analytics.recentSessions.data[i].creator, data-session-id=analytics.recentSessions.data[i]._id)
|
||||
|
@ -71,6 +72,9 @@
|
|||
else
|
||||
td false
|
||||
td= analytics.recentSessions.data[i].changed
|
||||
td
|
||||
button.btn.replay-button.btn-xs
|
||||
.glyphicon.glyphicon-eye-open
|
||||
|
||||
h4 Completion Rates
|
||||
if analytics.levelCompletions.loading
|
||||
|
|
|
@ -16,6 +16,7 @@ module.exports = class CampaignLevelView extends CocoView
|
|||
'dblclick .recent-session': 'onDblClickRecentSession'
|
||||
'mouseenter .graph-point': 'onMouseEnterPoint'
|
||||
'mouseleave .graph-point': 'onMouseLeavePoint'
|
||||
'click .replay-button': 'onClickReplay'
|
||||
|
||||
constructor: (options, @level) ->
|
||||
super(options)
|
||||
|
@ -77,6 +78,11 @@ module.exports = class CampaignLevelView extends CocoView
|
|||
pointID = $(e.target).data('pointid')
|
||||
@$el.find(".graph-point-info-container[data-pointid=#{pointID}]").hide()
|
||||
|
||||
onClickReplay: (e) ->
|
||||
sessionID = $(e.target).closest('tr').data 'session-id'
|
||||
url = "/play/level/#{@level.get('slug')}?session=#{sessionID}&observing=true"
|
||||
window.open url, '_blank'
|
||||
|
||||
updateAnalyticsGraphData: ->
|
||||
# console.log 'updateAnalyticsGraphData'
|
||||
# Build graphs based on available @analytics data
|
||||
|
|
Loading…
Reference in a new issue