add key source to json

This commit is contained in:
Frank Becker 2011-12-17 14:14:28 +01:00
parent 5f492f9716
commit e83b62ae03
6 changed files with 315 additions and 302 deletions

View File

@ -15,21 +15,6 @@
# explanation:
# - videos/question1.webm
--- !Question
question: Who was awarded the Pwnie award this year?
answers:
- true: Sony
- true: Sony
- true: Sony
- true: Sony
tier: 1
game_round: 1
media:
question:
- pix/q_target.png TODO
explanation:
- pix/a_target.jpg TODO
--- !Question
# http://de.wikipedia.org/wiki/Strahlenkrankheit
# Wie gut koennen sich Leute die Fukushima facts merken?
@ -334,6 +319,23 @@ media:
explanation:
- pix/a_hackspace.jpg
--- !Question
question: Who was awarded the Pwnie award this year?
answers:
- true: Sony
- true: Sony
- true: Sony
- true: Sony
tier: 19
game_round: 1
media:
question:
- pix/q_target.png
#TODO
explanation:
- pix/a_target.jpg
#TODO
--- !Question
question: How many female Porn stars have their own WP article?
answers:
@ -732,7 +734,7 @@ answers:
- false: sheep
- false: chicken
- false: dog
tier: 10
tier: 11
game_round: 4
media:
question:

View File

