954,597 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

.how do i start developing an online examintation? HELP!

.guys i'm starting a new project. an online examination using PHP and an online database phpMyAdmin.
.the exam is consisted of questions which can be answered by choosing one of the four answers. what i want to do is either use dropdown menu or multiple radioboxes when picking answers.
of course there should a submit button which when clicked submits the selected answer and checks the database whether it is correct or wrong. after answering all of the questions a result page should be displayed.

.if anybody could guide me on doing this project then it would be much appreciated. thank you in advance!

.please help me as i am only a beginner on using PHP and mySql programming languages.

zerey02
Newbie Poster
19 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

This project is not difficult to do. Here are a few tips to get you started.

1. Start out by creating a table with the unique_id, the question, the four options, the question type (Drop Down or MCQ) and the correct answer.

2. Decide on whether the questions will be entered into the database directly or by the user using a form. If it is to be through a form then you have to create a form for putting in these questions.

3. Create the Q&A page. This can be done by looping through your db of questions and echoing the required ones along with the choices on the page, in a form

4. Create the processing script to accept the answers from point 3 and compare them to those in the DB to check the answers and calculate the score.

Start out with the code. If you get stuck, post the problem you are stuck with here. There are several of us who will hep you out and get you on your way.

All the very best.

sudeepjd
Junior Poster
181 posts since Oct 2010
Reputation Points: 32
Solved Threads: 43
 

This project is not difficult to do. Here are a few tips to get you started.

1. Start out by creating a table with the unique_id, the question, the four options, the question type (Drop Down or MCQ) and the correct answer.

2. Decide on whether the questions will be entered into the database directly or by the user using a form. If it is to be through a form then you have to create a form for putting in these questions.

3. Create the Q&A page. This can be done by looping through your db of questions and echoing the required ones along with the choices on the page, in a form

4. Create the processing script to accept the answers from point 3 and compare them to those in the DB to check the answers and calculate the score.

Start out with the code. If you get stuck, post the problem you are stuck with here. There are several of us who will hep you out and get you on your way.

All the very best.

.thanks dude! i think i'm going to start this by creating the quiz page.. what i need to know is how to fill an array with records from a database.

zerey02
Newbie Poster
19 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

Are you able to connect to the db?

Once you get that, you can use mysql_query to get the data from a table into a recordset. From here, use mysql_fetch_array() to get each record one after the other using a while loop. So the code would look like this

$sql="SELECT * FROM QUESTIONS";
$result=mysql_query($sql);
while ($row=mysql_fetch_array($result)){
   echo $row['question'];
}


The above is just an example. You will need to change the code to suite your application.

sudeepjd
Junior Poster
181 posts since Oct 2010
Reputation Points: 32
Solved Threads: 43
 

.sir why haven't you replied to my previous message?

zerey02
Newbie Poster
19 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

The easiest way would be assigning the correct answers to some variables, get the user input from a form and compare the input with the correct answers.
if the answer is true then you could add some points ($grade++)

then echo the final score

of course there are better ways to do that.

terabyte
Junior Poster in Training
68 posts since Oct 2010
Reputation Points: 10
Solved Threads: 4
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: