I am building a Quiz App and I have a class named "Questions" in Parse. When my user answers a question, I wanted that question to be removed from the questions that he needs to answer. I then wanted to add a subclass named "QuestionAnswered", a boolean that would return true for questions that the user had already answered. The problem is that this boolean should be unique to each user. How can I implement this in Parse and in swift?
Thank you.
One way you could do it is have a relation to
User
onQuestions
calledansweredBy
, and just add a user to that relation when they answer a questionThen, to query questions that haven't been answered by the user just add a
questionQuery.whereKey("answeredBy", notEqualTo:aUser)
constraint to your question query.I'm not sure how this will scale though, so YMMV. You might want to do some testing on this if you're expecting decent traffic.