Assignment 1

Submission

Groups

Work in groups of size 2. Both members of the group get the same mark.

Marking

We will be looking for (among other things)...

Starter Code

Can be found here

Postgresql

You will be using postgresql for this assignment. Andrew Wang has this setup on a special database server for you. You can only reach this server from cs or cslinux. Postgresql database credentials: utorid/last 5 digits of barcode, excluding last three control digits. So for 21761012413912000 ... the password is 13912 ssh -Y [UTORID]@cs.utm.utoronto.ca psql -h mcsdb.utm.utoronto.ca -d [UTORID]_309 -U [UTORID] drop table appuser; create table appuser ( username varchar(20) primary key, password varchar(20), otherinfo varchar(20) ); \dt select * from appuser; insert into appuser (username, password, otherinfo) values('arnold', 'spiderman', 'something'); insert into appuser (username, password, otherinfo) values('jane', 'wonderwoman', 'another thing'); select * from appuser; select otherinfo from appuser where username='arnold'; select * from appuser where username='arnold' and password='zzzz'; select count(*) from appuser where username='arnold' and password='spiderman'; <ctrl-d> to quit

Outline

Your job is to create the iGetIt application outlined in the mockup. This application allows an instructor to create a class by providing a class name and a classroom secret code. The code is used to prevent voting for those not in the actual classroom. The students join the class by selecting the class and providing the code. Students can then click on either "i Get It" or "i Don't Get It" during the class. These clicks are recorded in the postgresql relational database. The current level of understanding is displayed repeatedly on the instructors console.

Page Flow For Instructor

Page Flow for Student

All Pages

References

Questions and Answers

Question:
Can we use a framework like bootstrap etc?
Answer:
No
Question:
How does a new user register?
Answer:
Forgot to put a link to 'register' on the main login page. This takes them to a something that looks like the profile page.
Question:
For templating the website, are we suppose to come up with ways to do that using vanilla php or can we use some sort of templating engine?
Answer:
Write your own. That is, try to have the structure of the webpages not repeat in code everywhere. The goal is to have single places to modify sitewide things.
Question:
Can we use Javascript?
Answer:
No
Question:
Can we modify the look, css of the website?
Answer:
Yes, but not for marks this time.
Question:
Will sanitizing SQL queries be expected, or considered extra features?
Answer:
Not sure what they are asking. You should use prepared statements. You should always check the inputs on the backend.
Question:
Should we validate in HTML?
Answer:
Yes.
Question:
What about semantic elements in HTML?
Answer:
Yes, try to use the HTML5 elements properly. HTML5 form elements properly, labels etc.
Question:
How do I connect to the db in php?
Answer:
$dbconn = pg_connect("host=mcsdb.utm.utoronto.ca dbname=[UTORID]_309 user=[UTORID] password=XXXXX"); where XXXXX is last 5 digits of barcode, excluding last three control digits. So for 21761012413912000 ... the password is 13912
Question:
Can I work alone?
Answer:
Yes, but you will be expected to achieve the same result.
Question:
Do I have to check inputs in the backend?
Answer:
Yes.
Question:
What if a user tries to register an account that is already registered?
Answer:
They should not be allowed to do that.
Question:
How do I list my extra features? How do I list the members?
Answer:
Please submit a file iGetIt/features.txt. I have added it to the iGetIt.zip, but you can just take this one and add the file yourself. Also, I already have the iGetIt/members.txt file.