You will be creating a personal quiz that will provide a grade depending on the responses given. The quiz should contain at least three questions of the true/false or multiple-choice nature. You should select only one type of question to use. These questions should originate from Comprehension Check in your textbook (noting the chapter and page number) These questions and the correct answer identifier should be stored in a text file. A second table should contain the possible answers for the questions along with a unique identifier for each possible answer. You should pre-populate the text files with the questions or answers (depending on the text file).

Design Requirements

Creating the Text Files

When you create your text files, you should put one question on each line. Each question in the question text file should have a unique identifier in addition to the question text. The identifier will be used in the answer text file to denote which question that possible answer corresponds to. The question file will also have a denotation of the unique identifier of the correct answer. The answer text file will have unique identifier for each possible answer (one of which will correspond to the correct answer for the question in the question text file). In addition to the identifier, you will need to provide the text of the possible answer along with the identifier of the question that the answer belongs to in the question text file. This will help you correspond the question with the answers when working with the two files.

Creating the Functionality

The quiz must display in a form by pulling all the questions and their corresponding possible answers from their respective text files. Upon submission, your code should compare the response given for the question to the question's correct answer that is stored in the question text file. This will allow your code to compute a quiz grade. Your code should display all quiz questions regardless of how many questions are stored in the text file. Below is an example of an initial quiz display with questions and possible answers pulled from the text file (extra credit version is shown): see image.

Based upon the number of correct answers given, a grade should be computer through a user-defined function and provided to the user. If the score is:

  • 80% or better, the score output should display in green
  • 60% to 80% (not inclusive) the score output should display in yellow
  • 50% to 60% (not inclusive) the score output should display in red
  • Less than a 50% the output should display in black

Color specifications should be provided through the use of an external cascading style sheet.

Below is an example the graded quiz, displayed below the quiz questions on the output page: see image.

Further, even though not shown, include the Last Modified: date information on the output page. This should be outputted dynamically using the built-in date() function within the getlastmod() function. The output page should also include a link to get back to your input form page or to reset the page if a single.php file is utilized.

You should use XHTML for the content and layout of all pages, and external CSS for the stylizing of your page. Note that you do not need to implement your web site's common navigation and structural components (header and footer) or its CSS file into the practicum. Rather your application should be aesthetically consistent throughout and use a new external CSS file to make the output more aesthetically pleasing than shown.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.