-
Notifications
You must be signed in to change notification settings - Fork 1
/
trivia-example.py
51 lines (49 loc) · 1.23 KB
/
trivia-example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# trivia data for the red-green game, to be imported by rg.cgi
# each question has a key that is the question number
# and value that is a list with the question and answer data
# that is: tdata[qnum][0] = question text
# tdata[qnum][1] = green answer
# tdata[qnum][2] = red answer
# tdata[qnum][3] = both answer
# tdata[qnum][4] = answer code
# tdata[qnum][5] = answer text
# the question text and answer text may include format
# strings to reference images, like so: %(image_url)s
tdata = {
1: [
"""
[Warmup question] What is the main benefit of Open Source?
""",
"freedom",
"free price",
"",
"green",
"""
Open Source provides freedom for users and developers.
"""
],
2: [
"""
What is the the airspeed velocity of an unladen swallow?
""",
"26 mph",
"I don't know that!",
"",
"red|green",
"""
Either answer is OK.
"""
],
99: [ """
question
""",
"green answer",
"red answer",
"",
"answer_code [green, red, both]",
"""
answer_text
<img src="%(image_url)s/foo.jpg" height="64">
"""
],
}