The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> PHP Development
|
PHP-General - Taking a PHP quiz only once
Discuss Taking a PHP quiz only once in the PHP Development forum on Dev Shed. Taking a PHP quiz only once PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

November 24th, 2012, 09:44 AM
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 3
Time spent in forums: 24 m 10 sec
Reputation Power: 0
|
|
|
PHP-General - Taking a PHP quiz only once
Hi everyone, I am writing a php quiz for my students. Results will be sent to my email, which is what I prefer. The form requires that all questions are answered and that the email they input to identify themselves is valid. Upon submitting, I show answers to questions which were missed and provide the percentage of correct answers. To avoid random people finding my quiz, I have a no-robots tag on the page and can put a JavaScript password on it. I'm fine with the coding for all of that.
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, 10:14 AM
|
|
Contributing User
|
|
Join Date: Jun 2009
Posts: 297
  
Time spent in forums: 3 Days 8 h 45 m 39 sec
Reputation Power: 5
|
|
|
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, 10:35 AM
|
 |
pollyanna
|
|
Join Date: Jul 2012
Location: Germany
|
|
|
Hi,
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, 04:43 PM
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 3
Time spent in forums: 24 m 10 sec
Reputation Power: 0
|
|
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, 04:44 PM
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 3
Time spent in forums: 24 m 10 sec
Reputation Power: 0
|
|
Thanks, Jacques1! The flag idea will be very useful indeed.

|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|