Conflicts:
	app/templates/play/ladder/ladder.jade
This commit is contained in:
Michael Schmatz 2014-05-19 19:43:47 -07:00
commit d8df61f94b
8 changed files with 58 additions and 26 deletions

View file

@ -680,6 +680,7 @@
fight: "Fight!" fight: "Fight!"
watch_victory: "Watch your victory" watch_victory: "Watch your victory"
defeat_the: "Defeat the" defeat_the: "Defeat the"
tournament_rules: "Tournament Rules"
ladder_prizes: ladder_prizes:
title: "Tournament Prizes" title: "Tournament Prizes"

View file

@ -63,14 +63,6 @@
td td
padding: 1px 2px padding: 1px 2px
tr.stale
opacity: 0.5
tr.win .state-cell
color: #172
tr.loss .state-cell
color: #712
#must-log-in button #must-log-in button
margin-right: 10px margin-right: 10px

View file

@ -26,4 +26,13 @@
fill: #555555 fill: #555555
shape-rendering: crispEdges shape-rendering: crispEdges
tr.fresh
background-color: #39F
tr.stale
opacity: 0.5
tr.win .state-cell
color: #172
tr.loss .state-cell
color: #712

View file

@ -1,4 +1,4 @@
button.btn.btn-success.rank-button button.btn.btn-lg.btn-success.rank-button
span(data-i18n="ladder.rank_no_code").unavailable.secret No New Code to Rank span(data-i18n="ladder.rank_no_code").unavailable.secret No New Code to Rank
span(data-i18n="ladder.rank_my_game").rank.secret Rank My Game! span(data-i18n="ladder.rank_my_game").rank.secret Rank My Game!
span(data-i18n="ladder.rank_submitting").submitting.secret Submitting... span(data-i18n="ladder.rank_submitting").submitting.secret Submitting...

View file

