November 24th, 2012, 10:44 AM
Taking a PHP quiz only once
But there is always someone who will want to take the quiz a zillion times. The password and validation may slow them down, but somebody will retake it until it's 100% and jam up my inbox. Other than stating, "Only one attempt at the quiz will count for your grade" or "Take this quiz more than once and I'll obliterate all your scores" (no, I wouldn't say that but would like to), is there some code that will prevent them from taking it more than once?
Apologies if this should be in a different forum. Since the quiz is PHP, I thought I'd start here. Any ideas are appreciated.
November 24th, 2012, 11:14 AM
This possibly would NOT be the best way, since I'm not sure on where everyone is doing everything, but you can make it allow one submission per IP. This may be an issue if brothers/sisters, or friends are going to be using the same computer/network to submit their answers. If this is a college level item, I would assume the students have college e-mail addresses, which I would then use.
I understand you want the final submission to land in your inbox, which is no problem, but you will still need a database to hold submission values to run your checks against.
November 24th, 2012, 11:35 AM
it all comes down to how you validate the registrations. If you make sure that every student has only one account, it's absolutely no problem to limit the number of submissions. You just have to set a flag in the database after the quiz (e. g. "quiz_completed = 1") and not allow a user to take the quiz when the flag is already set. Then the same account (= student) won't be able to repeat the quiz.
November 24th, 2012, 05:43 PM
Thanks, Triple_Nothing! I was hoping not to have to set up a database (yes, I was being lazy), but I think you're right it will help. I do have a husband-wife team taking the class right now, so the IP address thing could be sticky ....
November 24th, 2012, 05:44 PM
Thanks, Jacques1! The flag idea will be very useful indeed.