Quiz Question - Don't Show Q Twice / Custom States

I’m creating a quiz for users to determine who the best Presidential Candidate is for them.

Users rate quotes from the Candidates and the app tally’s score. I’ve got that working just fine.

The problem I’m having pertains to Users who have started taking a quiz, answered some questions, but didn’t finish. When they return I don’t want to show them questions they’ve already answered.

First I made a field on the Question (Data Type) that noted whether the question had been answered, but then the question wasn’t shown to the next user.

What is the most elegant way to do this? I’m researching Custom States but how does that help me if a User leaves the site and returns, or Logs Out and Returns?

Quite Simply - how do I not show the same question twice to the same user?

You could create a list of things on the user called Viewed Questions. If the question is in that list, don’t show it. Once a user answers it, put the question in that users Viewed Questions field.

Alternatively, you can add a field on the question that’s a list of users who have answered it. If that user is in the list, don’t show the question.

A third way is to add all the questions to the user in a list called Unanswered Questions. Then, when they answer it, move it to Answered Questions list on that user.

Many ways to skin this cat, I believe.

2 Likes

So silly of me to have put Viewed Questions as a Field of Question Data type rather than User. Thanks!