Status of Project 2


Number 1

Picture 1: The Picture below is the first working part of my website. It is the login page of the website which allows the student or teacher to login to the website. In order to get to this page, from the home page you will click the tab called Login to be able to get to this page. Picture 2: The Picture below how you would create a quiz in the website. This section is only accessable for Admin/Teachers. There is a set limit on the amount of questions that can be created so it will stop the add question from working when the limit is reached. Once submited it will upload this into the database which will make it viewable to everyone.

Picture 1
Picture 2


Number 2

Block of code from Login


This block of code is from the login page. The section of code is the sql query that
is taken place to check if the user is valid. First the code queries the database
and checks if its in there. If not its will reload the login page. If its true, it
will then check if the name and password equal the one on the database and if
both are true, it will then set alot of SESSION varibles to store the user data
to be used through out the other web pages. Lastly there is a variable to check
if it is the first time the user is logging in. If it is, then it will update that
variable to 0 and redirect them to change there password. If that variable already
equals 0 than it will redirect them to the home page.

Most of my project is programmed in PHP, there is some html but its just there to
make it look good.

Amout of Code  
-----------------------
create.quiz.php  201
home.php      37
nav.php        65
change_pass.php 96
create_user.php 87
login.php     131
config.php     8
home.css     12
logout.php     13
tquiz.php     55
-----------------------
total       705



Number 3

An Interesting feature that I am currently almost done with is the way you create the quiz. It uses JQuery to dynamically add new questions to the page which I am able to set a limit to (currently it is 10). After this you fill in all the information and submit it, that is when the fun part happens. In the form all the questions, answers and the radois are stored in an array which is grabbed by php. I then have to check each varaible in the array and strip all the html tags and entities to just get the data that I need. After that I check to see if any field is empty in all the arrays which I flag as an error if there is a missing field in the array. I them decide from this data if it is correct and allow it to continue to be queried. I then Insert the Quiz name and its date created into its own table. I then need to query that Quiz in order to get the quiz_id. With that I insert the questions into ints own table using the Quiz_id so I know what questions goes to what quiz. This part is not working correctly yet, im still getting an sql error which I and currently figuring out.



Number 4

Currently my project is about 65% done. Once I can figure out this sql problem, which should not take me to long, I should be about 75% done. Whats left to do after this is to have the user take the quiz and stored the scores. As well as view the scores they have gotten from the quizzes they have taken. One interesting thing that I have learned so far is $_SESSION in PHP. This is a global variable that can store multiple valirables within it. Then you can access that data throughout all the webpages. It is very helpful with sql queries when I need some data from the User. I store it all in $_SESSION so i dont have to make a sql call to get it.