Clever Twig - Blog
I Can Has Categoriez?
To date there have only been geography quizzes available on Brainiac Bytes (or whatever I end up deciding to call this site). This has been somewhat convenient because all of the quizzes and quiz questions neatly arrange themselves in the admin section for editing without too much confusion. However, in order to eventually have several types of quizzes covering various topics, I wanted to create a way to organize the quiz games, questions and answers to avoid them getting mixed together in an unfathomable trivial goop.

Sounds easy right? I decided that each category was going to be a separate 'object' stored on the database that has a name, parent category, and lists of quizzes and quiz questions that are in that category. My first effort only allowed two 'tiers' of categories (categories and subcategories). I soon became frustrated with this limitation though and decided to bin the idea and start again. For the system to be truly flexible, I would need to be able to add as many categories (and subcategories, and sub-subcategories and so on) as I wished. In order to do this, I would have to use recursive functions.

For those not familiar with coding, a recursive function is a function that 'calls' itself within the function, allowing for a 'loop' effect (in my case, looping through lists of lists of lists and so on). They are kind of the coding equivalent of an Escher painting. Sometimes I feel my own brain gets caught in a recursive loop trying to understand them... a problem broken only by watching cats on youtube.

With the new category system mapped out I dived into coding and made steady progress over a few days. Then, as is typical when just about to complete a large section of code, I came across a better category system that is used by Wikipedia. The main difference is that Wikipedia's system is not limited to only one 'parent' category. This provides a much more detailed and flexible (and much more complicated!) hierarchy. However, adapting my code to allow for this change would have taken considerable time, and my preference was to finish this task some time before 2015.

In the end, after quite a few days of coffee, cookies and hard work, I now have a category system up and running. Joy! Now I can finally start adding some quizzes for those people who just aren't interested in knowing the capital of Nagorno-Karabakh... whoever they are...?
The Blog Is Alive! Aliiiive!
As the title suggests, this is the first blog post of the newly minted Trivia Bytes blog! Hurrah!!

Adding the blog to the website took about two days, although much of the initial work had already been crafted while I was doing the Udacity class in web development (an excellent class by the way, highly recommend). Extra work involved adapting the code for the particulars of this website, making it look pretty using css, and working out how to add a comments section... an action I may soon regret... be nice internet!

So why the blog? Here are a few reasons:
  • To learn how to code a blog (check).
  • To document all the work I have done on this website (making sure to exaggerate any trials and tribulations for comedic effect).
  • To think out loud about how this site could be beneficial (or maybe not so much) for educational purposes.
  • To practice mine English skills improve.
  • To try and expand this site's active users beyond about two people (myself included).
  • To provide a global forum for discussion and debate about how to solve the biggest challenges of our time.
OK so the last one might be a bit of a stretch, and if none of the others grab your attention then hopefully the blog will at least be readable.

What else? That's about it for now. I'll try and write a post whenever I update the site or come across something cool on the interwebs that is in some way relevant. There is no way to contact me directly on this site yet (work in progress), but you can contact me very publicly in the comments below. In a perfect world I would then reply to your comment, but currently there is no reply button... maybe i'll fix that next?