Parse database modeling for multiple choice quiz app?

Hi Parse community!

First time poster here! :blush: I am creating a quiz app and want to ask the community what they think the best way would be to model the database in a way that is secure, doesn’t allow the user to cheat and allows the user to view their correct answers at the end, tallied up.

So I think what I want to do is create an object for each quiz, but for the let’s say 5 questions and let’s say there are 4 multiple choice answers per question, are the questions and the responses separate object classes in a relation or a pointer?

As in, would it look like this?

ObjectId | Quiz Module | Question1 | Question1Answer1 | Question1Answer2 | ...

Also, how would it be best for the user to “validate” their choice against the real answer in the object data field. I don’t want to have to use Cloud Code…can i just verify via the object info?

Any help on this would be super appreciated!! Thank you!

Current stack:

  • NEXTjs
  • JavaScript SDK

For your use-case, you want that the correct answer only to be disclosed after the user has submitted their own answer. I don’t see a way to do that unless you use cloud code. You will have to either put the answer on a protected field or a separate class and create a cloud code function that receives the user’s answer and use the master key to verify if it is correct / return the right answer to the user.

1 Like

Are there any examples of this in the documentation? I had a hard time finding anything on this.

I’m not aware of any documentation specific to what you need