From 2393165d9a405285ba81597dc25f9a0bbb6fe31f Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Thu, 20 Nov 2014 21:57:47 -0800 Subject: [PATCH] Turned off some completed A/B tests. Fixed an achievement recalculation typo Scott found. --- app/models/User.coffee | 36 ------------------- app/views/play/WorldMapView.coffee | 58 +++++++++--------------------- server/plugins/achievements.coffee | 2 +- 3 files changed, 17 insertions(+), 79 deletions(-) diff --git a/app/models/User.coffee b/app/models/User.coffee index cd571a9b6..526c0c752 100644 --- a/app/models/User.coffee +++ b/app/models/User.coffee @@ -118,40 +118,4 @@ module.exports = class User extends CocoModel application.tracker.identify castButtonTextGroup: @castButtonTextGroup @castButtonTextGroup - getDirectFirstGroup: -> - # Group -1 is not participating - # Group 0 is original behavior - # Group 1 goes directly to first level if new user - # Targetting users with testGroupNumber < 128 - unless @directFirstGroup? - if me.isAdmin() or me.get('testGroupNumber') >= 128 - @directFirstGroup = -1 - else - @directFirstGroup = me.get('testGroupNumber') % 2 - application.tracker.identify directFirstGroup: @directFirstGroup - @directFirstGroup - - ## Test complete; feel free to repurpose for another test. - # https://mixpanel.com/report/227350/segmentation/#action:segment,arb_event:'Saw%20Victory',bool_op:and,chart_type:bar,from_date:-17,segfilter:!((filter:(operand:!('Dungeons%20of%20Kithgard'),operator:%3D%3D),property:level,selected_property_type:string,type:string),(filter:(operand:'',operator:set),property:highlightArrowGroup,selected_property_type:string,type:string),(property:highlightArrowGroup,selected_property_type:string,type:string)),segment_type:string,to_date:0,type:unique,unit:day - # https://www.dropbox.com/s/jot1ikz7nk7jti5/Screenshot%202014-11-18%2008.04.00.png?dl=0 - #getHighlightArrowSoundGroup: -> - # return @highlightArrowGroup if @highlightArrowGroup - # group = me.get('testGroupNumber') % 8 - # @highlightArrowGroup = switch group - # when 0, 1, 2, 3 then 'sound-off' - # when 4, 5, 6, 7 then 'sound-on' - # @highlightArrowGroup = 'sound-off' if me.isAdmin() - # application.tracker.identify highlightArrowGroup: @highlightArrowGroup unless me.isAdmin() - # @highlightArrowGroup - - getKithmazeGroup: -> - return @kithmazeGroup if @kithmazeGroup - group = me.get('testGroupNumber') % 16 - @kithmazeGroup = switch group - when 0, 1, 2, 3, 4, 5, 6, 7 then 'the-first-kithmaze' - when 8, 9, 10, 11, 12, 13, 14, 15 then 'haunted-kithmaze' - @kithmazeGroup = 'haunted-kithmaze' if me.isAdmin() - application.tracker.identify kithmazeGroup: @kithmazeGroup unless me.isAdmin() - @kithmazeGroup - tiersByLevel = [-1, 0, 0.05, 0.14, 0.18, 0.32, 0.41, 0.5, 0.64, 0.82, 0.91, 1.04, 1.22, 1.35, 1.48, 1.65, 1.78, 1.96, 2.1, 2.24, 2.38, 2.55, 2.69, 2.86, 3.03, 3.16, 3.29, 3.42, 3.58, 3.74, 3.89, 4.04, 4.19, 4.32, 4.47, 4.64, 4.79, 4.96] diff --git a/app/views/play/WorldMapView.coffee b/app/views/play/WorldMapView.coffee index 39070135b..f53d0af2c 100644 --- a/app/views/play/WorldMapView.coffee +++ b/app/views/play/WorldMapView.coffee @@ -89,7 +89,7 @@ module.exports = class WorldMapView extends RootView level.x ?= 10 + 80 * Math.random() level.y ?= 10 + 80 * Math.random() level.locked = index > 0 and not me.ownsLevel level.original - window.levelUnlocksNotWorking = true if level.locked and (level.id is @nextLevel or (level.id is 'haunted-kithmaze' and @nextLevel is 'the-first-kithmaze')) # Temporary + window.levelUnlocksNotWorking = true if level.locked and level.id is @nextLevel # Temporary level.locked = false if window.levelUnlocksNotWorking # Temporary; also possible in HeroVictoryModal level.locked = false if @levelStatusMap[level.id] in ['started', 'complete'] level.disabled = false if @levelStatusMap[level.id] in ['started', 'complete'] @@ -113,7 +113,7 @@ module.exports = class WorldMapView extends RootView @$el.find('.level').tooltip() @$el.addClass _.string.slugify @terrain @updateVolume() - unless window.currentModal or @ABTestSkipHighlight or not @supermodel.finished() + unless window.currentModal or not @supermodel.finished() @highlightElement '.level.next', delay: 500, duration: 60000, rotation: 0, sides: ['top'] if levelID = @$el.find('.level.next').data('level-id') @$levelInfo = @$el.find(".level-info-container[data-level-id=#{levelID}]").show() @@ -138,25 +138,6 @@ module.exports = class WorldMapView extends RootView if @nextLevel and @levelStatusMap[@nextLevel] is 'complete' @nextLevel = null @render() - @initABTestAutoFirstLevel() - - initABTestAutoFirstLevel: -> - # A/B testing directly navigating to first level - # Excluding admins and users who have already started - # TODO: Cleanup @afterRender when this test is finished - firstLevelID = 'dungeons-of-kithgard' - testGroup = me.getDirectFirstGroup() - unless @nextLevel? or (firstLevelID of @levelStatusMap) or testGroup is -1 - @ABTestSkipHighlight = testGroup is 1 - if testGroup is 1 - target = $("a[data-level-id='" + firstLevelID + "']") - return if $(target).attr('disabled') or $(target).parent().hasClass 'locked' - levelElement = $(target).parents('.level') - levelID = levelElement.data('level-id') - @startLevel levelElement - window.tracker?.trackEvent 'World Map', levelID: firstLevelID, directFirstGroup: testGroup, ['Google Analytics'] - else - @ABTestSkipHighlight = false onClickMap: (e) -> @$levelInfo?.hide() @@ -425,21 +406,21 @@ dungeon = [ x: 85 y: 20 nextLevels: - continue: 'the-first-kithmaze' - } - { - name: 'The First Kithmaze' - type: 'hero' - id: 'the-first-kithmaze' - original: '5418b9d64c16460000ab9ab4' - description: 'The builders of Kithgard constructed many mazes to confuse travelers.' - x: 78 - y: 29 - nextLevels: - more_practice: 'descending-further' - continue: 'the-second-kithmaze' - skip_ahead: 'dread-door' + continue: 'haunted-kithmaze' } + #{ + # name: 'The First Kithmaze' + # type: 'hero' + # id: 'the-first-kithmaze' + # original: '5418b9d64c16460000ab9ab4' + # description: 'The builders of Kithgard constructed many mazes to confuse travelers.' + # x: 78 + # y: 29 + # nextLevels: + # more_practice: 'descending-further' + # continue: 'the-second-kithmaze' + # skip_ahead: 'dread-door' + #} { name: 'Haunted Kithmaze' type: 'hero' @@ -789,10 +770,3 @@ WorldMapView.campaigns = campaigns = [ {id: 'dungeon', name: 'Dungeon Campaign', levels: dungeon } {id: 'forest', name: 'Forest Campaign', levels: forest } ] - -# A/B testing first kithmaze level: The First Kithmaze vs. Haunted Kithmaze -if me.getKithmazeGroup() is 'the-first-kithmaze' - _.remove dungeon, id: 'haunted-kithmaze' -else - _.remove dungeon, id: 'the-first-kithmaze' - _.find(dungeon, id: 'the-raised-sword').nextLevels.continue = 'haunted-kithmaze' diff --git a/server/plugins/achievements.coffee b/server/plugins/achievements.coffee index c29d25374..6fe26dbb7 100644 --- a/server/plugins/achievements.coffee +++ b/server/plugins/achievements.coffee @@ -52,7 +52,7 @@ AchievablePlugin = (schema, options) -> user: userID achievement: achievement._id.toHexString() achievementName: achievement.get 'name' - earnedRewarsd: achievement.get 'rewards' + earnedRewards: achievement.get 'rewards' worth = achievement.get('worth') ? 10 earnedPoints = 0