Home
|
Web Projects
|
Art Projects
|
Resumé
|
About


Portfolio
Javascript Animation Blackjack Trainer CSC Website Photo Album Flash Game
Dynamic Bar Graph My Computer Web Survey PHP Quiz FHS2000.COM



Developed For: Web Programming Class Completed In: 1 week
Technologies: PHP, MySQL Website Link: click here

For our final assignment in Web Programming Class, we had to choose a new web technology that we hadn't learned and present it to the class. My partner and I first chose to do a project on Microsoft's ASP language but once we found out that in order to run ASP pages, you need to have a Microsoft IIS server which the school didn't have, we knew we had to choose a different language. Eventually, we came up with PHP since the PHP module was akready loaded on BW's Apache Web Server.

Next, we had to decide what we wanted to do with our PHP project. After some time discussing this, we thought that it would be a good idea to first give some information on what PHP is and some simple examples and then show them a project that we developed using PHP. It was my partner's responsiblity to get the inforamtion about PHP and some simple examples and my job was to write up something more advanced. I chose to do an online quiz using PHP since I knew that this wasn't too difficult being that it was my first time using PHP.

I decided to do a quiz consisting of three questions where each question had a few choices for an answer, kept track of the number of times you submitted your answers, and how many you got right. I figured I could store the number of tries and the number correct in text files because opening and reading from text files in PHP is very easy. However, I would realize that text files weren't a good idea. More on that later.

After working on the quiz for a few days, it was finally complete and did everything I wanted it to. But I knew that we could go one step further and store all the person's name and the number of tries it took them to finish the quiz in a MySQL database. At the time, our class had just finished covering MySQL databases (connecting, inserting, updating, and deleting) so I knew if I could get the webpage connecting to a database that it would be something that none of the other groups would have. So with the help of my professor, I finally got the webpage talking to the database and everything was complete.

We had one day until we had to present our project when I realized that by storing the number of questions that were correct and the number of tries a person submitted their answer, that it allowed only one person to take the quiz at a time. If more than one person was taking the quiz, the results would be messed up because the page pulls the data out of the text files to determine what to display on the page. Therefore, in order to stop this, I created another text file that held a value if someone was taking the quiz and a different value if no one was taking the quiz. This way, only one person would be allowed to take the quiz at a time.

The presenation went well along with the demonstration of the quiz, until I had to explain why only one person could take the quiz at a time. If I had to redo the quiz, I would substitute storing the values in a database rather than a few text files which would allow more than one person to take the quiz at a time. At least I learned from my mistake.


Valid HTML 4.01! Valid CSS!