Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Show table of clues and team answers

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
  • Loading branch information...
commit 8a4a21066c90a65aab06967ccd5c6e9c3a804868 1 parent 4ca1b96
@stefanha stefanha authored
Showing with 30 additions and 2 deletions.
  1. +12 −1 src/controller.py
  2. +18 −1 src/templates/hunt.html
View
13 src/controller.py
@@ -66,7 +66,18 @@ def get(self, hunt_id):
if not hunt:
self.redirect('/')
return
- self.response.out.write(utils.render('templates/hunt.html', {'hunt': hunt}))
+ answer_sets = []
+ for clue in hunt.clues:
+ if hunt.started:
+ answers = [not team.has_clue_left(clue) for team in hunt.teams]
+ else:
+ answers = [False for team in hunt.teams]
+ answer_sets.append({
+ 'question': clue.question,
+ 'answers': answers,
+ })
+ logging.debug('ShowHunt answer_sets: %s' % answer_sets)
+ self.response.out.write(utils.render('templates/hunt.html', {'hunt': hunt, 'answer_sets': answer_sets}))
@utils.logged_in
def post(self, hunt_id):
View
19 src/templates/hunt.html
@@ -20,7 +20,24 @@
<input type="submit" value="Start hunt" />
</form>
{% endif %}
- <p>TODO: teams and clue completion status table</p>
+ <div>
+ <a href="/hunt/{{ hunt.key.id }}/clues">Clues</a>
+ <a href="/hunt/{{ hunt.key.id }}/teams">Teams</a>
+ </div>
+ <table>
+ <tr><th>Question/Team</th>
+ {% for team in hunt.teams %}
+ <th>{{ team.name }}</th>
+ {% endfor %}
+ </tr>
+ {% for answer_set in answer_sets %}
+ <tr><td>{{ answer_set.question }}</td>
+ {% for answer in answer_set.answers %}
+ <td>{% if answer %}X{% endif %}</td>
+ {% endfor %}
+ </tr>
+ {% endfor %}
+ </table>
</div>
</div>
</body>
Please sign in to comment.
Something went wrong with that request. Please try again.