Not only am I able to add it – it’s already added (kind of – not exactly the way you are asking for).
I have another FREE HD Quiz addon in development (haven’t landed on an official name yet, but calling it “HD Quiz: Limit Attempts” for now) that is pretty much complete and is just in the testing phase before submitting to WordPress to be added to the official repository here.
The addon settings will be fairly simple. You will be able to decide on how many attempts each user is allowed, and you will be able to have some custom content to replace a default notice of “Sorry, but you have used up all of your attempts. This quiz is no longer available to you”. You will also be able to set a “mode”.
NOTE: It works by total attempts, not failed attempts. It’s a total block, not a time based block (time based is a good idea, but is actually hard to do with any level of reliability. Time is a ridiculously complicated thing to deal with because of server times, client times, daylight savings, timezones, etc).
The addon will have three different modes. The default “logged in only” mode, an “all users” mode, and a “hybrid” mode.
When in “logged in” mode:
- More secure and strict in limiting quiz attempts as we are saving the data to the logged-in user’s profile instead of relying on cookies or
localStorage
.
- Since the data is saved to the user account, you – the admin – can view their user profile and see what quizzes have been attempted and reset their “counter” if you want them to be able to take the quiz again.
- Obviously works for logged-in users only
- Cross device and browser. We save attempts to the user account, not the device that completed the quiz.
- If this mode was explicitly set, then this will go a step further and hide quizzes from non logged in users so that only logged in users can take the quizzes. This will not happen if in “hybrid” mode.
When in “all user” mode:
- attempts are stored to
localStorage
. The quick explanation of this is that it is less secure of a method as a user can clear their browser cache/data and be able to retake the quizzes again.
- you – the admin – have no way of resetting attempts for specific users. If a user uses up their attempts, you will need to instruct them on how to clear their browser data (or tell them to use their browser’s incognito mode, a different browser, a different device etc.)
When in “hybrid” mode
- Works the same as the above modes. We use “logged in” mode if the user is logged in, or fallback to “all user” mode.