Hi, I'm trying to create a quiz using CGI and HTML5 . Where html5 has the radio boxes and the CGI generates the correct response. I'v been at this for the past 8 hours. Im not the best at perl . Im hoping that someone could help Thanks

#!/usr/bin/perl use Modern::Perl; use warnings; use strict; use CGI qw/:standard/; use CGI::Carp qw/fatalsToBrowser/; print header(); my ($grp1,$grp2,$grp3); $grp1 = param('grp1'); $grp2 = param('grp2'); $grp3 = param('grp3'); if ($grp1 eq "Correct1" ) { print p("Question One Is Correct"); } elsif ($grp1 eq"Incorrect1") { print p(" Question One is Incorrect"); } if ($grp2 eq "Correct2") { print p("Question One Is Correct"); } elsif ($grp2 eq"Incorrect2") { print p(" Question One is Incorrect"); } if ($grp3 eq "Correct3") { print p("Q3 is correct" ) ; } elsif ($grp3 eq "Incorrect3") { print p("q3 is wrong"); } ~
HTML 5
</ul> </div> <div id="h3"> <h1> Little quiz </h1> </div> <br/> <form action="pagefive.cgi" method="get"> Q1: Intermittent Fasting determines your food diet<br/> <input type="radio" name="grp1" value="Incorrect1"> Yes<br +/> <input type="radio" name="grp1" value="Correct1"> No<br/> </form> Q2: You have two individuals, One who's diet consists +of Mcnuggets from Mcdonalds. And an invdivudal whose diet consists of + clean food. Both are at caloric deficit and are excercising. Do you +think the indivdual with the Mcnugget diet will lose weight ?<br/> <form action="pagefive.cgi" method="get"> <input type="radio" name="grp2" value="Correct2">Yes<b +r/> <input type="radio" name="grp2" value="Incorrect2">No< +br/> </form> Q3: The more over weight you are, the more you will lose w +hen you start any excercise or diet program <br/> <form action="pagefive.cgi" method="get"> <input type="radio" name="grp3" value="Correct3"> Yes< +br/> <input type="radio" name="grp3" value="Incorrect3"> No + <br/> <input type="submit" value="Submit"> </form>
as for the cgi, I tried many combinations, I just can't seem to get it right The thing is, it's not generating the correct response to the questions that were filled.

In reply to cgi based quiz by sargg55

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.