mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-31 07:12:49 -04:00
Remove cast button text A/B test
This commit is contained in:
parent
2151cd6799
commit
fcb098b3aa
3 changed files with 8 additions and 52 deletions
app
models
templates/play/level/tome
views/play/level/tome
|
@ -108,14 +108,4 @@ module.exports = class User extends CocoModel
|
|||
#application.tracker.identify branchingGroup: @branchingGroup unless me.isAdmin() # paused A/B test
|
||||
@branchingGroup
|
||||
|
||||
getCastButtonTextGroup: ->
|
||||
# Group 0 is original behavior
|
||||
unless @castButtonTextGroup?
|
||||
if me.isAdmin()
|
||||
@castButtonTextGroup = 0
|
||||
else
|
||||
@castButtonTextGroup = me.get('testGroupNumber') % 7
|
||||
application.tracker.identify castButtonTextGroup: @castButtonTextGroup
|
||||
@castButtonTextGroup
|
||||
|
||||
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]
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
button.btn.btn-lg.btn-illustrated.cast-button(title=castVerbose)
|
||||
span(data-i18n="play_level.tome_run_button_ran") Ran
|
||||
|
||||
button.btn.btn-lg.btn-illustrated.submit-button(title=castRealTimeVerbose)
|
||||
if testSubmitText != null && testSubmitText.length > 0
|
||||
span= testSubmitText
|
||||
else
|
||||
span(data-i18n="play_level.tome_submit_button") Submit
|
||||
button.btn.btn-lg.btn-illustrated.submit-button(title=castRealTimeVerbose, data-i18n="play_level.tome_submit_button") Submit
|
||||
|
||||
button.btn.btn-lg.btn-illustrated.done-button.secret
|
||||
span(data-i18n="play_level.done") Done
|
||||
|
|
|
@ -28,7 +28,6 @@ module.exports = class CastButtonView extends CocoView
|
|||
@levelID = options.levelID
|
||||
@castShortcut = '⇧↵'
|
||||
@levelOptions = LevelOptions[@options.levelID] ? {}
|
||||
@initButtonTextABTest() unless @levelOptions.hidesRealTimePlayback
|
||||
|
||||
getRenderData: (context={}) ->
|
||||
context = super context
|
||||
|
@ -38,8 +37,6 @@ module.exports = class CastButtonView extends CocoView
|
|||
castRealTimeShortcutVerbose = (if @isMac() then 'Cmd' else 'Ctrl') + '+' + castShortcutVerbose
|
||||
context.castVerbose = castShortcutVerbose + ': ' + $.i18n.t('keyboard_shortcuts.run_code')
|
||||
context.castRealTimeVerbose = castRealTimeShortcutVerbose + ': ' + $.i18n.t('keyboard_shortcuts.run_real_time')
|
||||
# A/B test submit button text
|
||||
context.testSubmitText = @testButtonsText.submit if @testGroup? and @testGroup isnt 0
|
||||
context
|
||||
|
||||
afterRender: ->
|
||||
|
@ -115,19 +112,14 @@ module.exports = class CastButtonView extends CocoView
|
|||
, (castable) =>
|
||||
Backbone.Mediator.publish 'tome:spell-has-changed-significantly-calculation', hasChangedSignificantly: castable
|
||||
@castButton.toggleClass('castable', castable).toggleClass('casting', @casting)
|
||||
|
||||
# A/B testing cast button text for en-US
|
||||
unless @testGroup? and @testGroup isnt 0
|
||||
if @casting
|
||||
castText = $.i18n.t('play_level.tome_cast_button_running')
|
||||
else if castable or true
|
||||
castText = $.i18n.t('play_level.tome_cast_button_run')
|
||||
unless @levelOptions.hidesRunShortcut # Hide for first few.
|
||||
castText += ' ' + @castShortcut
|
||||
else
|
||||
castText = $.i18n.t('play_level.tome_cast_button_ran')
|
||||
if @casting
|
||||
castText = $.i18n.t('play_level.tome_cast_button_running')
|
||||
else if castable or true
|
||||
castText = $.i18n.t('play_level.tome_cast_button_run')
|
||||
unless @levelOptions.hidesRunShortcut # Hide for first few.
|
||||
castText += ' ' + @castShortcut
|
||||
else
|
||||
castText = @testButtonsText.run
|
||||
castText = $.i18n.t('play_level.tome_cast_button_ran')
|
||||
@castButton.text castText
|
||||
#@castButton.prop 'disabled', not castable
|
||||
|
||||
|
@ -147,25 +139,3 @@ module.exports = class CastButtonView extends CocoView
|
|||
|
||||
onLeftRealTimeMultiplayerGame: (e) ->
|
||||
@inRealTimeMultiplayerSession = false
|
||||
|
||||
# https://mixpanel.com/report/227350/segmentation/#action:segment,arb_event:'Saw%20Victory',bool_op:or,chart_type:bar,from_date:-9,segfilter:!((filter:(operand:!('Ogre%20Encampment'),operator:%3D%3D),property:level,selected_property_type:string,type:string),(property:castButtonTextGroup,selected_property_type:number,type:number)),segment_type:number,to_date:0,type:unique,unit:day
|
||||
initButtonTextABTest: ->
|
||||
return if me.isAdmin()
|
||||
return unless $.i18n.lng() is 'en-US'
|
||||
# A/B test buttons text
|
||||
# Only testing 'en-US' for simplicity and it accounts for a significant % of users
|
||||
# Test group 0 is existing behavior
|
||||
# Intentionally leaving out cast shortcut for test groups for simplicity
|
||||
@testGroup = me.getCastButtonTextGroup()
|
||||
@testButtonsText = switch @testGroup
|
||||
when 0 then run: 'Run/Running', submit: 'Submit'
|
||||
when 1 then run: 'Run', submit: 'Submit'
|
||||
when 2 then run: 'Test', submit: 'Submit'
|
||||
when 3 then run: 'Run', submit: 'Continue'
|
||||
when 4 then run: 'Test', submit: 'Continue'
|
||||
when 5 then run: 'Run', submit: 'Finish'
|
||||
when 6 then run: 'Test', submit: 'Finish'
|
||||
application.tracker?.trackEvent 'Cast Button',
|
||||
levelID: @levelID
|
||||
castButtonText: @testButtonsText.run + ' ' + @testButtonsText.submit
|
||||
castButtonTextGroup: @testGroup
|
||||
|
|
Loading…
Add table
Reference in a new issue