\n']
expanding = []
@@ -183,7 +189,7 @@ def overview(hunt, puzzles, rounds):
expanding += [
'
\n'.format(i, status),
'
x \n',
- '
{} \n'.format(link(website + filename_from_name(rnd) + "_round.html", rnd)),
+ '
{} \n'.format(link(internal_link(hunt, filename_from_name(rnd)) + "_round.html", rnd)),
'
\n',
' \n',
' Puzzle \n',
@@ -197,12 +203,12 @@ def overview(hunt, puzzles, rounds):
meta = ''
if puzzle['status'] == 'solved':
expanding += [' \n',
- ' {} \n'.format(link(website + filename_from_name(puzzle['name']) + ".html", puzzle['name']+meta)),
- ' {} \n'.format(puzzle['solution']),
+ ' {} \n'.format(link(internal_link(hunt, filename_from_name(puzzle['name'])) + ".html", puzzle['name']+meta)),
+ ' {} \n'.format(", ".join(puzzle['solution']).upper()),
' \n']
else:
expanding += [' \n',
- ' {} \n'.format(link(website + filename_from_name(puzzle['name']) + ".html", puzzle['name']+meta)),
+ ' {} \n'.format(link(internal_link(hunt, filename_from_name(puzzle['name'])) + ".html", puzzle['name']+meta)),
' \n',
' \n']
expanding.append('
\n')
@@ -234,10 +240,11 @@ def round_overview(hunt, rnd, puzzles):
'
\n',
'
Mystery Hunt 2022 \n',
' \n',
+ '
\n',
' \n',
' \n'.format(status),
'
{} \n'.format(rnd),
- '
{}
\n'.format(link(website + "index.html", 'Hunt Overview')),
+ '
{}
\n'.format(link(internal_link(hunt, "index") + ".html", 'Hunt Overview')),
'
\n',
'
\n',
' \n',
@@ -265,20 +272,20 @@ def round_overview(hunt, rnd, puzzles):
' {} \n'.format(elink(slack_url, puzzle['name']+meta)),
' {} \n'.format(elink(puzzle.get('url',''), 'Puzzle')),
' {} \n'.format(elink(puzzle['sheet_url'], 'Sheet')),
- ' {} \n'.format(link(website + filename_from_name(puzzle['name']) + '.html', 'Overview')),
- ' {} \n'.format(puzzle['solution']),
+ ' {} \n'.format(link(internal_link(hunt, filename_from_name(puzzle['name'])) + ".html", 'Overview')),
+ ' {} \n'.format(", ".join(puzzle['solution']).upper()),
# ' \n',
- ' {} \n'.format("".join(puzzle.get('tags',[]))),
+ ' {} \n'.format(", ".join(puzzle.get('tags',[]))),
' \n']
else:
puzzle_list += [ ' \n',
' {} \n'.format(elink(slack_url, puzzle['name']+meta)),
' {} \n'.format(elink(puzzle.get('url',''), 'Puzzle')),
' {} \n'.format(elink(puzzle['sheet_url'], 'Sheet')),
- ' {} \n'.format(link(website + filename_from_name(puzzle['name']) + '.html', 'Overview')),
+ ' {} \n'.format(link(internal_link(hunt, filename_from_name(puzzle['name'])) + ".html", 'Overview')),
' \n',
# ' \n',
- ' {} \n'.format(" ".join(puzzle.get('tags',[]))),
+ ' {} \n'.format(", ".join(puzzle.get('tags',[]))),
' \n']
end = [' \n',
'
\n',
@@ -304,11 +311,11 @@ def puzzle_overview(hunt, puzzle):
meta = ''
slack_url = channel_url(puzzle['channel_id'])
if 'rounds' in puzzle:
- round_url = [link(website + filename_from_name(rnd) + "_round.html", rnd) for rnd in puzzle['rounds']]
+ round_url = [link(internal_link(hunt, filename_from_name(rnd)) + "_round.html", rnd) for rnd in puzzle['rounds']]
else:
round_url = ''
if puzzle['status'] == 'solved':
- solution = puzzle['solution']
+ solution = ", ".join(puzzle['solution']).upper()
status = 'solved'
else:
solution = ""
@@ -318,9 +325,10 @@ def puzzle_overview(hunt, puzzle):
'\n',
'
\n',
'
\n',
+ '
\n',
'
\n',
'
{} \n'.format(name+meta),
- '
{}
'.format(link(website + 'index.html', 'Hunt Overview')),
+ '
{}
'.format(link(internal_link(hunt, 'index') + ".html", 'Hunt Overview')),
'\n',
'\n',
'\n'.format(status),
@@ -337,7 +345,7 @@ def puzzle_overview(hunt, puzzle):
'
\n',
' \n',
' Round(s): {} \n'.format(" ".join(round_url)), #round page on our site
- ' Tags: {} \n'.format(" ".join(puzzle.get('tags',[]))), #add tags
+ ' Tags: {} \n'.format(", ".join(puzzle.get('tags',[]))), #add tags
' \n',
' \n',
' Answer: {} \n'.format(solution),
@@ -367,16 +375,18 @@ def puzzle_lists(hunt, puzzles, filt):
' \n',
' Mystery Hunt 2022 \n',
' \n',
+ ' \n',
' \n',
- ' \n'
+ ' \n',
' \n',
' {} \n'.format('{} Puzzles').format(filt),
- ' {}
\n'.format(link(website + "index.html", 'Hunt Overview')),
+ ' {}
\n'.format(link(internal_link(hunt, 'index') + ".html", 'Hunt Overview')),
' \n',
'
\n',
' \n',
@@ -400,7 +410,7 @@ def puzzle_lists(hunt, puzzles, filt):
meta = ''
slack_url = channel_url(puzzle['channel_id'])
if 'rounds' in puzzle:
- round_url = link(website + filename_from_name(puzzle['rounds'][0]) + "_round.html", puzzle['rounds'][0])
+ round_url = link(internal_link(hunt, filename_from_name(puzzle['rounds'][0])) + "_round.html", puzzle['rounds'][0])
else:
round_url = ''
#assuming one round per puzzle for now
@@ -409,10 +419,10 @@ def puzzle_lists(hunt, puzzles, filt):
' {} \n'.format(elink(slack_url, puzzle['name']+meta)),
' {} \n'.format(elink(puzzle.get('url',''), 'Puzzle')),
' {} \n'.format(elink(puzzle['sheet_url'], 'Sheet')),
- ' {} \n'.format(link(website + filename_from_name(puzzle['name']) + '.html', 'Overview')),
- ' {} \n'.format(puzzle['solution']),
+ ' {} \n'.format(link(internal_link(hunt, filename_from_name(puzzle['name'])) + ".html", 'Overview')),
+ ' {} \n'.format(", ".join(puzzle['solution']).upper()),
' {} \n'.format(round_url),
- ' {} \n'.format("".join(puzzle.get('tags',[]))),
+ ' {} \n'.format(", ".join(puzzle.get('tags',[]))),
' \n']
for puzzle in unsolved_puzzles:
if puzzle['type'] == 'meta':
@@ -421,7 +431,7 @@ def puzzle_lists(hunt, puzzles, filt):
meta = ''
slack_url = channel_url(puzzle['channel_id'])
if 'rounds' in puzzle:
- round_url = link(website + filename_from_name(puzzle['rounds'][0]) + "_round.html", puzzle['rounds'][0])
+ round_url = link(internal_link(hunt, filename_from_name(puzzle['rounds'][0])) + "_round.html", puzzle['rounds'][0])
else:
round_url = ''
#assuming one round per puzzle for now
@@ -430,10 +440,10 @@ def puzzle_lists(hunt, puzzles, filt):
' {} \n'.format(elink(slack_url, puzzle['name']+meta)),
' {} \n'.format(elink(puzzle.get('url',''), 'Puzzle')),
' {} \n'.format(elink(puzzle['sheet_url'], 'Sheet')),
- ' {} \n'.format(link(website + filename_from_name(puzzle['name']) + '.html', 'Overview')),
+ ' {} \n'.format(link(internal_link(hunt, filename_from_name(puzzle['name'])) + ".html", 'Overview')),
' \n',
' {} \n'.format(round_url),
- ' {} \n'.format("".join(puzzle.get('tags',[]))),
+ ' {} \n'.format(", ".join(puzzle.get('tags',[]))),
' \n']
end = [' \n',
'
\n',
@@ -477,11 +487,12 @@ def generate_for_hunt_id(table, hunt_id):
overview(hunt, puzzles, rounds)
for rnd in rounds:
round_overview(hunt, rnd, puzzles)
- for puzzle in puzzles:
- puzzle_overview(hunt, puzzle)
- puzzle_lists(hunt, puzzles, "All")
- puzzle_lists(hunt, puzzles, "Solved")
- puzzle_lists(hunt, puzzles, "Unsolved")
+ for puzzle in puzzles:
+ puzzle_overview(hunt, puzzle)
+ puzzle_lists(hunt, puzzles, "All")
+ puzzle_lists(hunt, puzzles, "Solved")
+ puzzle_lists(hunt, puzzles, "Unsolved")
+
# Initialize AWS resources to talk to the database
db = boto3.resource('dynamodb')