Skip to content

Commit

Permalink
Various updates for the hunt re-run
Browse files Browse the repository at this point in the history
  • Loading branch information
dlareau committed Sep 22, 2015
1 parent 74049ec commit d33646d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion huntserver/puzzle.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def respond_to_submission(submission):
# Compare against correct answer
if(submission.puzzle.answer.lower() == submission.submission_text.lower()):
# Make sure we don't have duplicate or after hunt submission objects
if(submission.puzzle not in submission.team.solved.all() and submission.puzzle.hunt.is_open):
if(submission.puzzle not in submission.team.solved.all()):# and submission.puzzle.hunt.is_open):
Solve.objects.create(puzzle=submission.puzzle,
team=submission.team, submission=submission)
send_status_update(submission.puzzle, submission.team, "solve")
Expand Down
16 changes: 14 additions & 2 deletions huntserver/templates/hunt1.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,21 @@ <h1 class="title">Unlocked Puzzles</h1>
</div>
<div id='content-right'>
<div id='plot'>
Plot goes here!
Hello Space Cadet(s)!
</br>
{% lorem 2 p %}
<p>
You are part of the emergency response team that has been woken out of cryostasis to help
get the ship back on course.
</p>
<p>
It would seem an engineer had woken up unexpectedly from cryostasis causing him to go crazy. Before he was subdued he had managed to deactivate the engines and change all of the door passwords. He did leave some clues behind in the form of puzzles.
</p>
<p>
Please look over the puzzles he left, use the answers to unlock futher rooms (which we suspect will contain further puzzles), make your way to the engine room and reactivate the engine.
</p>
</br>
Thanks,</br>
Command
</div>
</div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions huntserver/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ def registration(request):
email = form.cleaned_data['email'],
phone = form.cleaned_data['phone'],
comments = "Dietary Restrictions: " + form.cleaned_data['dietary_issues'], team = t)
if(not curr_hunt.is_locked):
unlock_puzzles(t)
return HttpResponse('success')

# Find existing team and add person.
Expand Down Expand Up @@ -174,6 +176,7 @@ def puzzle(request, puzzle_id):
submissions = puzzle.submission_set.filter(team=team).order_by('pk')
form = AnswerForm()
# Directory for puzzle PNGs
# TODO: what do we do if this doesn't exist
directory = "/home/hunt/puzzlehunt_server/huntserver/static/huntserver/puzzles"
file_str = directory + "/" + puzzle.puzzle_id + ".pdf"
# Ideally this should be done some other way to reduce command calls
Expand Down

0 comments on commit d33646d

Please sign in to comment.