Permalink
Browse files

Show passes on status page

  • Loading branch information...
1 parent f3de0b3 commit 8acc077d18c1660aca8332e5964783f5570cf5b8 @pedantic-git pedantic-git committed Aug 7, 2011
Showing with 12 additions and 3 deletions.
  1. +11 −2 src/controller.py
  2. +1 −1 src/templates/hunt.html
View
@@ -62,16 +62,25 @@ def post(self):
class ShowHunt(webapp.RequestHandler):
@utils.logged_in
def get(self, hunt_id):
+
+ def answer_letter(t,c):
+ if t.has_clue_left(c):
+ return ' '
+ elif t.correctly_answered(c):
+ return 'X'
+ else:
+ return 'P'
+
hunt = get_hunt_by_id(hunt_id)
if not hunt:
self.redirect('/')
return
answer_sets = []
for clue in hunt.clues:
if hunt.started:
- answers = [not team.has_clue_left(clue) for team in hunt.teams]
+ answers = [answer_letter(team,clue) for team in hunt.teams]
else:
- answers = [False for team in hunt.teams]
+ answers = [' ' for team in hunt.teams]
answer_sets.append({
'question': clue.question,
'answers': answers,
@@ -29,7 +29,7 @@
{% for answer_set in answer_sets %}
<tr><td>{{ answer_set.question }}</td>
{% for answer in answer_set.answers %}
- <td>{% if answer %}X{% endif %}</td>
+ <td>{{ answer }}</td>
{% endfor %}
</tr>
{% endfor %}

0 comments on commit 8acc077

Please sign in to comment.