       winner = 'tie'
 
     if winner is 'tie'
-      "Wow, du bundet!"
+      "Wow, der ble uafgjort!"
     else if currentPlayerRole() is winner
       "Tillykke, du har vundet!"
     else


# methods

currentPlayerRole = ->
  isChallenger = currentPlayerId() is currentChallenge().challengerId
  isChallengee = currentPlayerId() is currentChallenge().challengeeId

  # check for error
  if isChallenger and isChallengee
    throw new Meteor.Error 500, 'Cannot be challenger and challengee'

  # return the players role
  if isChallenger
    'challenger'
  else if isChallengee
    'challengee'




Template.challenge.helpers
  opponent: ->
    opponent = null
    if currentPlayerRole() is 'challengee'
      opponent = Meteor.users.findOne currentChallenge().challengerId
    else
      opponent = Meteor.users.findOne currentChallenge().challengeeId
    opponent.username

  answered: ->