@ -611,45 +611,62 @@ block content
td $50 td $50
.tab-pane.well#rules .tab-pane.well#rules
h1(data-i18n="ladder.rules_remember_to_add_i18n_tags") Tournament Rules h1(data-i18n="ladder.tournament_rules") Tournament Rules
h2 General h2 General
p You don't have to buy anything to participate in the tournament, and trying to pay us won't increase your odds of winning. p You don't have to buy anything to participate in the tournament, and trying to pay us won't increase your odds of winning.
h2 Dates and Times h2 Dates and Times
p The tournament starts on Tuesday 5/20 at 8:30AM and ends on Tuesday 6/10 at 5:30PM PDT. After the tournament finishes, we will check the games manually to prevent duplicate entries and cheating. We will email all the winners within 2 weeks of the end date. p The tournament starts on Tuesday, May 20 at 8:30AM and ends on Tuesday, June 10 at 5:00PM PDT. After the tournament finishes, we will check the games manually to prevent duplicate entries and cheating. We will email all the winners within two weeks of the end date.
h2 Eligilibity h2 Eligilibity
p The tournament is open to anyone over the age of 13. Players are allowed to form teams to compete, but we will only be rewarding submissions, so if a team of 10 wins, they will need to split the prize. p The tournament is open to anyone over the age of 13. Players are allowed to form teams to compete, but we will only be rewarding submissions, so if a team of 10 wins, they will need to split the prize.
p The tournament is NOT open to people who live in countries or states that prohibit participating or receiving a prize in a challenge (these include, but are not limited to Brazil, Quebec, Italy, Cuba, Sudan, Iran, North Korea, and Syria). Organizations involved in putting the tournament together (namely CodeCombat and all of our employees) are excluded from participating/winning prizes. p The tournament is NOT open to people who live in countries or states that prohibit participating or receiving a prize in a challenge (these include, but are not limited to Brazil, Quebec, Italy, Cuba, Sudan, Iran, North Korea, and Syria). Organizations involved in putting the tournament together (namely CodeCombat and all of our employees) are excluded from participating/winning prizes.
h2 Submission Requirements h2 Submission Requirements
p To be eligible to win prizes, players must submit their code to the Greed ladder for ranking AND defeat our default AI. Every player that submits their code to the ladder and beats our default AI will receive $50 in AWS credits as described on the p
a(href="#prizes", data-toggle="tab", data-i18n="ladder.prizes") prizes page. | To be eligible to win prizes, players must submit their code to the Greed ladder for ranking AND defeat our default AI. Every player that submits their code to the ladder and beats our default AI will receive $50 in AWS credits as described on the
a(href="#prizes", data-i18n="ladder_prizes.tournament_prizes") Tournament Prizes
| page.
p There are some restrictions regarding who can use the AWS credits, please see the additional rules of use on p
| There are some restrictions regarding who can use the AWS credits. Please see the additional rules of use on
a(href="https://aws.amazon.com/awscredits") Amazon's AWS credits page. a(href="https://aws.amazon.com/awscredits") Amazon's AWS credits page.
h2 Submission Rights h2 Submission Rights
p We reserve the right to use your submission and site identity (including username, avatar, and any information you mark as public) to promote the tournament. This is in keeping with our overall site terms of service. p We reserve the right to use your submission and site identity (including username, avatar, and any information you mark as public) to promote the tournament. This is in keeping with our overall site terms of service.
h2 Judging Criteria h2 Judging Criteria
p We will calculate final rankings by running the top 150 games on the public leaderboard from both sides against each other and sorting solutions by wins and losses. The final ranking will be performed with a snapshot of solutions taken the end of the contest. The final ranking methedology is subject to change. We will not be evaluating code in any manual way for common traits like adequate documentation, cleanliness, etc. The public leaderboards are a good proxy for your final rank, but are not guaranteed to be accurate. Your leaderboard rank will change as players submit more solutions. We reserve the right to disqualify any player for any reason. p
h2 Prizes | We will calculate final rankings by running the top games from the public leaderboard from both teams against each other and sorting solutions by wins and losses. The number of games from each side to be used in the final ranking is yet to be determined, but is probably around 150. The final ranking will be performed with a snapshot of solutions taken the end of the contest. The final ranking methedology is subject to change. We will not be evaluating code in any manual way for common traits like adequate documentation, cleanliness, etc. We reserve the right to disqualify any player for any reason. The public leaderboards are a good proxy for your final rank, but are not guaranteed to be accurate. To repeat,
p Prizes will be awarded to everyone that achieves a rank covered on the strong the leaderboards are only a preliminary proxy for your final rank
a(href="#prizes", data-toggle="tab", data-i18n="ladder.prizes") prizes page. | .
p Please remember that the player ranks listed on the prize page refer to ranks WITHIN a leaderboard. So if you are #2 on the Ogre leaderboard, you will get the #2 prize. Similarly, if you are #3 on the Human leaderboard, you will receive the #3 prize. As mentioned above, if you had a submission in the top 10 for both boards, we will only count your highest submission for the purposes of distributing prizes. p
| Your rank will change as players submit more solutions and more matches are played according to
a(href="https://github.com/codecombat/bayesian-battle") our open-source ranking library, Bayesian Battle
| , but our final ranking will use an exhaustive pairwise matching round amongst the top players as described above.
h2 Prizes
p
| Prizes will be awarded to everyone that achieves a rank covered on the
a(href="#prizes", data-i18n="ladder.prizes") Tournament Prizes
| page.
p Please remember that the player ranks listed on the prize page refer to ranks WITHIN a leaderboard. So if you are the #2 Ogre player, you will win the #2 prize. Similarly, if you are the #3 Human player, you will receive the #3 prize. If you have submissions on both leaderboards, we will only count your highest submission for the purposes of distributing prizes. As a result, your final ranking may be higher than your preliminary ranking due to removing duplicate submissions above you.
h2 Verifying Potential Winners h2 Verifying Potential Winners
p We may ask players to identify themselves so that we can detect duplicate entries. This may be done in the form of a Facebook, Google+, or LinkedIn profile, but we may need more information. All players eligible for prizes agree that refusing to provide us with identifying information may lead to removal from the tournament. p We may ask players to identify themselves so that we can detect duplicate entries. This may be done in the form of a Facebook, Google+, or LinkedIn profile, but we may need more information. All players eligible for prizes agree that refusing to provide us with identifying information may lead to ineligibility for prizes.
p On a related note, if we have reason to believe that a player has intentionally submitted duplicate entries for the purpose of receiving more prizes or manipulating the leaderboards in any way, we will remove that player and all submissions we believe to be associated with them. We want this to be fair for everyone. p On a related note, if we have reason to believe that a player has intentionally submitted duplicate entries for the purpose of receiving more prizes or manipulating the leaderboards in any way, we will remove that player and all submissions we believe to be associated with them. We want this to be fair for everyone.
h2 Prize Distribution h2 Prize Distribution
p Different sponsors require different ways of claiming their prizes, and we will work with winners to ensure they are able to redeem their prizes in a timely fashion. For cash prizes, we will deliver the money via Paypal. We will not ship checks, money orders, or cash through the mail. We will assume reasonable international money transfer costs to deliver cash prizes through Paypal. p Different sponsors require different ways of claiming their prizes, and we will work with winners to ensure they are able to redeem their prizes in a timely fashion. For cash prizes, we will deliver the money via PayPal. We will not ship checks, money orders, or cash through the mail. We will assume reasonable international money transfer costs to deliver cash prizes through Paypal.
p Winners are responsible for any taxes associated with claiming their prizes. CodeCombat is not responsible for filing paperwork on behalf of winners for tax claims. p Winners are responsible for any taxes associated with claiming their prizes. CodeCombat is not responsible for filing paperwork on behalf of winners for tax claims.
h2 Contact h2 Contact
p If you have any questions or would like to get in touch with us for any other reason, we can be reached at team@codecombat.com. You can also post to our public p
a(href="http://discourse.codecombat.com/") Discourse forum. | If you have any questions or would like to get in touch with us for any other reason, we can be reached at team@codecombat.com. You can also post to our public
a(href="http://discourse.codecombat.com/") Discourse forum
| .

