Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Simple Quiz Maker (yet again)

by Anonymous Monk
on Dec 06, 2003 at 04:58 UTC ( #312727=note: print w/ replies, xml ) Need Help??


in reply to Simple Quiz Maker (yet again)

This is my current code now. Not much different from the last one. I just need help with lines 58 - 64. I need to know how to create a 3rd page that tells the user what answers he has inputed. This is after the user presses the Submit button. Thank you.

#!/usr/bin/perl use strict; use CGI qw(:standard); print header, start_html("Quiz Maker"), h1("Quiz Maker"); if (param()) { my $who = param("firstname"); my $who2 = param("lastname"); my $email = param("email"); my $firstquestion = param("FirstQuestion"); my $secondquestion = param("SecondQuestion"); my $thirdquestion = param("ThirdQuestion"); my $fourthquestion = param("FourthQuestion"); my $fifthquestion = param("FifthQuestion"); my $answerfirstquestion = param("AnswerFirstQuestion"); my $answersecondquestion = param("AnswerSecondQuestion"); my $answerthirdquestion = param("AnswerThirdQuestion"); my $answerfourthquestion = param("AnswerFourthQuestion"); my $answerfifthquestion = param("AnswerFifthQuestion"); my $useranswerfirstquestion = param("UserAnswerFirstQuestion"); my $useranswersecondquestion = param("UserAnswerSecondQuestion"); my $useranswerthirdquestion = param("UserAnswerThirdQuestion"); my $useranswerfourthquestion = param("UserAnswerFourthQuestion"); my $useranswerfifthquestion = param("UserAnswerFifthQuestion"); my $choicesfirstquestion = param("ChoicesFirstQuestion"); my $choicessecondquestion = param("ChoicesSecondQuestion"); my $choicesthirdquestion = param("ChoicesThirdQuestion"); my $choicesfourthquestion = param("ChoicesFourthQuestion"); my $choicesfifthquestion = param("ChoicesFifthQuestion"); print p("Thank You. Here is your quiz:"); print p("Name: $who $who2"); print hr(), start_form(); print p("Question #1: $firstquestion"); print p("Answer:", textfield("UserAnswerFirstQuestion")); print hr(), start_form(); print p("Question #2: $secondquestion"); print p("Answer:", textfield("UserAnswerSecondQuestion")); print hr(), start_form(); print p("Question #3: $thirdquestion"); print p("Answer:", textfield("UserAnswerThirdQuestion")); print hr(), start_form(); print p("Question #4: $fourthquestion"); print p("Answer:", textfield("UserAnswerFourthQuestion")); print hr(), start_form(); print p("Question #5: $fifthquestion"); print p("Answer:", textfield("UserAnswerFifthQuestion")); print hr(), start_form(); print p(submit("Submit"), reset("Reset")); print p ("Thank you for taking the quiz."); print p ("For question #1, your answer was $useranswerfirstquestio +n"); print p ("For question #2, your answer was $useranswersecondquesti +on"); print p ("For question #3, your answer was $useranswerthirdquestio +n"); print p ("For question #4, your answer was $useranswerfourthquesti +on"); print p ("For question #5, your answer was $useranswerfifthquestio +n"); print end_form(), hr(); } else { print hr(), start_form(); print p("What's your first name?", textfield("firstname")); print p("What's your last name?", textfield("lastname")); print p("Enter your e- mail address", textfield("email")); print hr(), start_form(); print p("What is your first question", textfield("FirstQuestion")) +; print p("Please enter the answer", textfield("AnswerFirstQuestion" +)); print hr(), start_form(); print p("What is your second question", textfield("SecondQuestion" +)); print p("Please enter the answer", textfield("AnswerSecondQuestion +")); print hr(), start_form(); print p("What is your third question", textfield("ThirdQuestion")) +; print p("Please enter the answer", textfield("AnswerThirdQuestion" +)); print hr(), start_form(); print p("What is your fourth question", textfield("FourthQuestion" +)); print p("Please enter the answer", textfield("AnswerFourthQuestion +")); print hr(), start_form(); print p("What is your fifth question", textfield("FifthQuestion")) +; print p("Please enter the answer", textfield("AnswerFifthQuestion" +)); print hr(), start_form(); print p(submit("Submit"), reset("Reset")); print end_form(), hr(); } print end_html


Comment on Re: Simple Quiz Maker (yet again)
Download Code
Re: (2) Simple Quiz Maker (yet again)
by shockme (Chaplain) on Dec 06, 2003 at 05:06 UTC
    Your problem was most admirably addressed by tcf22 and matthewb in this thread. A diff on the code given here and in that thread shows no real substantial difference -- certainly nothing which would indicate that you had applied the advice given.

    Where do you see this progressing from this point?

    If things get any worse, I'll have to ask you to stop helping me.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://312727]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (12)
As of 2014-12-29 12:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (187 votes), past polls