@ -1,11 +1,9 @@
[
{
"tier": 100,
"text": "What is leathal doses of radioactivity that causes death with 100% probability within 14 days after exposition (LD100/14)? (1 Gray (Gy) == 1 Sievert (Sv))",
"explanation": [
"data/pix/a_fukushima.jpg"
],
"image": "data/pix/q_fukushima.jpg",
"answers": [
{
"text": "> 6 mGy"
@ -20,15 +18,16 @@
{
"text": "> 600 Gy"
}
]
],
"source": "",
"tier": 100,
"image": "data/pix/q_fukushima.jpg"
},
{
"tier": 150,
"text": "Why did Saxony (German State) not use the Bundestrojaner (governmental trojan horse)?",
"text": "Why did Saxony (German State) not use the Staatstrojaner (governmental trojan horse)?",
"explanation": [
"data/pix/a_bundestrojaner.jpg"
],
"image": "data/pix/q_bundestrojaner.jpg",
"answers": [
{
"text": "Technically not capable of doing so.",
@ -43,15 +42,16 @@
{
"text": "No crime that requires this measurement."
}
]
],
"source": "",
"tier": 150,
"image": "data/pix/q_bundestrojaner.jpg"
},
{
"tier": 225,
"text": "Which of the following organizations has not yet been blocked by paypal?",
"explanation": [
"data/pix/a_paypal.gif"
],
"image": "data/pix/q_paypal4.jpg",
"answers": [
{
"text": "Wikileaks"
@ -66,15 +66,16 @@
"text": "Ku Klux Klan",
"right": true
}
]
],
"source": "",
"tier": 225,
"image": "data/pix/q_paypal4.jpg"
},
{
"tier": 337,
"text": "How did Russian bloggers try to get attention for their demonstrations against election fraud during the recent elections in russia?",
"explanation": [
"data/pix/a_russian.jpg"
],
"image": "data/pix/q_russian.jpg",
"answers": [
{
"text": "Multi-Million-Rubel-Ad-Campain."
@ -89,16 +90,17 @@
"text": "Use drones to get video footage and stream to the internet.",
"right": true
}
]
],
"source": "",
"tier": 337,
"image": "data/pix/q_russian.jpg"
},
{
"tier": 506,
"text": "Which of the following countries voted against a loosening of cluster munition restrictions at the UN?",
"explanation": [
"data/pix/a_cluster1.jpg",
"data/pix/a_cluster2.jpg"
],
"image": "data/pix/q_cluster.jpg",
"answers": [
{
"text": "Austria",
@ -113,15 +115,16 @@
{
"text": "Pakistan"
}
]
],
"source": "",
"tier": 506,
"image": "data/pix/q_cluster.jpg"
},
{
"tier": 759,
"text": "What is the definition of 1 Uhl?",
"explanation": [
"data/pix/a_uhl.jpg"
],
"image": "data/pix/q_uhl.jpg",
"answers": [
{
"text": "Unit of a scale that describes the need of censorship for a certain website."
@ -136,15 +139,16 @@
{
"text": "Degree of expert knowlege that a politician has, when he demands the wiretapping of encrypted data."
}
]
],
"source": "",
"tier": 759,
"image": "data/pix/q_uhl.jpg"
},
{
"tier": 1139,
"text": "Which new investigation tool did Henrik Kaspersen, one of the founding fathers of the Convention on Cybercrime, demand during its 10th birthday to improve the work against cyber crime?",
"explanation": [
"data/pix/a_cybercrime.jpg"
],
"image": "data/pix/q_cybercrime.png",
"answers": [
{
"text": "Email bombs"
@ -159,15 +163,16 @@
"text": "Bot nets",
"right": true
}
]
],
"source": "",
"tier": 1139,
"image": "data/pix/q_cybercrime.png"
},
{
"tier": 1709,
"text": "How many days in a row has Belgium been run by a caretaker administration since the last government resigned in April 2010?",
"explanation": [
"data/pix/a_belgium.jpg"
],
"image": "data/pix/q_belgium.gif",
"answers": [
{
"text": "415 days"
@ -180,17 +185,18 @@
"text": "451 days"
},
{
"text": "154 days"
"text": "514 days"
}
]
],
"source": "",
"tier": 1709,
"image": "data/pix/q_belgium.gif"
},
{
"tier": 2563,
"text": "How many 1st notifications have been sent during the first 12 months of the French Three-Strikes-Law (Hadopi) being active?",
"explanation": [
"data/pix/q_hadopi.jpg"
],
"image": "data/pix/q_hadopi.png",
"answers": [
{
"text": "~600k",
@ -205,15 +211,16 @@
{
"text": "~6k"
}
]
],
"source": "",
"tier": 2563,
"image": "data/pix/q_hadopi.png"
},
{
"tier": 3844,
"text": "What do you see on the following picture?",
"explanation": [
"data/pix/a_brain.jpg"
],
"image": "data/pix/q_brain.png",
"answers": [
{
"text": "Reconstructed picture from brain activity",
@ -228,15 +235,16 @@
{
"text": "Picture taken with 1st digital camera"
}
]
],
"source": "",
"tier": 3844,
"image": "data/pix/q_brain.png"
},
{
"tier": 5555,
"text": "How many weeks did it take to bring kernel.org back up after it has been hacked in end of August 2011?",
"text": "How many weeks did it take to bring kernel.org back up after they found out that it has been hacked in end of August 2011?",
"explanation": [
"data/pix/a_kernel.jpg"
],
"image": "data/pix/q_kernel.gif",
"answers": [
{
"text": "~ 1 week"
@ -251,15 +259,16 @@
{
"text": "~ 2 weeks"
}
]
],
"source": "",
"tier": 5555,
"image": "data/pix/q_kernel.gif"
},
{
"tier": 7531,
"text": "What was the main purpose of the Virus that infected the US Air Force drone fleet September 2011?",
"explanation": [
"data/pix/a_drone.jpg"
],
"image": "data/pix/q_drone.jpg",
"answers": [
{
"text": "Programming new false targets"
@ -274,18 +283,19 @@
"text": "Looking for facebook game accounts",
"right": true
}
]
],
"source": "",
"tier": 7531,
"image": "data/pix/q_drone.jpg"
},
{
"tier": 0,
"text": "How did the US Airforce cyber security departement learn about the virus infected drones?",
"explanation": [
"data/pix/a_drone2.jpg"
],
"image": "data/pix/q_drone2.jpg",
"answers": [
{
"text": "Advanced intrusion detection mechanisms"
"text": "Intrusion detection mechanisms"
},
{
"text": "Read it in the news",
@ -297,15 +307,16 @@
{
"text": "By random, during standart maintainance"
}
]
],
"source": "",
"tier": 0,
"image": "data/pix/q_drone2.jpg"
},
{
"tier": 0,
"text": "Which of the following terms does not autocomplete anymore in Google search since January 2011?",
"explanation": [
"data/pix/a_autocomplete.jpg"
],
"image": "data/pix/q_autocomplete.jpg",
"answers": [
{
"text": "torrent",
@ -320,15 +331,16 @@
{
"text": "Do no evil"
}
]
],
"source": "",
"tier": 0,
"image": "data/pix/q_autocomplete.jpg"
},
{
"tier": 0,
"text": "Which of the following CAs did not yet publish news about security problems this year?",
"explanation": [
"data/pix/q_ca4.jpg"
],
"image": "data/pix/q_ca4.jpg",
"answers": [
{
"text": "Diginotar"
@ -343,15 +355,16 @@
"text": "T\u00dcRKTRUST",
"right": true
}
]
],
"source": "",
"tier": 0,
"image": "data/pix/q_ca4.jpg"
},
{
"tier": 0,
"text": "What is the new TLD for \"The Republic of South Sudan\"?",
"explanation": [
"data/pix/a_sudan.png"
],
"image": "data/pix/q_sudan.png",
"answers": [
{
"text": ".su"
@ -366,15 +379,16 @@
{
"text": ".rss"
}
]
],
"source": "",
"tier": 0,
"image": "data/pix/q_sudan.png"
},
{
"tier": 0,
"text": "Which of the following companies announced via Twitter that they will tell the Police details about London rioters?",
"explanation": [
"data/pix/a_london.jpg"
],
"image": "data/pix/q_london.jpg",
"answers": [
{
"text": "Cash and Carry (by publishing video footage)"
@ -389,15 +403,16 @@
{
"text": "Virgin (by publishing a list of illegal downloaders)"
}
]
],
"source": "",
"tier": 0,
"image": "data/pix/q_london.jpg"
},
{
"tier": 0,
"text": "Which of the following cities is helping to create 100 new hackerspaces in itself?",
"explanation": [
"data/pix/a_hackspace.jpg"
],
"image": "data/pix/q_hackspace.jpg",
"answers": [
{
"text": "Berlin"
@ -412,6 +427,36 @@
{
"text": "Buenos Aires"
}
]
],
"source": "",
"tier": 0,
"image": "data/pix/q_hackspace.jpg"
},
{
"text": "Who was awarded the Pwnie award this year?",
"explanation": [
"data/pix/a_target.jpg"
],
"answers": [
{
"text": "Sony",
"right": true
},
{
"text": "Sony",
"right": true
},
{
"text": "Sony",
"right": true
},
{
"text": "Sony",
"right": true
}
],
"source": "",
"tier": 0,
"image": "data/pix/q_target.png"
}
]

