PHP Assignment 3

Create a quiz that asks interesting questions of your target audience about any subject you choose. Your quiz should display correct and incorrect responses and calculate a score. You must use an include file for the questions and answers so that the questions can be changed. The quiz should contain from 5 to  10 questions; your program should allow for this variable number of questions.  At the end print a congratulatory message based on the following. If the student( quiz taker) scored above 9 out of 10 or better,  print excellet work and the student's name. If they get 8 out of 10, print good work, 7 out of 10 nice work, 6 out of 10 fair work, and 5 out of 10 or less print you need more practice.

To the above quiz. Make it so that the user can, through an html form element, enter the name of a test file and  the quiz then be displayed with this particular set of questions. The taker of the quiz should be given the same quiz results as above. The quiz should be able to handle a variable number of questions and answers and of course the PHP file that grades should do so as well. You may count as you create the questions or you may embed the question count in the "question include file." 

Keep in mind, that your grading program must know what answer file to associate with the question  file specified by  the ueser in the html form. I suggest that you use   the following approach: Name the answer key file the same as the qeustion file except for the word key is appended to the end of the question file name. Thus, your  PHP program that grades will know where to include the appropriate keys from. Make this program "robust" . That is, make sure that if the user enters an invalid test file that it will not "crash". Make sure you are  checking for the existance of the file and if it does not exists. then your program should prompt the user  for a valid file name ( echoed back to the users  screen via the PHP code that grades the questions before it attempts to grade any  questions which it does not have!)

Criteria for Evaluation of Assignment Two - 20pts each