Please Tell me how can I add Auto expire quiz feature to …

closed

Please Tell me how can I add Auto expire quiz feature to the one who attempts it. (for eg. if I attempt it today so I can attempt the quiz for 15 days and after that i could not attempt it Tell me this feature how can i add this feature)

This thread has been imported from harmonicdesign.ca/hd-quiz/

April 28, 2021 at 2:55amKush

Hi Kush, this is not built into HD Quiz and likely never will be. If you need something like this, you’ll need to hook into HD Quiz to extend it.

For example, there are two ways you can do this.

The first requires your users to be logged in, and the second requires tracking cookies.

BASIC EXAMPLES:
Use the ‘hdq_init’ action to hide the quiz if you detect if the user has taken the quiz in the past 15 days.

Use the ‘hdq_submit’ action to send custom data to your site backend whenever a quiz has been completed and save this data to the users profile as custom meta data or perhaps save the info as a cookie. Example data to send would be the quiz ID as well as the current datetime. This way using the above hdq_init action you can check, for example, the logged in users metadata for that quiz id and see if the current date is more or less than 15 days.

28 April 2021 — 12:32support admin Dylan

This thread has either been marked as complete or has been automatically closed due to inactivity. Please consider opening a new support thread for help.