# PRINT RESPONSE:

    $c_topic = $cgi->cookie(
        -name    => 'topic',
        -value   => $topic,
        -expires => '+1d',
        -path    => '/'
    );
    $c_score = $cgi->cookie(
        -name    => 'score',
        -value   => $score,
        -expires => '+1d',
        -path    => '/'
     );
    $c_smarts = $cgi->cookie(
        -name    => 'smarts',
        -value   => $smarts,
        -expires => '+1d',
        -path    => '/'
    );
    $c_playlevel = $cgi->cookie(
        -name    => 'playlevel',
        -value   => $playlevel,
        -expires => '+1d',
        -path    => '/'
    );
    $c_lastnum = $cgi->cookie(
        -name    =>  'lastnum',
        -value   => $lastnum,
        -expires => '+1d',
        -path    => '/'
    );
    $c_goodans = $cgi->cookie(
        -name    => 'goodans',
        -value   => $goodans,
        -expires => '+1d',
        -path    => '/'
    );

    print "Set-Cookie: $c_topic\n";
    print "Set-Cookie: $c_score\n";
    print "Set-Cookie: $c_smarts\n";
    print "Set-Cookie: $c_playlevel\n";
    print "Set-Cookie: $c_lastnum\n";
    print  "Set-Cookie: $c_goodans\n";

    print $cgi->header;

    print <<QWERTYUIOP;

http://www.w3.org/TR/REC-html40/loose.dtd\";>

<HTML>
<HEAD>
    <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
    <TITLE>PsychDef Tutorial</TITLE>
    <META NAME="GENERATOR" CONTENT="OpenOffice.org 3.3,(Win32)">
    <META NAME="CREATED" CONTENT="0;0">
    <META NAME="CHANGEDBY" CONTENT="John M Rathbun MD">
    <META NAME="CHANGED" CONTENT="20110531;20073739">
     <META NAME="DESCRIPTION" CONTENT="Psych Glossary Tutorial 254  Behavioral 
