Add survey category

This commit is contained in:
Neale Pickett 2009-10-01 13:52:34 -06:00
parent da11d73276
commit 35725ee3e5
4 changed files with 59 additions and 0 deletions

View File

@ -16,6 +16,7 @@ all: ctf.tce
target: $(PYC)
$(INSTALL) -d --mode=0755 --owner=100 $(DESTDIR)/var/lib/ctf
$(INSTALL) -d $(DESTDIR)/var/lib/ctf/disabled
touch $(DESTDIR)/var/lib/ctf/disabled/survey
$(INSTALL) -d $(CTFDIR)
$(INSTALL) $(PYC) $(CTFDIR)

View File

@ -0,0 +1,41 @@
<p>
Thanks for playing Capture The Flag! We would like to know what you
think of the game; please fill out this survey and you will
recieve a key redeemable for <b>ONE MILLION POINTS</b>.
</p>
<fieldset>
<legend>Survey</legend>
<form method="post" action="submit.cgi">
<ul>
<li>
Did you have any trouble figuring out how to play?
<select name="getting-started">
<option>A lot of trouble</option>
<option selected="selected">Not much trouble</option>
<option>No trouble</option>
</select>
</li>
<li>
How difficult were the puzzles?
<select name="puzzle-strength">
<option>Too hard</option>
<option selected="selected">About right</option>
<option>Too easy</option>
</select>
</li>
</ul>
<p>
Please use the provided space for any additional comments.
</p>
<textarea name="comments" style="height: 5em; width: 40em;"></textarea>
<p>
Thanks for your feedback! We hope you had fun and learned
something!
</p>
<input type="submit" name="submit" value="Submit survey" />
</form>
</fieldset>

View File

@ -0,0 +1 @@
quux blorb frotz

View File

@ -0,0 +1,16 @@
#! /usr/bin/env python3
import cgi
f = cgi.FieldStorage()
if f.getfirst('submit'):
print('Content-type: text/plain')
print()
print('Thanks for filling in the survey.')
print()
print('The key is:')
print(' quux blorb frotz')
else:
print('Content-type: text/plain')
print()
print('You need to actually fill in the form to get the key.')