Code52 / jibbr

A Jabbr bot designed for collaborative projects
code52.org
67 stars 27 forks source link

Quiz bot (Issue #16) #41

Closed ssboisen closed 12 years ago

ssboisen commented 12 years ago

I started implementing the quiz bot.

For now it only does some celebrity and movie related questions which are hardcoded. I'm planning on adding support for an API like True Knowledge or other later down the line. Bot for now people can add additional questions and question-categories.

I havde included some unit tests which covers most of the code but I couldn't be bothered verifying everything. Since the bot couldn't be mocked without an interface I had to introduce an IBot interface. So I had to refactor a bit of the base jabbot code.

As a poor mans spelling-compensater I use the longest common substring between the guess and the correct answer and accept the answer if that substring is longer than 60% of the size of the correct answer. This can be tweeked using a Property in the QuizSprocket class.

The bot accepts a couple of different commands like score and top10 which will display the scores of the players. Also, as long a the latest asked question havn't been answered and one minute have not passed you can't request another question.

ghost commented 12 years ago

Looks good, but the tests don't work because of missing dependencies - are you using Nuget 1.6? Once thats fixed up, we'll merge it in

ssboisen commented 12 years ago

Sorry about that, I was working on my home pc and didn't notice that I hadn't upgraded nuget to 1.6. Should be fixed now.