Health Terms Memorized Easily Painless Learning">
    
    <STYLE TYPE="text/css">
     <!--
        P { color: #000080 }
        TD P { color: #000080 }
        H1 { color: #000080 }
        A:visited { color: #ff00ff }
    -->
    </STYLE>



</HEAD>



enctype="application/x-www-form-urlencoded">

<TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0 
STYLE="page-break-before: 
always">
    <COL WIDTH=128*>
    <COL WIDTH=128*>
    <TR VALIGN=TOP>

<!-- COLUMN ONE STARTS HERE -->

<TD WIDTH=33%>
<P ALIGN=CENTER><BR>

<H1><FONT SIZE=5>Select Category:</FONT></H1>
            
                 <P><SELECT NAME="Category" SIZE=10 STYLE="width:  1.43in; 
height: 2.33in; font-family: 'Garamond'; font-size: 14pt">
                    <OPTION VALUE="Consciousness">Consciousness
                    <OPTION VALUE="Defenses">Defenses
                    <OPTION VALUE="Emotion">Emotion
                    <OPTION VALUE="Intellect">Intellect
                     <OPTION VALUE="Memory">Memory
                    <OPTION VALUE="Movement">Movement
                    <OPTION VALUE="Perception">Perception
                    <OPTION VALUE="Speech">Speech
                    <OPTION VALUE="Thinking">Thinking
                    <OPTION VALUE="REVIEW">REVIEW</OPTION>
                </SELECT></P>
<DIV ALIGN=LEFT>

</DIV></FORM></TD>


<!-- COLUMN TWO STARTS HERE! -->

<TD WIDTH=67%>

QWERTYUIOP

    if ($restart) {    # THIS IS EITHER A NEW TOPIC OR FOLLOWS A WRONG ANSWER:

        print <<QWERTYUIOP;
<P><BR><BR><BR></P>
<P ALIGN=LEFT><FONT SIZE=3><B>$instructions</B></FONT></P>
<P ALIGN=LEFT><FONT SIZE=4><B>$stimulus</B></FONT></P>
<DIV ALIGN=LEFT>
QWERTYUIOP

        if ( $playlevel < 4 ) {

            print <<QWERTYUIOP;
$texta
$textb
QWERTYUIOP

            if ($textc) {
                print <<QWERTYUIOP;
$textc
QWERTYUIOP
            }

            if ($textd) {
                print <<QWERTYUIOP;
$textd
QWERTYUIOP
            }

            if ($texte)  {
                print <<QWERTYUIOP;
$texte
QWERTYUIOP
            }

        }    # END PLAYLEVEL < 4

        else {    # PLAYLEVEL > 3
            print <<QWERTYUIOP;

<input  type="text" name="Answer" size="32"><br><br>
<input type="submit" value="SEND">
</form>
QWERTYUIOP
        }    # END PLAYLEVEL > 3

    }    # END RESTART/RECOVERY

    elsif ($smiley) {    # CORRECT ANSWER

        print <<QWERTYUIOP;
<P><BR><BR><BR></P>

<h1>=>$feedback<=</h1><br>
<h2>Your score is $score</h2>

<P ALIGN=LEFT><FONT SIZE=3><B>$instructions</B></FONT></P>
<P ALIGN=LEFT><FONT  SIZE=4><B>$stimulus</B></FONT></P>
<DIV ALIGN=LEFT>
QWERTYUIOP

        if ( $playlevel < 4 ) {

            print <<QWERTYUIOP;
$texta
$textb
QWERTYUIOP

            if  ($textc) {
                print <<QWERTYUIOP;
$textc
QWERTYUIOP
            }

            if ($textd) {
                print <<QWERTYUIOP;
$textd
QWERTYUIOP
            }

            if ($texte) {
                print <<QWERTYUIOP;
$texte
QWERTYUIOP
            }

        }    # END PLAYLEVEL < 4

        else {    # PLAYLEVEL >  3
            print <<QWERTYUIOP;

<input type="text" name="Answer" size="32"><br><br>
<input type="submit" value="SEND">
</form>
QWERTYUIOP
        }    # END PLAYLEVEL > 3

    }    # END CORRECT ANSWER

    else {    # WRONG ANSWER!

        $sound = "$term[$lastnum]";

        if    ( $sound eq "déjà entendu" ) { $sound = "d%e9j%e0 entendu"; }
        elsif ( $sound eq "déjà vu" )      { $sound = "d%e9j%e0  vu"; }
        elsif ( $sound eq "déjà vécu" )    { $sound = "d%e9j%e0 v%e9cu"; }
        elsif ( $sound eq "folie à deux" ) { $sound = "folie %e0 deux"; }
        elsif ( $sound eq "jamais vécu" )  { $sound = "jamais v%e9cu"; }

        $sound = $sound . "\.mp3";

        print <<QWERTYUIOP;
<P><BR><BR><BR></P>

<h1>=>$feedback<=</h1><br><br>



<H1 CLASS="western">Term: <FONT COLOR="#94006b">$term[$lastnum]</FONT></H1>
<H2  CLASS="western">Category: <FONT COLOR="#94006b"><FONT  FACE="Garamond, 
serif"><FONT SIZE=5><SPAN STYLE="font-style:   
normal">$cat[$lastnum]</SPAN></FONT></FONT></FONT></H2>
<H2  CLASS="western">Definition: <FONT COLOR="#94006b"><FONT  FACE="Garamond, 
serif"><FONT SIZE=5><SPAN STYLE="font-style:   
normal">$def[$lastnum]</SPAN></FONT></FONT></FONT></H2>
<H2  CLASS="western">Vignette: <FONT COLOR="#94006b"><FONT  FACE="Garamond, 
serif"><FONT SIZE=5><SPAN STYLE="font-style:   
normal">$story[$lastnum]</SPAN></FONT></FONT></FONT></H2>
            


QWERTYUIOP
    }    # END WRONG ANSWER

    print "</DIV></TD></TR></TABLE></BODY></HTML>\n";

}    # TUTORIAL ENDS HERE

else {    # IN CASE NO COOKIE WAS RECEIVED
    print "content-type: text/html\n\n";
    print $cgi->start_html('Oops!');
    print $cgi->h2(
"OOPS!  The PsychDef tutorial must keep track of your progress so it  can 
adjust 
the difficulty of the questions you see. It does this by  leaving a small text 
file known as a 'cookie' on your machine. We didn't  receive a cookie from your 
Internet browser, so we can't continue your  tutorial."
    );
    print $cgi->h2(
"Please enable cookies  in your browser settings and try again. If you're not 
sure how to do  this, you can search your browser's 'Help' index for 'cookies'."
    );
    print $cgi->h2(
"If you received this message even though your browser allows cookies, please 
e-mail 'cookie-monster (at) theinfosite.org'."
    );
    print $cgi->end_html;
}    #END ELSE

# END OF CGI

Reply via email to