I'm trying to accomplish this scenario :
There are 2 types of users, let's say
Worker, and there have different roles.
Admin can do a
CRUD of questions, and also can create a room where the users can join to play together (this is just a name) but maybe is a good idea to create more attributes inside of it like, WHO is playing in this room, POINTS for everyone but let's talk it afterwards when I show you the design.
Worker can play solo or multiplayer.
Ok the thing is, on my design I have :
User which contains :
This is a default one, but then I'm wondering how do I define the
Role if it's an
Admin or a
Worker, something like
isAdmin:true and then I check this
Bool? Also I'd like to have the reference for those questions where the user has failed more, I mean like a wrongQuestionNumber which contains the _id of the question and the times he/she failed
Then I'd like to have the
Question collection where contains :
- correctAnswer or answers because it can be multi option chooser
Room collection should contains :
- type (game can be as a group or solo) that's why this attribute
- exam (this is an object created by Admin means that when he creates a question he can select many and create an exam with those)
- ranking (This is the top X from 1 to X)
- don't think if I have to add the winner here because if I get the position 0 from ranking I get the winner...
There's a collection named
Topic as well, if my question have a topic then I can select the question by Topic.
An example of Topic should me Math so user can do only exams or do tests with math questions.
Then I have to store like a historic about what are the questions worker has answered correct and what did not, to make some statistics, but I need to store some historicals for Admin to see in this topic the average that Workers have failed more is : Question23 (for instance) something like that.
Any tip is welcome, and improvement as well.
@uokesita recommend to me to use
PostgreSQL so maybe it's a good idea doing this way, how could be the schema?