As a 10-11 year old kid, I was greatly enthralled and influenced by a minor quizzing revolution that was in play in 1997-1998 thanks to good folks like Siddharth Basu, Derek O’ Brien and of course forget Kaun Banega Crorepati (India’s “Who Wants To Be A Millionaire”).
I quickly developed the habit of reading newspapers & documenting interesting articles in my little scrap book. With the madness of KBC in 1997-98, I started reformatting my little notes into MCQs and within 2 years, I had accumulated around 1000 questions.
Boosted by my dad’s encouragement, I decided to publish it into a Quiz Book titled Quiz Quotient. This period in my life as a 12 year old writing/compiling a book earned me a place in the city’s leading newspapers. This was when I was injected with a much needed shot of self esteem and sense of accomplishment.
It’s 2020 as I write this – Almost 20 years since I published the book. A lot of print copies lie in ruin and abandon on my shaft. The internet happened and quiz books no longer hold the same value as they once did. Now a data analytics engineer, I decided to host my dataset of 1000 questions on the cloud, expose it via an API endpoint and develop a small PHP page to publish it.
This page is just a marriage between my love for cloud tech and a childhood obsession.
The Solution:
I had to parse a primitive Excel 1998 file with a Python file and convert it into a JSON. The Excel didn’t exactly follow a structure or a pattern. My dad was an accountant and knew only MS Excel at the time. So, he decided to type everything in my scrap book into an Excel sheet on his computer at work.
The python script I wrote isn’t clean by any means so you may find some questions/answers that are either poorly formatted or are just plain wrong or blank even. I will rectify them in the coming days as an when I stumble upon them.
I then hosted the JSON in an S3 bucket. Wrote a Lambda function that reads the S3 file and generates a single sample question that gets returned as a JSON response whenever a request comes from the API gateway on AWS.