multiple choice questions in PHP

  • viveknarula
  • Novice
  • Novice
  • viveknarula
  • Posts: 15

Post 3+ Months Ago

hi, this is my first post here in this forum. i have read many posts here i found them very useful. i want to ask is there any resource or website where can i found multiple choice questions on PHP. e.g. some code snippet in php is given with 4 choices. if anyone knows abt such kind of snippet please tell me.

i hope i explain my question cleanly enough.

Thnaks
  • gonzoka
  • Student
  • Student
  • gonzoka
  • Posts: 75
  • Loc: Bristol, UK

Post 3+ Months Ago

Do you mean a code snippet of an html form with 4 options that is processed by a php page?

e.g. you ask a question, the user picks one, and you store it?
  • viveknarula
  • Novice
  • Novice
  • viveknarula
  • Posts: 15

Post 3+ Months Ago

Thanks gon, for your interest.
actually i am looking for objective type (multiple choice questions) in PHP.

e.g. suppose u have given the code snippet echo count("125"); in php

there may be 4 choices of correct answer.

i want need these types of questions enhnace my PHP skills.

please reply soon.
  • Azoundria
  • Professor
  • Professor
  • User avatar
  • Posts: 907
  • Loc: Calgary, Alberta, Canada

Post 3+ Months Ago

You want a form you submit with 4 options? First create the form on one page:

PHP Code: [ Select ]
<html>
 
<head>
 
<title>Select a sword to craft</title>
 
</head>
 
<body>
 
<form action="process.php" method="post">
 
 <input type="radio" name="swordtype" value="wood">Wood Sword
 
 <input type="radio" name="swordtype" value="bronze">Bronze Sword
 
 <input type="radio" name="swordtype" value="iron">Iron Sword
 
 <input type="radio" name="swordtype" value="steel">Steel Sword
 
</form>
 
</body>
  1. <html>
  2.  
  3. <head>
  4.  
  5. <title>Select a sword to craft</title>
  6.  
  7. </head>
  8.  
  9. <body>
  10.  
  11. <form action="process.php" method="post">
  12.  
  13.  <input type="radio" name="swordtype" value="wood">Wood Sword
  14.  
  15.  <input type="radio" name="swordtype" value="bronze">Bronze Sword
  16.  
  17.  <input type="radio" name="swordtype" value="iron">Iron Sword
  18.  
  19.  <input type="radio" name="swordtype" value="steel">Steel Sword
  20.  
  21. </form>
  22.  
  23. </body>


Then put the code to process it in process.php:

PHP Code: [ Select ]
<?php
 
//This code is placed in process.php to process the form.
 
 
 
$swordtype = $_REQUEST['swordtype'];
 
echo "You picked the " . ucfirst($swordtype) . " sword. \r";
 
?>
  1. <?php
  2.  
  3. //This code is placed in process.php to process the form.
  4.  
  5.  
  6.  
  7. $swordtype = $_REQUEST['swordtype'];
  8.  
  9. echo "You picked the " . ucfirst($swordtype) . " sword. \r";
  10.  
  11. ?>


Need anything else?
  • knexor2
  • Proficient
  • Proficient
  • User avatar
  • Posts: 445
  • Loc: US

Post 3+ Months Ago

viveknarula wrote:
Thanks gon, for your interest.
actually i am looking for objective type (multiple choice questions) in PHP.

e.g. suppose u have given the code snippet echo count("125"); in php

there may be 4 choices of correct answer.

i want need these types of questions enhnace my PHP skills.

please reply soon.


So you want a multiple-choice quiz on the PHP language that you can take to improve your PHP skills?
  • viveknarula
  • Novice
  • Novice
  • viveknarula
  • Posts: 15

Post 3+ Months Ago

yes, Thanks knexor2,
understanding is very good. he understood what i want
  • Azoundria
  • Professor
  • Professor
  • User avatar
  • Posts: 907
  • Loc: Calgary, Alberta, Canada

Post 3+ Months Ago

Ok. Sorry. Try These:

http://www.wellho.net/quiz/phpquiz.html

http://www.developingwebs.net/phpclass/mindysquiz.php

http://phpquiz.co.uk/

http://www.w3schools.com/php/php_quiz.asp

There's tons. All you had to do was google 'PHP Quiz' to find them.
  • jewel1989r
  • Born
  • Born
  • jewel1989r
  • Posts: 1

Post 3+ Months Ago

Hello, I also find a php quiz script. that count results, time, percentage of result, arranged by category.. like....

1. Site admin will add new quiz in database by category.
1. Each page or category shows 20 multiple questions for user to answer.
3. After Submit user will see the total result.

Please give me a solutions. Thanks

Post Information

  • Total Posts in this topic: 8 posts
  • Users browsing this forum: No registered users and 43 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.