Make answer script-fillable

This commit is contained in:
Neale Pickett 2017-10-30 12:16:23 -06:00
parent 6243d05087
commit b37b8a5b31
2 changed files with 4 additions and 1 deletions

View File

@ -165,7 +165,9 @@ you are a fool.
scripts = puzzle.scripts scripts = puzzle.scripts
title = "{} puzzle {}".format(parts[2], parts[3]) title = "{} puzzle {}".format(parts[2], parts[3])
body.write("<h2>Body</h2>") body.write("<h2>Body</h2>")
body.write("<div id='body' style='border: solid 1px silver;'>")
body.write(puzzle.html_body()) body.write(puzzle.html_body())
body.write("</div>")
body.write("<h2>Files</h2>") body.write("<h2>Files</h2>")
body.write("<ul>") body.write("<ul>")
for name,puzzlefile in sorted(puzzle.files.items()): for name,puzzlefile in sorted(puzzle.files.items()):
@ -180,6 +182,7 @@ you are a fool.
visibility=visibility)) visibility=visibility))
body.write("</ul>") body.write("</ul>")
body.write("<h2>Answers</h2>") body.write("<h2>Answers</h2>")
body.write("<p>Input box (for scripts): <input id='answer' name='a'>")
body.write("<ul>") body.write("<ul>")
assert puzzle.answers, 'No answers defined' assert puzzle.answers, 'No answers defined'
for a in puzzle.answers: for a in puzzle.answers:

View File

@ -71,7 +71,7 @@ def generate_html(ziphandle, puzzle, puzzledir, category, points, authors, files
<input type="hidden" name="c" value="{category}"> <input type="hidden" name="c" value="{category}">
<input type="hidden" name="p" value="{points}"> <input type="hidden" name="p" value="{points}">
<div>Team hash:<input name="t" size="8"></div> <div>Team hash:<input name="t" size="8"></div>
<div>Answer:<input name="a" size="20"></div> <div>Answer:<input name="a" id="answer" size="20"></div>
<input type="submit" value="submit"> <input type="submit" value="submit">
</form> </form>
</section> </section>