COSC2413_Assignment2
Page 1 of 6
RMIT Classification: Trusted
Web Programming
COSC2413 (Semester 2, 2021)
Assignment 2
Assessment
Type
To be attempted individually.
Submit online via Canvas → Assignments → Assignment 2.
Marks awarded for meeting requirements as closely as possible. Clarifications/updates may be
made via announcements/relevant discussion forums.
Due Date Week 11, Friday 8th October 2021, 5:00 pm (note the time)
Marks 40
1. Overview (you must read this first)
You are to attempt this assignment individually, no group work is allowed. You will use PHP and MySQL to create the
server-side part of a website; jQuery, Bootstrap, AJAX and REST will be used to author various components of the
website.
The tasks are divided into four parts: PA (Pass), CR (Credit), DI (Distinction) & HD (High Distinction).
The DI & HD section tasks will require independent research, you will not get straight answers in the
course material. While we are happy to assist you on those tasks, most of the work and research must
be done by you. This is done on purpose to prepare for you future work and rigours of the IT industry.
If you find a specification open to interpretation, post a query identifying the specification in the corresponding discussion
board for assignment 2. Software development in real life does not come with a definitive roadmap and flowcharts
complete with instructions. More often than not, it is the job of the developer to clarify requirements from the client. For
the purpose of this assignment and course, the lecturer is considered as the client.
All of us have been affected by the unfortunate COVID-19 scenario and its aftermath. It is often hard to concentrate
and study online; but as a student enrolled in this course, it is your responsibility to regularly attend online session(s).
1.1 Watch the online recordings, practise examples from lectorial and lab(s) on a regular basis if you cannot attend
the live sessions.
1.2 Bring your questions to online discussion board, consultation sessions
1.3 Do NOT start the work on assignment at the last minute.
1.4 If you are seeking an extension of seven calendar days or less (from the original due date) you must apply at
least one working day before the assessment deadline. Extensions can only be granted for personal and
medical reasons, provided you can supply some evidence.
2. Learning Outcomes
This assessment relates to all of the learning outcomes of the course which are:
• CLO 1: understand modern languages, constructs used on the Web (such as HTML5, Advanced CSS, JavaScript)
• CLO 2: explain the functions of clients and servers on the Web, and describe the strengths and weaknesses of the
client-server internet approaches to web design and implementation
• CLO 3: program, access, and manipulate data through the adoption of accepted standards, mark-up languages,
client-side programming, and server-side programming
• CLO 4: design and implement an interactive web site(s) with regard to issues of usability, accessibility and
internationalisation
• CLO 5: design and implement a client-server internet application that accommodates specific requirements and
constraints, based on analysis, modelling or requirements specification
Page 2 of 6
RMIT Classification: Trusted
3. Assessment details
The local council has accepted your prototype of the client-side LIFE (Living It Fully Everyday) website. Now they are
clearer about the remaining features of the website. They do want you to make some changes in the client-side version
so that the final website can cater to the needs to the target audience. One big change is to provide myServices page
available to logged in users only. Further changes are enlisted in the tasks section of the assignment.
Upon detailed discussion with stakeholders, business analyst comes up with the following important points of
consideration-
PLEASE READ THESE CAREFULLY BEFORE YOU BEGIN
3.1 Create a directory a2/ inside ~/public_html/wp and copy all assignment 1 files inside a2/ directory and do
not touch a1/ directory as it is being marked.
3.2 All the data must be stored inside MySQL database. You must only use the Cloud MySQL database accounts
provided to you- use of personal/local databases will fetch you ZERO for the whole assignment.
3.3 You will get a ZERO for using other formats such as .txt, .csv, etc . This means that all backend data must be saved
into database and not files.
3.4 All user inputs in form(s) must be sanitised and checked for malicious input to avoid XSS (Cross-site scripting attack)
3.5 You must host your website using the following URL scheme:
https://titan.csit.rmit.edu.au/~s1234567/wp/a2/index.php (where s1234567 is your
student id and titan can also be jupiter or saturn.
3.6 Header, footer and navigation bar (any such repetitive code) should be stored inside separate fragment include
files- these should be included on all pages using PHP’s require_once() function. Fragment files should be
stored inside a2/includes directory
3.7 Bootstrap CDN (Content delivery network) should be used to enable the use of bootstrap library
3.8 If you make use of any 3rd party Bootstrap or jQuery plugin, store them inside a2/plugin directory
3.9 All assets (images | audio | video) files must be stored inside a2/assets directory. All assets must be sourced
from royalty free websites such as: pictures and videos (https://www.pexels.com/), icons
(https://www.flaticon.com/) and avatars (https://uifaces.co/).
3.10 Do not use XAMPP/local installations of PHP and MySQL to write the code. The version of PHP hosted at RMIT’s
servers is different as compared to these local installations. Besides, it will be hard to move data from local MySQL
installation to Cloud MySQL database used for this course. You will end up getting a ZERO if your code does not
work on RMIT server and Cloud MySQL database.
Page 3 of 6
RMIT Classification: Trusted
4. Tasks
PA part [20 marks]
NOTE: Before you start, download the supplied SQL files and execute them in your MySQL database via phpMyAdmin
site https://www.databaseaustralia.com/phpmyadmin/ – this will create the database tables and some sample data.
a. (5 marks) Header, footer and navigation bar (any such repetitive code) should be stored inside separate
fragment include files- these should be included on all pages using PHP’s require_once() function. Fragment
files should be stored inside a2/includes directory.
b. (2 marks) Add a jQuery carousel plugin on the home page. Please source a free, well-documented third party
jQuery plugin for this specification. The carousel must be placed on the top of the home page – either in the
header sestion or below it. It must display four different images relevant to the LIFE website.
c. (3 marks) Remove the HTML5 validation from Contact us form and use jQuery validation plugin to perform the
following validations:
all fields must be necessary and email must in proper format.
d. (6 marks) Registration form from assignment 1 now requires major changes. Please read the following
carefully and implement the following workflow using PHP-MySQL:
1. Remove all the client-side validation code from assignment 1 and perform all the validations (this
means all the validations mentioned in assignment 1- page 4 for this form) on server-side via PHP.
2. Introduce an additional field- Password in the registration form and create a regular expression to
validate password field. The password must
o start with a capital alphabet character,
o must have at least 8 characters
o must have a hyphen or underscore (i.e. – or _) and
o must end with a number.
As an example: Xdvd_pl3, Hello-12 are both valid passwords.
3. Upon successful server-side validation, all the form data must be stored in MySQL ‘user’ table. A
welcome message must be shown showing the success of registration page and asking the user to log
in OR the user may be automatically logged in upon registration. Both of these are acceptable
solutions.
e. (4 marks) Add a separate login page OR login form in the header that allows all registered users to log in. The
form will check for the validity of user credentials against the data stored in MySQL ‘user’ table.
Username = email in registration form, Password = password field in registration form. Upon successful
validation and login, the following workflow must be implemented using PHP-MySQL:
1. user will land on a myServices page. This page is only accessible to logged in users. The page must
greet user with Welcome message, such as Welcome XYZ to your services page…. (where XYZ is the
name)
2. myServices page link will appear in sitemap as well- but if a non-logged in user clicks on this link, they
must be asked to log in.
3. Add a logout link on myServices page. Clicking on this link will logout the user and send them to login
page.
Page 4 of 6
RMIT Classification: Trusted
CR part [8 marks]
f. Implement myServices page using PHP-MySQL as follows:
1. user will now be offered a choice to select one of the services- each of these will be represented by an
icon:
Yoga Meditation Stretching Healthy habits
Note: Above icons have been obtained fromn royalty free website: https://www.flaticon.com/ – you are
may search for alternative free icons or use Google Fonts or Font Awesome libraries.
Services themselves are now stored in MySQL tables ‘service’ and ‘service_instruction’.
2. Clicking on yoga icon will present user a form/place that will enable them to input type of yoga exercise,
as an example- beginner, intermediate or advanced. Upon the submission of form, appropriate video
tutorial may be shown to the user.
3. Clicking on meditation icon will present user a place to input type of meditation such as audio or video.
Upon the submission of form, appropriate video tutorial may be shown to the user.
4. Clicking on stretching icon will present user a place to input amount and type of stretching exercise to be
done. As an example, duration, type of stretches, etc. Upon the submission of form, appropriate video
tutorial may be shown to the user.
All of the above user information (email, service and type, date and duration) must be stored in MySQL table
‘user_service’.
Healthy habits service is not to be implemented for Credit part.
DI part [4 marks]
g. Implement the healthy habits services as decribed below-
Remove the personalised healthy habit meal planner JavaScript code from assignment 1.
You are to implement a peronalised meal planner with at least two types of diet recommendations using PHP
and MySQL.
You can choose to implement either the meal plan being auto-generated after selecting a diet type or create a
UI allowing the user to manually add / remove meal items to create a meal plan themselves.
The meal items and user meal plan must be stored in MySQL tables ‘meal’ and ‘user_meal’.
Note: For simplicity only a single meal plan is required to be tracked per user, meaning a user does not need to
be able to have multiple different meal plans at once.
Page 5 of 6
RMIT Classification: Trusted
Note: for the following HD section, you will need to do some research of your own and find out answers.
HD part [8 marks]
Create a separate admin portal / dashboard website that will enable an admin in the local council to monitor user data.
This website should be hosted on a separate Url as:
https://titan.csit.rmit.edu.au/~s1234567/wp/a2/admin/portal.php
h. (2 marks) The look and appeal of the portal website should be different to the LIFE website. It should be a fully
responsive PHP page. The responsive design must be implemented using Bootstrap. Use of CSS is not
allowed. At this stage, no admin username and password is needed. Admin can access all features of
dashboard without logging in. No suggested user interface is available, think of an appropriate layout of this
page on your own.
Fetch Melbourne’s weather via a free REST web service and display it on the Admin portal page header
section with an appropriate welcome message depending upon the weather.
i. (2 marks) The dashboard will display a list of registered users in a drop down box- these must be read from the
database table- ie you should not hard code the name of the registered users.
Upon choosing a user, admin should be presented with an AJAX-enabled search feature on the services
utilised:
Select a service type utlised:
If admin leaves the search box empty, all four service icons should be displayed as above. However, if they add a
search, only that icon should be displayed, as an example- meditation should only display meditation service icon,
etc.
The search would work on both partial and full texts. It should be case insensitive.
j. (4 marks) Upon choosing a particular service, the dashboard should display a detailed statistics with an
appropriate chart to show the details for that service utilized, such as: when, how often, type, how much, etc.
You will have to read these from MySQL database.
Pure text displays will fetch no marks here, you are allowed to use a third party plugin (jQuery, Bootstrap or
any other) to display the user statistics in a detailed visual format. Do some research and create a professional
visual repersentation of user services.
Page 6 of 6
RMIT Classification: Trusted
5. Submission
• Zip all website files and README.txt file and submit single zipped archive with .zip extension via Canvas
submission link for this assignment.
• README file must contain the hosted URL of your website.
• If the website is not functioning on hosted URL or it has not been hosted, you will be marked on your code and
in that case, you will only receive 50% of the allocated marks to the task. Make sure that your assignment can
run only with the code included in your zip file!
After the due date, you will have 5 business days to submit your assignment as a late submission. Late submissions will
incur a penalty of 10% per day. After these five days, Canvas will be closed, and you will lose ALL the assignment marks.
Assessment declaration:
When you submit work electronically, you agree to the assessment declaration:
https://www.rmit.edu.au/students/student-essentials/assessment-and-results/how-to-submit-your-assessments
6. Academic integrity and plagiarism (standard warning)
Academic integrity is about honest presentation of your academic work. It means acknowledging the work of others while
developing your own insights, knowledge and ideas. You should take extreme care that you have:
• Acknowledged words, data, diagrams, models, frameworks and/or ideas of others you have quoted (i.e. directly
copied), summarised, paraphrased, discussed or mentioned in your assessment through the appropriate
referencing methods,
• Provided a reference list of the publication details so your reader can locate the source if necessary. This includes
material taken from Internet sites.
If you do not acknowledge the sources of your material, you may be accused of plagiarism because you have passed off
the work and ideas of another person without appropriate referencing, as if they were your own.
RMIT University treats plagiarism as a very serious offence constituting misconduct. Plagiarism covers a variety of
inappropriate behaviours, including:
• Contract cheating- paying someone to do your work
• Failure to properly document a source
• Copyright material from the internet or databases
• Collusion between students
• Posting assignment tasks on technical forums (reddit, stack exchange, etc.) and asking for solution(s)
For further information on our policies and procedures, please refer to:
https://www.rmit.edu.au/students/student-essentials/assessment-and-results/academic-integrity
7. Marking Guidelines
The marks allocated have been added to each of the tasks. Please read rubrics for details.