ASimPerson wrote:Someone needs to just do this. I started on something similar once like 3 years ago but then I got busy with a project or some crap and I never finished it.
It's done. http://philgroce.com/software/qbtools-1.0.0.tar.gz
I've been using this for TRASH since I got sick of Word, around 1997. (I was sick of Word a long time before that, but I got reeeally sick of Word when I had to assemble twenty packets out of individual questions emailed to me. I'm sure I'm not alone in that pain.) It's been rewritten about three times since then. It's pretty mature code now.
The tools take text in what I call the Simple Format (documentation forthcoming, or see below) and convert them into an internal representation. From there I convert to LaTeX or HTML, or an XML dialect I wrote as an exercise.
The whole thing's written in Perl -- it was the language in which I was most fluent in 1997 -- but it's pretty well-behaved Perl, all things considered. CS types will be disappointed at the ad-hoc nature of the parser, but it's pretty clean otherwise.
I rejected XML as a question format because it is human-readable (and more importantly, human-writable) only with difficulty. Instead, I came up with Simple, based on the following principles:
1. Plain text format. Easy to sling around in mail, IRC, etc.
2. Easy to read and write. It's about as hard to write an email as it is to write a well-formatted question. Similarly, not only can you sling them around in email, you can print them out with no formatting whatever and read them normally. (I figured this would be a big benefit for someone prnting questions in a hurry, without access to the conversion tools, due to some day-of-tournament crisis.)
Here are some sample questions in the format, from 2005 TRASH Regionals:
- Code: Select all
TU: Released in 2003, in this game you play a nameless New Jersey-ite who receives help from store owner Stacy Peralta, pro Chad Muska, and childhood friend Eric Sparrow. A jealous Eric cheats, framing you for crashing a tank in Moscow. It is the first game in the series to make use of extensive cut-scenes, including one in which you jump off of a building and perform a McTwist over a helicopter. For ten points, name this title in which you progress from a local amateur to a sponsored professional skateboarder.
ANS: _Tony Hawk Underground_ (prompt on "THUG")
==Oh, yeah, you do comments like this
Multi-line comments work like this.
Handy for commenting out whole questions at a time.
TU: Books published with his name following his death include four titles
in the Covert One series, "co-written" by both Gayle Lynds and Patrick
Larkin. Born in 1927, his first calling was in theater, where he operated
the Playhouse on the Mall in Paramus, New Jersey. His first book, *The Scarlatti Inheritance*, was released in 1971, while *The Osterman Weekend* was released one year later. Several of his books have been made into films, including *Osterman*, *The Apocalypse Watch* and a pair of movies starring Matt Damon as a secret agent with amnesia. FTP name this author responsible for *The Bourne Identity* and its sequels.
ANS: Robert _Ludlum_
B: Nothing on earth is more important than a clean toilet. Identify the
following toilet cleaners FTPE.
PART: This cleaner with a bird-like application nozzle comes in several varieties including Liquid Rimblock and Ultra Gel and is manufactured by SC Johnson, A Family Company.
ANS: _Toilet Duck_
PART: Advertisements for this line of bathroom cleaners have featured animated versions of the product attacking toilet filth to the accompaniment of Ride of the Valkyries.
ANS: _Scrubbing Bubbles_
PART: Chappelle's Show aired a spoof commercial for Potty Fresh, a toilet cleaner featuring this rapper famed for such songs as "Rockafella" and "Smash Sumthin" riding a jet ski in a woman's toilet.
ANS: _Redman_ (also accept Reggie _Noble_)
B: When you think of country, you think of New Jersey. Name these
musicians on a 15-5 basis.
PART:  Born while his father was temporarily working in New Jersey, he had a country #1 with his debut single in 1989.
PART:  In addition to 1989's "A Better Man", other #1's include 1999's
"When I Said I Do", a duet with his wife Lisa Hartman.
ANS: Clint _Black_
PART:  Born in Princeton, New Jersey, she traveled the Washington
D.C. coffeehouse circuit before releasing her first album, *Hometown Girl*.
PART:  This "Down at the Twist and Shout" and "Shut Up and Kiss Me" singer attended not Princeton, but Brown University.
ANS: Mary Chapin _Carpenter_
Using those questions as examples, you can pretty much write any question you care to. Incidentally, they translate to the following XML (truncated):
- Code: Select all
<part>Released in 2003,...a sponsored professional skateboarder.</part>
<answer>_Tony Hawk Underground_ (prompt on "THUG")</answer>
<leadin>Nothing on earth is more important than a clean toilet. Identify the
following toilet cleaners for ten points each.</leadin>
<part>This cleaner...A Family Company.</part>
<part>Chappelle's Show...riding a jet ski in a woman's toilet.</part>
<answer>_Redman_ (also accept Reggie _Noble_)</answer>
(The XML doesn't parse the underscores and asterisks, but in LaTeX and HTML they come out as the appropriate formatting for underlines/bold and italics, respectively.)
The only non-obvious thing here is the cycle tag. Conceptually in the code, each question is composed of one or more cycles, each of which contains one or more parts and exactly one answer. I was able to do pretty much anything I wanted to with question formatting using that abstraction.
A few of the things I think could be improved:
1. Normalize the answers more. You can infer what the necessary part is from the underscores but a more formal notion of a moderators note would be nice.
2. Metadata. I wrote a basic question randomizer for one of the tournaments, and it did a wretched job -- it turns out that "sports question, sports question" turns up occasionally in a random shuffle, but no one wants that at a tournament. I was thinking of using encoded comments to store subject, estimate of difficulty level, and perhaps other information. This could be used to make a smarter shuffle that knew to separate questions of differing subjects. It could also be used to assemble packets based on difficulty level, author, date written, etc. The main reason I didn't do this was that I didn't want to complicate the format.
3. Tool support. I wrote a (very, very) basic web-based GUI for submitting questions. It has met TRASH's needs admirably, but I've seen things lying by the side of the road that were prettier. I suspect a port to Java or Python would make thick clients easier.
Edit: 4. Add power marks.
The code is GPL (v2). Feel free to download and do with it what you will, subject to the terms of the license. Contact me directly if you have any questions (firstname.lastname@example.org
) -- I don't read this board very often.