PHP The Instructions We have been looking at ways of "remembering" or storing values on the server for the user in-between page requests. This is called managing the state. For this assignment, you...

PHP The Instructions We have been looking at ways of "remembering" or storing values on the server for the user in-between page requests. This is called managing the state. For this assignment, you will be demonstrating your abilities to do this. You need to make an online trivia game. Remembering the state is key to making this work. trivia.php trivia.php will display a trivia question (from a text file) and provide a form with a textbox for the user to type their guess. The form will submit back to itself (trivia.php). You will load your trivia questions from the provided triviaQuestions.zip file. Please note that there is one question and answer per line. These are separated by a \t character. Your program needs to allow for any number of questions in trivQuestions.txt. You must use the session to manage the game progress data. You will start by displaying the first question to the user, and after they give a non-empty response, move on to the second question, and so-forth. Provide a progress indicator to the user. For example: Question 6 of 8. When the user has completed all the questions, display a table for the results. Each row of the output table will contain the question number, the question text, the correct answer, and the answer the user typed. If the user got it correct, change the background-color of the row to light green, else change the background color to light red. Display the percentage of answers that they got correct. At any time the user can restart the game by clicking a hyperlink labeled Restart. This will bring them back to the first question, and 0 their score. Things to note : a.clean code b. meaningful comments header and inline c. bootstrap employed for styling page, form, and result table d. successfully load questions from txt file and allow for any number of questions e. data validation on responses (non empty responses) - the user SHOULD be able to type their answer in upper or lowercase f. html table showing question text, question number, correct answer and the answer the user entered g. proper row background colors h. display correct answer percentage i. hyperlink to restart game j. At any point the user should be able to change the basic theme (background color, text color, font size) page using a drop down list. I would like to see a high-contrast option for the visually impaired, as well as two (2) other tasteful color combos. Use a cookie for this, set the expiry date far in the future so it will hang around a while, or until the user clears their cache. Changing the color scheme here should NOT affect game play or progress.
May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here