Home Work Assignment 15 (due 14 Apr 2018)

Sessions

For this assignment you will use the quiz that you have worked with earlier. The correct answers are given in italics or parenthesis. The last time the grading was done on the client side using JavaScript. We saw earlier that this was not a secure way of grading. So in this assignment the grading will be done on the server side. There are several requirements to this assignment:

The first screen will be a login screen where the user types in his username and password. The username and password are kept in text file called passwd. The username and password are colon separated. If the user logs in correctly then the quiz is displayed one question at a time. The quiz is graded on the server side. Give 10 points per question. The results are appended to a text file called results. The format is username:score. The results are then conveyed to the user.

A user cannot redo a question by pressing the back button on his browser. If he tries doing that there will be a warning message. A user cannot take this quiz twice. He should finish the quiz in 15 minutes. If he takes the quiz and does not finish it he cannot take it again. His score will be whatever he got correct upto that point.

Instead of a logoff button delete the session state file at the end of the quiz or at the end of the time-out period.

Optional: As a first line of defence against someone trying to hack into your system block all login attempts after 5 invalid attempts from that remote IP address.

After you complete your PHP script add the information to the table that you created in your index or welcome page. I should see your links before 11 pm on Saturday, 14 Apr 2018. This is a time consuming assignment. You may work on this assignment with a partner but both of you must have separate entries in your index file. Do get started on this early!