How do I implement a check for correct answer of question on specific page?

I have multiple Woocommerce product pages which would only allow users who had answered a question correctly to view. Each product page would have their own question and should be treated separately.

Questions would be multiple choice, users must be logged in and only get one chance to answer.

I’ve been using Gravity forms to set up a multiple choice question which only allows one attempt per user. After that i need to check on the product page if users answered correctly.

Flow:

User answers question
If correct a ‘correct answer’ value is applied to user
User visits product page, which checks for ‘correct answer’ value
If ‘correct answer’ value exists, allow access, if not show error
message.

I’m assuming Javascript would be the best way to handle this, but struggling to find a solid starting point.

Read more here:: How do I implement a check for correct answer of question on specific page?

Leave a Reply

Your email address will not be published. Required fields are marked *