I am currently designing one education site.
For this we need to assign some badges to user based on their activity (like stackoverflow).
I was looking for a framework for this. Any one have any idea, how this can be done? Table design etc.
Issues which I could think of with this are :
My initial search gave me following things
I would definitely choose a relational database over a nosql database for this approach.
The first thing you need is the underlying structure of a badge.
ID (int)
Title (Varchar 255)
Image (Varchar 255) - would hold location to image
Points (int)
You would then need to store all the badges a user has earned. So in your users section:
Badges (Varchar) - holds a serialized array of badge IDs
Badge_count (int) - So you can get the total without parsing through Badges.
Point_count (int)
Now you say you can't query against all badges for each performed action, so you should also store an entry for each action. So say in your "posts" table for example:
Possible_badges (Varchar 255) - serialized array of Badge ID's
You can then normalize and give only the badges related to any specific task to your rule engine.
Your best bet is just to start playing with them, if you don't understand what is out there than you must compromise and go for basic logic so only award badges for tasks that can be measured by database entries (mostly numerical data). Or spend more time learning (and pulling your hair out).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With