View File

@ -1,37 +1,9 @@
[
{
"tier": 100,
"text": "Who was awarded the Pwnie award this year?",
"explanation": [
"data/pix/a_target.jpg"
],
"image": "data/pix/q_target.png",
"answers": [
{
"text": "Sony",
"right": true
},
{
"text": "Sony",
"right": true
},
{
"text": "Sony",
"right": true
},
{
"text": "Sony",
"right": true
}
]
},
{
"tier": 150,
"text": "How many female Porn stars have their own WP article?",
"explanation": [
"data/videos/question1.webm"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": 448
@ -46,15 +18,16 @@
{
"text": 623
}
]
],
"source": "",
"tier": 150,
"image": "data/pix/question1.png"
},
{
"tier": 225,
"text": "How many user-related data records (name, address, birth date) did the Saxon State retriev after it cought about > 1 mio cell phone connection records?",
"explanation": [
"data/videos/question1.webm"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": 540
@ -69,15 +42,16 @@
{
"text": "940k"
}
]
],
"source": "",
"tier": 225,
"image": "data/pix/question1.png"
},
{
"tier": 337,
"text": "What did Google do after it received a secret court order to hand over Jacob Applebaums e-mails?",
"explanation": [
"data/videos/question1.webm"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": "hand over the data",
@ -92,15 +66,16 @@
{
"text": "denied his account"
}
]
],
"source": "",
"tier": 337,
"image": "data/pix/question1.png"
},
{
"tier": 506,
"text": "Who controls american drones in Afghanistan part time?",
"explanation": [
"data/videos/question1.webm"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": "Iran Army"
@ -115,15 +90,16 @@
"text": "Viruses",
"right": true
}
]
],
"source": "",
"tier": 506,
"image": "data/pix/question1.png"
},
{
"tier": 759,
"text": "To what degree Libre Office is compatible to MS Office documents?",
"explanation": [
"data/videos/question1.webm"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": "It can run the same viruses?",
@ -136,18 +112,18 @@
"text": "It has the same plugin-api."
},
{
"text": "It fucks up documents just as well.",
"right": true
"text": "It fucks up documents just as well."
}
]
],
"source": "",
"tier": 759,
"image": "data/pix/question1.png"
},
{
"tier": 1139,
"text": "How much money makes MS by patent bribing Android manufactures a year?",
"explanation": [
"data/videos/question1.webm"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": "$1 billion"
@ -162,15 +138,16 @@
{
"text": "$50 mio"
}
]
],
"source": "",
"tier": 1139,
"image": "data/pix/question1.png"
},
{
"tier": 1709,
"text": "Which company delivers software that could reboot by a IPv6 ping in 2011?",
"text": "Which company delivers software that could be rebooted by a IPv6 ping in 2011?",
"explanation": [
"data/videos/question1.webm"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": "Microsoft"
@ -185,38 +162,40 @@
{
"text": "Huawei"
}
]
],
"source": "",
"tier": 1709,
"image": "data/pix/question1.png"
},
{
"tier": 2563,
"text": "How much money has HP spent in CEO pay-offs since 2005?",
"explanation": [
"data/videos/question1.webm"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": "$10 mio"
"text": "$100 mio"
},
{
"text": "$80 mio",
"right": true
},
{
"text": "$50 mio"
"text": "$1 bln"
},
{
"text": "$25 mio"
"text": "$500 mio"
}
]
],
"source": "",
"tier": 2563,
"image": "data/pix/question1.png"
},
{
"tier": 3844,
"text": "Which network protocol was used to demonstrate a PoC to control the engines of a Boing 747 starting from the video entertainment system?",
"explanation": [
"data/videos/question1.webm"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": "ssh"
@ -231,6 +210,9 @@
{
"text": "proprietary"
}
]
],
"source": "",
"tier": 3844,
"image": "data/pix/question1.png"
}
]

