How to prepare Quiz

Reply

Join Date: Nov 2008
Posts: 20
Reputation: Narayan15 is an unknown quantity at this point 
Solved Threads: 0
Narayan15 Narayan15 is offline Offline
Newbie Poster

How to prepare Quiz

 
0
  #1
Feb 17th, 2009
Hi,
I have created a database, a table and stored 3 questions in the table. I need to show the questions one by one to users. when first question is visible then while loop should wait until user click on submit button.

My Code is::
nclude("dbconnect.php");
$result=mysql_query("select * from English") or
die (mysql_error());
while ($row = mysql_fetch_array($result))
{
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>English Quiz</title>
<meta name="GENERATOR" content="Created by Narayankumar">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div id="bv_Text1" style="position:absolute;left:0px;top:0px;width:196px;height:32px;z-index:0" align="left">
<font style="font-size:27px" color="#000000" face="Arial"><b>Engilsh Quiz:</b></font></div>

<div id="bv_Text2" style="position:absolute;left:0px;top:52px;width:500px;height:16px;z-index:1" align="left">
<font style="font-size:13px" color="#000000" face="Arial"><? echo $row['QN']; echo ". "; echo $row['Q']; ?></font></div>

<form action="evalution.php" method='POST'>
<input type="radio" id="RadioButton1"" name="Q" value="A" style="position:absolute;left:0px;top:78px;z-index:2">
<input type="radio" id="RadioButton2"" name="Q" value="B" style="position:absolute;left:0px;top:110px;z-index:3">
<input type="radio" id="RadioButton3"" name="Q" value="C" style="position:absolute;left:0px;top:142px;z-index:4">
<input type="radio" id="RadioButton4"" name="Q" value="D" style="position:absolute;left:0px;top:175px;z-index:5">
<input type="submit" name="submit" value="Submit" style="position:absolute;left:39px;top:216px;width:75px;height:24px;z-index:10">

</form>

<div id="bv_Text3" style="position:absolute;left:33px;top:78px;width:201px;height:16px;z-index:6" align="left">
<font style="font-size:13px" color="#000000" face="Arial"><? echo $row['A']; ?></font></div>
<div id="bv_Text4" style="position:absolute;left:33px;top:110px;width:201px;height:16px;z-index:7" align="left">
<font style="font-size:13px" color="#000000" face="Arial"><? echo $row['B']; ?></font></div>
<div id="bv_Text5" style="position:absolute;left:33px;top:142px;width:201px;height:16px;z-index:8" align="left">
<font style="font-size:13px" color="#000000" face="Arial"><? echo $row['C']; ?></font></div>
<div id="bv_Text6" style="position:absolute;left:33px;top:176px;width:201px;height:16px;z-index:9" align="left">
<font style="font-size:13px" color="#000000" face="Arial"><? echo $row['D']; ?></font></div>
</body>
</html>
<?
sleep(10);
}
?>

Please help me what i need to change?
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 524
Reputation: Will Gresham is on a distinguished road 
Solved Threads: 86
Sponsor
Will Gresham's Avatar
Will Gresham Will Gresham is offline Offline
Posting Pro

Re: How to prepare Quiz

 
0
  #2
Feb 17th, 2009
Looks like you are trying to use PHP as a client-side script, not possible. You will need to add Javascript or buttons to new pages to reload the questions as PHP is server-side and is compiled to HTML before being sent to the client.
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 20
Reputation: Narayan15 is an unknown quantity at this point 
Solved Threads: 0
Narayan15 Narayan15 is offline Offline
Newbie Poster

Re: How to prepare Quiz

 
0
  #3
Feb 17th, 2009
Thanks for your reply.
please provide an example code of preparing quiz.
Questions should be showed one by one.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC