diff --git a/src/controller.py b/src/controller.py index 29a96bf..c6aad40 100644 --- a/src/controller.py +++ b/src/controller.py @@ -62,6 +62,15 @@ 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('/') @@ -69,9 +78,9 @@ def get(self, hunt_id): 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, diff --git a/src/templates/hunt.html b/src/templates/hunt.html index 0470776..147dde1 100644 --- a/src/templates/hunt.html +++ b/src/templates/hunt.html @@ -29,7 +29,7 @@

Hunt has started!

{% for answer_set in answer_sets %} {{ answer_set.question }} {% for answer in answer_set.answers %} - {% if answer %}X{% endif %} + {{ answer }} {% endfor %} {% endfor %}