View File

@ -1,11 +1,9 @@
[
{
"tier": 100,
"text": "What was the reason for human loss at Pukkelpop music festival in Belgium?",
"explanation": [
"data/videos/question1.webm"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": "stormy wind"
@ -20,15 +18,16 @@
{
"text": "bungling"
}
]
],
"source": "",
"tier": 100,
"image": "data/pix/question1.png"
},
{
"tier": 150,
"text": "Which country does not have a net neutrality law?",
"explanation": [
"data/videos/question1.webm"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": "Belgium"
@ -43,15 +42,16 @@
{
"text": "Chile"
}
]
],
"source": "",
"tier": 150,
"image": "data/pix/question1.png"
},
{
"tier": 225,
"text": "What is the gain in round trip time by the new $300 mio EU-US cable (first in 10 years)?",
"text": "What is the improvement of round trip time by the new $300 mio EU-US cable (first in 10 years)?",
"explanation": [
"data/videos/question1.webm"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": "6s"
@ -66,15 +66,16 @@
"text": "0.006s",
"right": true
}
]
],
"source": "",
"tier": 225,
"image": "data/pix/question1.png"
},
{
"tier": 337,
"text": "Which App was pulled off the Apple app store this year after massive protests?",
"explanation": [
"data/videos/phonestory.webm"
],
"image": "data/pix/van_gogh_ipad.jpg",
"answers": [
{
"text": "Phone Story"
@ -89,38 +90,16 @@
{
"text": "Conterfai Lugary"
}
]
],
"source": "",
"tier": 337,
"image": "data/pix/van_gogh_ipad.jpg"
},
{
"tier": 506,
"text": "Which App wasn't removed from the Apple app store this year?",
"text": "Why does the German SPD politician Sebastian Edathy want the data retention law?",
"explanation": [
"data/videos/question1.webm"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": "Phone Story"
},
{
"text": "Cure-Gay",
"right": true
},
{
"text": "Smuggle Truck"
},
{
"text": "Conterfai Lugary"
}
]
},
{
"tier": 759,
"text": "Why does the German SPD politician Sebastian Edathy wants the data retention law?",
"explanation": [
"data/videos/question1.webm"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": "to catch who send him a plastic pussy",
@ -135,15 +114,16 @@
{
"text": "to protect democracy"
}
]
],
"source": "",
"tier": 759,
"image": "data/pix/question1.png"
},
{
"tier": 1139,
"text": "What was not patented to our knowledge?;Snowman;Snowball;Patenting;Geotracking;1;",
"text": "What was not patented to our knowledge?",
"explanation": [
"data/videos/question1.webm"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": "Snowman",
@ -158,61 +138,40 @@
{
"text": "Geo-tracking"
}
]
],
"source": "",
"tier": 1139,
"image": "data/pix/question1.png"
},
{
"text": "Which country did not get his copyright law dictated by the US?",
"explanation": [
"data/videos/question1.webm"
],
"answers": [
{
"text": "Canada"
},
{
"text": "Spain"
},
{
"text": "Sweden"
},
{
"text": "Russia",
"right": true
}
],
"source": "",
"tier": 1709,
"text": "Which country did not get his copyright law dictated by the US?",
"explanation": [
"data/videos/question1.webm"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": "Canada"
},
{
"text": "Spain"
},
{
"text": "Sweden"
},
{
"text": "Russia",
"right": true
}
]
"image": "data/pix/question1.png"
},
{
"tier": 2563,
"text": "Which country did not get his copyright law dictated by the US?",
"explanation": [
"data/videos/question1.webm"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": "Canada"
},
{
"text": "Spain"
},
{
"text": "Sweden"
},
{
"text": "Russia",
"right": true
}
]
},
{
"tier": 3844,
"text": "What vendor/project did not violate the GPL?",
"explanation": [
"data/videos/question1.webm"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": "AVM"
@ -227,6 +186,9 @@
{
"text": "Emacs"
}
]
],
"source": "",
"tier": 3844,
"image": "data/pix/question1.png"
}
]

