from turbot.blocks import (
input_block, section_block, text_block, multi_select_block, checkbox_block
)
-from turbot.hunt import find_hunt_for_hunt_id, hunt_blocks
+from turbot.hunt import (
+ find_hunt_for_hunt_id,
+ hunt_blocks,
+ hunt_puzzles_for_hunt_id
+)
from turbot.puzzle import (
find_puzzle_for_url,
find_puzzle_for_sort_key,
puzzle_blocks,
puzzle_sort_key
)
+from turbot.round import round_quoted_puzzles_titles_answers
import turbot.rot
import turbot.sheets
import turbot.slack
blocks = puzzle_blocks(puzzle, include_rounds=True)
+ # For a meta puzzle, also display the titles and solutions for all
+ # puzzles in the same round.
+ if puzzle['type'] == 'meta':
+ puzzles = hunt_puzzles_for_hunt_id(turb, puzzle['hunt_id'])
+
+ # Drop this puzzle itself from the report
+ puzzles = [p for p in puzzles if p['puzzle_id'] != puzzle['puzzle_id']]
+
+ for round in puzzle.get('rounds', [None]):
+ answers = round_quoted_puzzles_titles_answers(round, puzzles)
+ blocks += [
+ section_block(text_block(
+ "*Feeder solutions from round {}*".format(
+ round if round else "<none>"
+ ))),
+ section_block(text_block(answers))
+ ]
+
requests.post(response_url,
json = {'blocks': blocks},
headers = {'Content-type': 'application/json'}