Friday, 16 May 2014

Graphing

Most libraries built for graphing data on web pages are large and clunky, so I opted to write my own client code to generate graphs of user data for the uil website. The data is given as two groups of time stamps and question ids, one for questions answered correctly and one for questions answered incorrectly. First, the data is normalized so that the time stamps are between 0 and 1, inclusive, so that the question with time stamp 0 is your first question answered and 1 is your last question answered. The data is then sorted and iterated through and graphed, keeping track of the ratio between your number of questions answered correctly and incorrectly, generating a graph of your general performance over time.

This style of data crunching is briefly very computationally intensive, so if users are opening a lot of pages it could chew up some bandwidth. Additionally, I'm not sure how well this will work if users have a very long history, but there won't be more data points than there are questions in the whole database, so that should be fairly easy for us to control.