View File

@ -1,11 +1,9 @@
[
{
"tier": 100,
"text": "What company does this org chart show?",
"explanation": [
"data/pix/organigram.png"
],
"image": "data/pix/orgchart-ms.png",
"answers": [
{
"text": "Google"
@ -20,15 +18,16 @@
{
"text": "Oracle"
}
]
],
"source": "",
"tier": 100,
"image": "data/pix/orgchart-ms.png"
},
{
"tier": 150,
"text": "What programming language Fefe isn't able to read?",
"explanation": [
"data/videos/question1.webm"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": "C"
@ -43,38 +42,16 @@
"text": "Erlang",
"right": true
}
]
},
{
"tier": 225,
"text": "Which city is going to support founding of 100 hackerspaces?",
"explanation": [
"data/pix/shanghai.jpg"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": "Paris"
},
{
"text": "New York"
},
{
"text": "Shanghai",
"right": true
},
{
"text": "Rio de Janeiro"
}
]
"source": "",
"tier": 150,
"image": "data/pix/question1.png"
},
{
"tier": 337,
"text": "Who did not die this year?",
"explanation": [
"data/pix/anonymous-sun.jpg"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": "Steve Jobs"
@ -89,15 +66,16 @@
{
"text": "Dennis Ritchie"
}
]
],
"source": "",
"tier": 337,
"image": "data/pix/question1.png"
},
{
"tier": 506,
"text": "Which programming language can calculate?",
"explanation": [
"data/pix/shanghai.jpg"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": "PHP"
@ -112,61 +90,64 @@
{
"text": "Dennis Ritchie"
}
]
],
"source": "",
"tier": 506,
"image": "data/pix/question1.png"
},
{
"text": "How many babies were given away in Spain between TODO and the 90-es?",
"explanation": [
"data/pix/shanghai.jpg"
],
"answers": [
{
"text": "PHP"
},
{
"text": "300,000",
"right": true
},
{
"text": "Java"
},
{
"text": "Dennis Ritchie"
}
],
"source": "",
"tier": 759,
"text": "How many babies were given away in Spain between and the 90-es?",
"image": "data/pix/question1.png"
},
{
"text": "How many Mrs USA finalists think evolution should be taught in school (out of 51)?",
"explanation": [
"data/pix/shanghai.jpg"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": "PHP"
},
{
"text": "300,000",
"text": 1,
"right": true
},
{
"text": "Java"
"text": 2
},
{
"text": "Dennis Ritchie"
"text": 4
},
{
"text": 8
}
]
},
{
],
"source": "http://themoderatevoice.com/114102/americas-rejection-of-evolution-reflected-in-miss-usa-pageant/",
"tier": 1139,
"text": "How many Mrs USA finalists think evolution should be taught in school?",
"explanation": [
"data/pix/shanghai.jpg"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": "PHP"
},
{
"text": "300,000",
"right": true
},
{
"text": "Java"
},
{
"text": "Dennis Ritchie"
}
]
"image": "data/pix/question1.png"
},
{
"tier": 1709,
"text": "What could not be used to exploit Win systems in 2011?",
"explanation": [
"data/videos/question1.webm"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": "TXT file"
@ -181,15 +162,16 @@
"text": "Power Button",
"right": true
}
]
],
"source": "",
"tier": 1709,
"image": "data/pix/question1.png"
},
{
"tier": 2563,
"text": "What animal did the US army use in Western Berlin for intruder alarm?",
"explanation": [
"data/videos/question1.webm"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": "goose",
@ -204,15 +186,16 @@
{
"text": "dog"
}
]
],
"source": "",
"tier": 2563,
"image": "data/pix/question1.png"
},
{
"tier": 3844,
"text": "What was the most common password?",
"explanation": [
"data/videos/question1.webm"
],
"image": "data/pix/question1.png",
"answers": [
{
"text": "goose",
@ -227,6 +210,33 @@
{
"text": "dog"
}
]
],
"source": "",
"tier": 3844,
"image": "data/pix/question1.png"
},
{
"text": "What answers Siri when you ask it \"Can you call me an ambulance?\"",
"explanation": [
"data/videos/question1.webm"
],
"answers": [
{
"text": "goose",
"right": true
},
{
"text": "sheep"
},
{
"text": "chicken"
},
{
"text": "dog"
}
],
"source": "",
"tier": 5555,
"image": "data/pix/question1.png"
}
]

