How Quizroom works …

Now, as promised, a few insights into how Quizroom works.
As I already explained: Quizroom auto-generates questions based on facts I have stored in its database, so there is no need to setup pre-defined questions and answers.
It is designed in a way that it allows me to keep an arbitrary number of fact tables in my database with an arbitrary number of facts. For example I have one table called facts_countries containing a list of countries with their population and rank by population ( guess who is number 1 by the way ).
The key table in the Quizroom database is the table called questions which contains the question templates, assigned to categories. For the category "Geography" for instance there is one question template which looks like this:

Question = "Which of these countries has the highest population ?"
Answer = "Country"
Criteria = "max(Population)"
Table = "facts_countries"
Category = "Geography"
Ref =

There are multiple questions in category "Geography", so first thing Quizroom does is picking one randomly. Let’s assume it has picked the one shown above. This tells Quizroom to go to the facts_countries table and pick four records randomly from there. From those 4 records one is picked as the "right" answer depending on the criteria, here the one with the highest population. The question is displayed plus the four possible answers. That’s basically it.
There is a column Ref with the URL from where I have taken the data. You might have noticed that after you have answered a question a "Reference" link is shown at the bottom of the screen, so you actually can go there and verify the source of the facts used for that particular question.
The challenge now is to feed the Quizoom database with interesting facts, stored in a structured way. Wikipedia of course is a good source and some articles have a lot of tables, which make is easy to some extend to derive those structured data. I actually wrote a little Greasemonkey script to transform HTML tables into CSV files easy to import into a database.
Nevertheless, even HTML tables are hard to digest for a structured database in many cases. If for example you look at this Wikipedia article into the table of Countries you notice that for several countries footnotes have been added. This kind of disturbs the attempt to transform such a table into a structured format and requires extra data cleaning effort.
My little Greasemonkey script is just a start, may be a more powerful browser extension is needed to assist in fetching unstructured data and transforming it into useful structured data. Many facts come in format of lists with special rules, something for instance not supported by that script yet.
So much for now. If you, dear reader, know of any source in the internet with interesting facts organized in a structured way please let me know; may be these facts could become the fuel for more interesting questions in Quizroom.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: