Homework 9: PDO—PHP Data Objects
- Due Oct 13, 2022 by 9:30am
- Points 1
- Submitting a website url
- Available after Oct 11, 2022 at 10:45am
Watch these videos:
- Install SQLite PDO (Windows only) (YouTube Links to an external site.)
- PHP Data Objects (YouTube
Links to an external site.)
- the code from the video: pdo.php Links to an external site.
Make a copy of pdo.php
and call it admin.php
—this will be the quiz administration page for Quizzer. Update the code so that it handles adding new question-answer pairs to (if any are passed in via POST) and displaying the question-answer pairs from the QuizItems table we talked about in class. It doesn't need to handle removing or editing quiz questions, only adding new ones.
Make another copy called quiz.php
that does the following:
- on every load:
- generates a form with an input per question in the database
- displays all of the data from the Submissions and QuizItemResponses tables (which should have the same schema we designed in class)
- if a submission was made via POST, that submission should be graded based on the current questions and answers in QuizItems and added to the Submissions / QuizItemResponses tables
Remember, to get credit for the homework, you don't have to have solutions that are 100% complete and working; I want to see that you made an effort to get them working so you can ask informed questions in class and so that when we go over and extend the homework in class, you have some working context for what we're doing.
Commit your two PHP files in a folder homework/hw9/
in your CSC302 git repo and push to GitHub. Submit a link to your the hw9 folder on GitHub to this Canvas assignment.