View File

@ -40,6 +40,7 @@ class Question(yaml.YAMLObject):
"""
yaml_tag = u"!Question"
web_root = "data"
media_path = ""
# {round_no1: [tier1, tier2, ...], round_no2: [tier1, ...]}
registered_questions = {}
@ -59,7 +60,7 @@ class Question(yaml.YAMLObject):
}
def __init__(self, question=u"", tier=0, answers=[], game_round=0,
media=("", "", ""), media_path="data", web_root="data"):
media=("", "", ""), source="", media_path="", web_root="data"):
"""docstring for __init__
@question - the Question
@rank - number of the question in the game
@ -67,12 +68,14 @@ class Question(yaml.YAMLObject):
@answers - list of answers, assumed are 4
@media - (media show at question time, media shown at answer time,
media shown at resolution time)
@media_path - path to the media files
@media_path - src path to the media files
@web_root - path to media files on the web server
"""
self.question = question
self.answers = answers
self.tier = tier
self.game_round = game_round
self.source = source
self.media = media
self.media_path = media_path
self.web_root = web_root
@ -105,6 +108,10 @@ class Question(yaml.YAMLObject):
data = {}
data['text'] = self.question
try:
data['source'] = self.source
except AttributeError:
data['source'] = ""
data['tier'] = self.points.get(int(self.tier), 0)
data['answers'] = [
{'text': answer[False]} if answer.has_key(False) \
@ -115,9 +122,14 @@ class Question(yaml.YAMLObject):
def gen_questions():
q_data = {}
for f in self.media['question']:
q_data[self.__type_by_extension(
os.path.sep.join(os.path.join([self.media_path, f]))
)] = os.sep.join([self.web_root, f])
try:
q_data[self.__type_by_extension(
os.path.sep.join(os.path.join([self.media_path, f])
)
)] = os.sep.join([self.web_root, f])
except AttributeError, e:
raise AttributeError, \
"Question {0} cannot be generated: {1}".format(self.question, e)
return q_data
def gen_explanation():
return {'explanation': [os.sep.join([self.web_root, expl]) \