You are here

The Use of Web-Based Quizzes with PHP and mySQL in High School Chemistry


Leonard C. Klein
Shenandoah Valley Governor's School
Fishersville, VA 22939

07/25/05 to 07/26/05

This paper discusses the authors attempt to provide better feedback on problem sets and a way to provide more different problems for students to work. All students need to learn how to work problems and need to know if their work is correct or not. The author provides one method and briefly discusses others available. Problems encounterd are also discussed. One may ask why one should go through all this work when there are products on the market that will do many of the same things for not much money. One answer is similar to why create your own labbook - using someone elses labbook is like using someone else's toothbrush. This allows one to ask questions the way you want and the way your students will see them on a test or quiz.




In an effort to provide my students with more practice working problems and instant feedback I have set up a website that uses PHP to deliver the problems and a mySQL database to keep track of progress as well as to keep data for the problems. This is only one of many options; ColdFusion and Access ,WebAssign and Blackboard are other common options. I chose PHP and mySQL because they are open source and I found a class at a local community college that offered a couple of classes on how to use these as. At the same time I found an inexpensive hosting service that uses PHP and mySQL.


With PHP I can generate questions that have numeric data randomly generated so that no two students will have the same questions. The mySQL database can be used to hold the data for the questions as well as the student data. Once the student has answered a question they can check their answer for correctness. My ultimate goal is not to quiz but to tutor. If one can use the data from an incorrect answer to diagnose student errors and then guide them through to the correct answer, the program would be of real value. My first step however is to simply quiz.





My first attempt at providing instant feedback was to use Flash, a Macromedia product with the Actionscript programming language. The following link will go to one of the problem pages. A screen snap is shown below. (




This was useful in that students could practice, but it lacks the ability to track the students progress. Since I want keep a record of what the students have done database connectivity is needed. The second step was to learn how to do this. One option is to use FlashMX Remoting which will send data from the FlashMX movie to a database; I did not find enough information on how to do this for me to implement this option. If I can't find two or three books on the topic I do not feel comfortable tackling the subject.


One of my fellow teachers sent me information on a class at Piedmont Virginia Community College (PVCC) on using PHP and mySQL and I was off. Having programmed some in ActionScript for FlashMX the programming was not too difficult, I had also taken a class in PERL a few years earlier so I felt comfortable with the process. I was also able to buy, inexpensively, a website that had gave me the capabilities to do PHP and mySQL work ( My work is in the early stages, but I will share what I have done so far. You will be welcomed with the following page:




This is the beginning stage of the project I have quizzes without tracking scores. As readers you may log in as ChemEd with a password of Trial and try what I have. Your login type will be student.


You will next find this page:



If you choose the Molar Concentration practice you will find the following:



In more readable pieces, the user information in the upper right corner:



There is excess information that is more for my use in debugging.


The question:



If the answer is incorrect the user gets


This provides some of the relevant data and the correct answer. The percent is the start of my work trying to track the students work.


If the answer is correct the following is shown:



Note that more data is shown here that is used to track the student.


The one quiz is shown next:


The welcome is generated by using Secession variables. This allows for tracking of the students and their work.



After answering the quiz the response is given below.



The Project:


The student will log in with an assigned name and password. They should change their password the first time they log in. Once in the student has a choice to work practice problems and eventually take quizzes. There is one quiz at the moment, shown above, this is more of a trial for me than a real quiz.


My next step is to take the practice quizzes and convert them to quizzes that will record the student's score. This will need a new attribute of how many times has the student tried to work the quiz. One piece of advice I received from a teacher who was using a commercial program was that she could get her students to work lots more problems if they could rework the quizzes until the got the grade they wanted. This is a bit different from WebAssign, the commercial package used at SVGS. In WebAssign the students are given a number of tries for each question. So if you can work one type of question you do not have to do that type again. Also in WebAssign the student gets one set of problems and always has that set. In the method I plan the student could get a different set each time they attempted. Also in the method I am planning the student would have to rework a full set of questions not just one type. There a pros and cons to both methods, but the student in either case is given feed back quickly and the ability to improve their grade.


In connection with recording quiz grades I plan is to make pre-tests and post-tests for each unit. These will have the answers recorded but no score returned to the students. The purpose is for my use in assessing what knowledge they bring to the topic and how the students progressed through the unit. Ultimately the pre- and post-tests will be combined with concept tests to determine what misconceptions the students bring to class and if the instruction has any effect on their understanding.


As can be easily seen this project is in the early stages of development. It is my goal to add to the programming each year and work toward a program that will also provide a tutorial feature.