0% found this document useful (0 votes)
62 views4 pages

COS60007 Assignment 2

This document outlines Assignment 2 for the course COS60007 Creating Web Applications and Databases. Students are tasked with extending a website created in Assignment 1 by adding server-side PHP scripts to process and store online test data in MySQL tables. This involves creating a test attempts table, using PHP to mark test attempts and save scores, and creating a webpage for supervisors to view, update, and delete test attempts. Up to 20% additional marks can be earned for enhancements to the basic requirements. Students must submit their work through Canvas and demonstrate their assignment in the assigned tutorial.

Uploaded by

Sanam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views4 pages

COS60007 Assignment 2

This document outlines Assignment 2 for the course COS60007 Creating Web Applications and Databases. Students are tasked with extending a website created in Assignment 1 by adding server-side PHP scripts to process and store online test data in MySQL tables. This involves creating a test attempts table, using PHP to mark test attempts and save scores, and creating a webpage for supervisors to view, update, and delete test attempts. Up to 20% additional marks can be earned for enhancements to the basic requirements. Students must submit their work through Canvas and demonstrate their assignment in the assigned tutorial.

Uploaded by

Sanam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Swinburne University of Technology

Faculty of Science, Engineering and Technology


COS60007 Creating Web Applications and Databases

Assignment 2
PHP + MySQL

10am on Monday in Week 12


Due Date
(Late submission penalty: 10% per day)

Canvas
Submission Method
Mercury Server (mercury.swin.edu.au)

Demonstration in Your Tutorial in Week 12


Assessment Date (No detailed feedback will be provided to students who failed to
demonstrate their assignments in the tutorial.)

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.

2. Basic Requirements (80%)

[IMPORTANT] Use only mysqli commands in this assignment.

1.1 Use PHP to reuse common elements in your website


PHP provides us with techniques to modularise and reuse our web application code. You need to
refactor your web pages so that common static HTML elements such a menu, header and footer are
written in common text files which are then included into your webpages.

[IMPORTANT] Name the include file(s) with an .inc extension and but don’t forget to rename
your main pages with a .php extension.

1.2 Create a test Attempts Table


Create a table attempts in your MySQL database. The information in each attempt record should
include the following fields with appropriate data types:
• attempt id (auto-generated primary key)
• date and time of the attempt (generated by PHP)
• first name
• last name
• applicant number
• the number of the attempt (1 -3)
• score for the attempt

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.

1.3 Marking the Test (marktest.php)


Adapt the test form (test.html) you developed in assignment 1 to add test attempt records to
the attempts table. This form should submit the data to a php webpage called marktest.php.
This php webpage will calculate the number of correct answers in user’s attempt and save it in the
corresponding record in attempts table.

1.4 Test Supervisor Webpage (manage.php)


Create a webpage with a link on the menu that allows a supervisor to make the following queries of
the attempts table:
• list all attempts.
• list all attempts for a particular student (given a student id OR name).
• list all applicants (id, first and last name) who got 100% on their first attempt.
• list all applicants (id, first and last name) got less than 50% on their third attempt.
• delete all attempts for a particular applicant (given an applicant id).
• change the score for a test attempt (given an applicant id).
Create appropriately named html/php pages to implement access to the quiz supervisor page and its
queries.

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.

COS60007 Creating Web Applications and Databases – Assignment 2 Page 2 of 4


• Provide the test supervisor with the ability to select the field on which to sort the order in
which the test attempt records are displayed.
• One or more enhancements of your own devising. If you plan such enhancements it would be
worthwhile checking with your tutor first to ensure they are appropriate and non-trivial.

You must have an enhancements.html or enhancements.php page that lists the


enhancements you have implemented. For each enhancement, include:
• a brief description.
• a hyperlink to where the enhancement is implemented.

A maximum of 2 enhancements will be assessed. Up to 10 marks will be given per enhancement


type. The number of marks you receive for a CSS animation will be at the sole discretion of your
tutor/marker. High marks will not be given for trivial enhancements.

[IMPORTANT] Any enhancements that are not listed on the PHP enhancements page will not be
assessed.

4. Website Folder Structure and Deployment Requirements


Create a website structured as specified in assignment 1.

[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.

COS60007 Creating Web Applications and Databases – Assignment 2 Page 3 of 4


Student ID: _________________________
Student Name: _________________________

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   

Other (deduct 2 marks up to 5 for each)


Requirement Not Fulfilled
- Fully validated HTML5 
- Appropriate meta-data 
- Adequate comments 
- Uses only mysqli commands 
- Directory Structure as specified 
- Only relative links used 
… other requirements not specified 

COS60007 Creating Web Applications and Databases – Assignment 2 Page 4 of 4

You might also like