View file

@ -30,7 +30,7 @@ div#columns.row
th(data-i18n="general.when") When th(data-i18n="general.when") When
th th
for match in team.matches for match in team.matches
tr(class=(match.stale ? "stale " : "") + match.state) tr(class=(match.stale ? "stale " : "") + (match.fresh ? "fresh " : "") + match.state)
td.state-cell td.state-cell
if match.state === 'win' if match.state === 'win'
span(data-i18n="general.win").win Win span(data-i18n="general.win").win Win

View file

@ -102,6 +102,8 @@ module.exports = class LadderView extends RootView
@showApologeticSignupModal() @showApologeticSignupModal()
if link and /#rules$/.test link if link and /#rules$/.test link
@$el.find('a[href="#rules"]').tab('show') @$el.find('a[href="#rules"]').tab('show')
if link and /#prizes/.test link
@$el.find('a[href="#prizes"]').tab('show')
destroy: -> destroy: ->
clearInterval @refreshInterval clearInterval @refreshInterval

View file

@ -13,6 +13,7 @@ module.exports = class MyMatchesTabView extends CocoView
constructor: (options, @level, @sessions) -> constructor: (options, @level, @sessions) ->
super(options) super(options)
@nameMap = {} @nameMap = {}
@previouslyRankingTeams = {}
@refreshMatches() @refreshMatches()
refreshMatches: -> refreshMatches: ->
@ -58,6 +59,9 @@ module.exports = class MyMatchesTabView extends CocoView
state = 'win' state = 'win'
state = 'loss' if match.metrics.rank > opponent.metrics.rank state = 'loss' if match.metrics.rank > opponent.metrics.rank
state = 'tie' if match.metrics.rank is opponent.metrics.rank state = 'tie' if match.metrics.rank is opponent.metrics.rank
fresh = match.date > (new Date(new Date() - 20 * 1000)).toISOString()
if fresh
Backbone.Mediator.publish 'play-sound', trigger: 'chat_received'
{ {
state: state state: state
opponentName: @nameMap[opponent.userID] opponentName: @nameMap[opponent.userID]
@ -65,6 +69,7 @@ module.exports = class MyMatchesTabView extends CocoView
when: moment(match.date).fromNow() when: moment(match.date).fromNow()
sessionID: opponent.sessionID sessionID: opponent.sessionID
stale: match.date < submitDate stale: match.date < submitDate
fresh: fresh
} }
for team in @teams for team in @teams
@ -81,6 +86,10 @@ module.exports = class MyMatchesTabView extends CocoView
if scoreHistory?.length > 1 if scoreHistory?.length > 1
team.scoreHistory = scoreHistory team.scoreHistory = scoreHistory
if not team.isRanking and @previouslyRankingTeams[team.id]
Backbone.Mediator.publish 'play-sound', trigger: 'cast-end'
@previouslyRankingTeams[team.id] = team.isRanking
ctx ctx
afterRender: -> afterRender: ->
@ -91,13 +100,15 @@ module.exports = class MyMatchesTabView extends CocoView
session = _.find @sessions.models, {id: sessionID} session = _.find @sessions.models, {id: sessionID}
ladderSubmissionView = new LadderSubmissionView session: session, level: @level ladderSubmissionView = new LadderSubmissionView session: session, level: @level
@insertSubView ladderSubmissionView, placeholder @insertSubView ladderSubmissionView, placeholder
ladderSubmissionView.$el.find('.rank-button').addClass 'btn-block btn-lg' ladderSubmissionView.$el.find('.rank-button').addClass 'btn-block'
@$el.find('.score-chart-wrapper').each (i, el) => @$el.find('.score-chart-wrapper').each (i, el) =>
scoreWrapper = $(el) scoreWrapper = $(el)
team = _.find @teams, name: scoreWrapper.data('team-name') team = _.find @teams, name: scoreWrapper.data('team-name')
@generateScoreLineChart(scoreWrapper.attr('id'), team.scoreHistory, team.name) @generateScoreLineChart(scoreWrapper.attr('id'), team.scoreHistory, team.name)
@$el.find('tr.fresh').removeClass('fresh', 5000)
generateScoreLineChart: (wrapperID, scoreHistory,teamName) => generateScoreLineChart: (wrapperID, scoreHistory,teamName) =>
margin = margin =
top: 20 top: 20