Homework 11: Simple APIs
- Due Oct 15, 2024 by 9:30am
- Points 1
- Submitting a website url
- Available after Oct 10, 2024 at 10:45am
Watch this video:
- Simple APIs (YouTube
Links to an external site.)
- the code from the video Links to an external site. (note that it's in a folder called "hw10"...ignore that)
Copy the html and php file from the video code linked above. Update the php code so that it creates just the QuizItems table we've gone over in class instead of Books (should have the columns: id, question, answer, created at, updated at). Replace the API with one that supports these actions:
- add a quiz item
- remove a quiz item (see the code to see how to use the DELETE command in SQL)
- update a quiz item (see the code to see how to use the UPDATE command in SQL)
Update the html file so that there is one form per operation above; customize the forms so they take the information required to perform the given operation.
You may use the db.php script we worked on in class (see the git repo here Links to an external site.) and update it to handle the database portion of things (not the converting to JSON bits).
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/hw11/
in your CSC302 git repo and push to GitHub. Submit a link to your the hw11 folder on GitHub to this Canvas assignment.