COS60007 Assignment 2
COS60007 Assignment 2
Assignment 2
PHP + MySQL
Canvas
Submission Method
Mercury Server (mercury.swin.edu.au)
Contribution to Final
10%
Assessment
1. Purpose
In this assignment you will extend the website you developed in assignment 1. You will create
server-side PHP scripts to process and store the online test data sent from the form on
test.html. It will involve the creation of simple MySQL tables to store and update information
retrieved from your website.
In addition, you will create a webpage that allows a test supervisor to view, update and delete
test attempts.
There will also be an opportunity to enhance your website beyond the above basic requirements.
[IMPORTANT] Name the include file(s) with an .inc extension and but don’t forget to rename
your main pages with a .php extension.
When a user submits a test attempt to the website, if an attempts table does not already exist in
your database it should be programmatically created by your code.
3. Enhancements (20%)
Marks will be allocated to enhancements of your choice that go beyond the basic requirements. In
this assignment, we will consider only PHP and MySQL enhancements. You are encouraged to be
creative in thinking up possible enhancements.
Examples of PHP / MySQL enhancements you might make perfectly that will contribute a higher
mark include:
• Store quiz questions in a database table and have the HTML dynamically created by PHP. Use
this table to also store correct answers so responses can be marked without hard-coding.
• Normalise the structure of the data tables by, for example, creating separate student and
attempt tables. Creating a primary-foreign key link between these tables.
• Create a table that stores unique user-ids and passwords for test supervisors. Access to the
supervisor web page should only be granted if a correct user name and password are entered.
• Provide more secure access to the supervisor page. Have access to the website disabled for
user a period of time on, say, three or more invalid login attempts. Create a log out page with
a link from the manage web page. Ensure the supervisor’s webpage cannot be entered
directly using a URL after logging out.
[IMPORTANT] Any enhancements that are not listed on the PHP enhancements page will not be
assessed.
[IMPORTANT] All links to your files should be relative. Do not use absolute links, as these links will
probably be broken when files are transferred for marking. No marks will be allocated if links are broken.
5. Assignment Submission
An electronic copy of your assignment should be submitted through Canvas on or before the
deadline. Another identical electronic copy of your assignment must also be uploaded onto the
mercury server.
• Make sure all your files are in the correct folders and compress your root folder with all your
sub-folders with HTML, CSS, PHP and image files into a zip file named “assign2.zip”. Submit
this to Canvas. When the zip file is decompressed, the entire website should be able to be run
from index.html without needing to move any files.
• You can submit through Canvas for a maximum of 5 times. Your last submission will be
marked.
• Note that all deliverables must be submitted as softcopy. There is no need to submit an
assignment cover sheet.
6. Demonstration Procedure
Your tutor will download your submission from Canvas, examine how the website works and looks
and how it is written.
1. Make sure you attend your allocated tutorial. You will demonstrate your assignment to the tutor
in your allocated Tutorial in Week 12.
2. You will demonstrate how you have implemented the website according to the items listed on
the mark sheet.
3. Your tutor will not mark your assignment in the tutorial. Final results are to be released later
from Canvas.
Mark Sheet
Basic Requirements (tick box iff the requirement is fully met)
Menus and other common elements fully imported from include file ( 10 marks each tick)
attempts table ( 10 marks each tick)
- schema can store the necessary information with appropriate data types
markquiz.php ( 5 marks each tick)
- text data inputs sanitised
- score correctly calculated
- table automatically created if does not exist when accessed
- attempt correctly added to table
- on successful submission of test, page displays with required information including conditional retry
hyperlink
- page returned to the user with appropriate error information on unsuccessful submission (e.g., an answer
was not completed, etc.)
manage.php ( 5 marks each tick)
• HTML page and table well presented
• list all attempts for an applicant given id or name
• list all applicants (id, first and last name) with:
- 100% correctness on their first attempt
- less than 50% correctness on their first attempt
• delete all attempts of a particular applicant (given applicant id)
• change the score for a quiz attempt (given id)
Enhancements
Properly Properly
Enhancement Linked to Implementation on Website
Implemented Described
1
2