Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assessment Test (PHP) Your client needs a web application that asks a series of

ID: 3823571 • Letter: A

Question

Assessment Test (PHP)

Your client needs a web application that asks a series of questions.
The answers to these questions will be stored or tallied for later use, and at the end of the process these answers will be used to generate a four-character result string.
The client will supply the questions in a database, and will pay $900 for a working application.

I. Architecture Specifications:
The web application must be a multi-page MVC application with the following features:
Entry Point
(a) This page should reset any existing test sessions
(b) A form to initiate a new test.
This form should include a text box to enter a name, and a submit button to begin the test.
Testing Screen
(c) Displays 1 or more questions on screen.
These questions are randomly chosen from the pool of unanswered questions.
(d) For each question, display radio buttons for answer selection.
There will be two possible answers to each question, and they should be shown in random order.
(e) Below the questions is a "continue" button
(f) When the button is clicked, record the scores for the answers and present another test screen with new question(s).
(g) Continue until all 24 questions have been answered.
No question should be answered more than once.
(h) On the testing screen that will complete the last set of questions, make the button say "score test" instead of "continue".
Results screen
(j) The result screen must contain the following text:
Based on your answers to these questions, your score is as follows:
(k) Following the text, echo the 4-letter string score based on the formula below.
(l) Also include a link to return to the main entry point.
(m) Make the 4-letter score into a web link that links to the appropriate Wikipedia page for the score.
http://en.wikipedia.org/wiki/ISFJ
(n) Once the test is complete, store the start time, stop time, user name, 4-letter score in the a9_tests table.

II. Assessment Scoring:
The assessment scoring involves on tracking 4 integers:
$ie $sn $ft $jp
Each of these numbers starts at 0.
Each question in the test will increment or decrement one of these integers as indicated in the source data (MySQL table a9_questions).
Questions have two answers: If the first answer (a) is selected, you will increment or decrement one of the four variables. If the second option (b) is selected, you will increment or decrement in the opposite direction (1 becomes -1, -1 becomes 1).
When the test is complete, it will be scored as a 4-character string in the following order:

Example scores: ISFJ, ENTP, INTJ, ESFP ---

Notes/Hints:
The questions must be presented in a random order each time.
It might be useful to shuffle the questions beforehand or when the user starts the test.

----------

Creating the required mysql tables.

This will create the tables a9_questions and a9_tests.

----------

Variable f less than 0 f greater than or equal to 0 Sie I EE Issn N IF T P sip J

Explanation / Answer

<?php

   ob_start();

   session_start();

?>

the code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>

<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />

<title>

sample quiz code

</title>

<style type="text/css">

</style>

</head>

<body>

<?php

print '<form action="display_code_2.php" method="post">';

//sample interface question

print '<p>(1) when travelling to a place i have never been i prefer use </p>';

if ($_POST['answer1']=="a")

print '<input type="radio" checked="checked" name="answer1" value="a"/>nothing i never get lost<br/>';

else

print '<p><input type="radio" name="answer1" value="a"/>nothing i never get lost<br/>';

if ($_POST['answer1']=="b")

print '<input type="radio" checked="checked" name="answer1" value="b"/>a gps app written direction<br/>';

else

print '<input type="radio" name="answer1" value="b"/>a gps app written direction<br/>';

$correct++;

print '<p>(2) i honestly think of myself as</p>';

if ($_POST['answer2']=="a"){

print '<p><input type="radio" checked="checked" name="answer2" value="a"/>think skinned<br/>';

$correct++;

}

else

print '<p><input type="radio" name="answer2" value="a"/>think skinned<br/>';

if ($_POST['answer2']=="b")

print '<input type="radio" checked="checked" name="answer2" value="b"/>sensitive<br/>';

else

print '<input type="radio" name="answer2" value="b"/>sensitive<br/>';

print '<p>(3) The capital of Cambodia is</p>';

if ($_POST['answer3']=="a")

print '<input type="radio" checked="checked" name="answer3" value="a"/>Kuala Lumpur<br/>';

else

print '<input type="radio" name="answer3" value="a"/>Kuala Lumpur<br/>';

if ($_POST['answer3']=="b"){

print '<input type="radio" checked="checked" name="answer3" value="b"/>Phnom Penh<br>';

$correct++;

}

foreach ($_POST as $value){

if (isset ($value)){

$done++;

}

}

if ($done !=4)

print '<input type="submit" name="submit" value="check answers" /><br/><br/>';

if (($done > 0)&&($done < 4))

print 'You haven&#8217;t answered all the questions. Please finish the quiz and re-submit your answers.';

if($done==4){

if ($correct==0)

$correct="0";

print "Your score is $correct/3.<br/><br/>";

}

print '</form>';

?>

</body>

</html>

<?

   // error_reporting(E_ALL);

   // ini_set("display_errors", 1);

?>

<html lang = "en">

  

   <head>

      <title>Name.com</title>

      <link href="css/bootstrap.min.css" rel = "stylesheet">

    

      <style>

         body {

            padding-top: 40px;

            padding-bottom: 40px;

            background-color: #ADABAB;

         }

        

         .form-signin {

            max-width: 330px;

            padding: 15px;

            margin: 0 auto;

            color: #017572;

         }

        

         .form-signin .form-signin-heading,

         .form-signin .checkbox {

            margin-bottom: 10px;

         }

        

         .form-signin .checkbox {

            font-weight: normal;

         }

        

         .form-signin .form-control {

            position: relative;

            height: auto;

            -webkit-box-sizing: border-box;

            -moz-box-sizing: border-box;

            box-sizing: border-box;

            padding: 10px;

            font-size: 16px;

         }

        

         .form-signin .form-control:focus {

            z-index: 2;

         }

        

         .form-signin input[type="email"] {

            margin-bottom: -1px;

            border-bottom-right-radius: 0;

            border-bottom-left-radius: 0;

            border-color:#017572;

         }

        

         .form-signin input[type="password"] {

            margin-bottom: 10px;

            border-top-left-radius: 0;

            border-top-right-radius: 0;

            border-color:#017572;

         }

        

         h2{

            text-align: center;

            color: #017572;

         }

      </style>

     

   </head>

        

   <body>

     

      <h2>Enter Username and Password</h2>

      <div class = "container form-signin">

        

         <?php

            $msg = '';

           

            if (isset($_POST['login']) && !empty($_POST['username'])

               && !empty($_POST['password'])) {

                                  

               if ($_POST['username'] == 'name' &&

                  $_POST['password'] == '1234') {

                  $_SESSION['valid'] = true;

                  $_SESSION['timeout'] = time();

                  $_SESSION['username'] = 'name';

                  

                  echo 'You have entered valid use name and password';

               }else {

                  $msg = 'Wrong username or password';

               }

            }

         ?>

      </div> <!-- /container -->

     

      <div class = "container">

     

         <form class = "form-signin" role = "form"

            action = "<?php echo htmlspecialchars($_SERVER['PHP_SELF']);

            ?>" method = "post">

            <h4 class = "form-signin-heading"><?php echo $msg; ?></h4>

            <input type = "text" class = "form-control"

               name = "username" placeholder = "username = name"

               required autofocus></br>

            <input type = "password" class = "form-control"

               name = "password" placeholder = "password = chegg" required>

            <button class = "btn btn-lg btn-primary btn-block" type = "submit"

               name = "login">Login</button>

         </form>

                         

         Click here to clean <a href="logout.php" tite = "Logout">Session.

        

      </div>

     

   </body>

</html>

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote