educratsweb@mail.com

+91

📂 Register 🔒 Login
PHP CODE FOR ONLINE QUIZ #EDUCRATSWEB

Php code for Online Quiz

One Question will appear on a screen when user select the option and click on next question another question appear on screen and after all opting the answer user will click on finish online test then quiz result report will be appear on screen .

Quiz.php

 

 

 

<? include("db_mysql_connect.php"); ?>

<div id="heading">Online Quiz</div>

<br />

<form name="quiz" method="post" action="quiz.php">

  <? if($_POST["do"]=="finish")

{

$rans=$_POST["rans"];

$tq=$_POST["tq"];

$end=$_POST["end"];

$startposition=$_POST["startposition"];

echo "<table cellpadding='5px' align='center' style='border:1px solid silver' width='80%' bgcolor='green'>";

echo "<tr><td>Total Question Attempt</td><td>",$tq,"</td><tr>";

echo "<tr><td>Correct Answer</td><td>",$rans,"</td></tr>";

echo "<tr><td>Wrong Answer</td><td>",$tq-$rans,"</td></tr>";

echo "<tr><td>Correct Answer Percentage</td><td>",$rans/$tq*100,"%</td></tr>";

echo "<tr><td>Wrong Answer Percenntage</td><td>",($tq-$rans)/$tq*100,"%</td></tr>";

echo "</table><br><br>";

$query="select * from quiz where qid<='$end' and qid>='$startposition'";

echo "<table cellpadding='5px' align='center' style='border:1px solid silver'>";

echo "<tr><th colspan='4' id='heading'>Online Quiz Test Question</td></tr>";

$result=mysql_query($query);

while ($row = mysql_fetch_array($result)) {

 echo "<tr><td>",$row[0],"</td><td colspan='2'>",$row[1],"</td></tr><tr><td></td>";

echo "<td colspan='2'>A. ",$row[2],"</td>";

echo "<td colspan='2'>B. ",$row[3],"</td></tr>";

echo "<tr><td></td><td colspan='2'>C. ",$row[4],"</td>";

echo "<td colspan='1'>D. ",$row[5],"</td></tr>";

echo "<tr><td colspan='4' align='right' style='color:orange'>Correct option is ",strtoupper($row[6]),"</td></tr>";

echo "<tr><td colspan='4' align='right' style='color:orange'><hr></td></tr>"; 

 }

 echo "</table>";

 echo "<p align='right'><a href='#' onclick='window.print()'>Print</a></p>"; 

 echo "<div style='visibility:hidden;display:none'>";

}

?>

 <table cellpadding="5px" width="100%" style="border:1px solid silver">

 <?

$start=$_POST["start"];

$s=$_POST["startposition"];

if($start==NULL)

{

$start=$_GET["start"];

$s=$_GET["start"];

}

$useropt=$_POST["useropt"];

$qid=$_POST["qid"];

$rans=$_POST["rans"];

$name=$_POST["name"];

$totalquestion=$_POST["totalquestion"];

if($start==NULL)

$query="select * from quiz where qid='1'";

else

{

$query="select * from quiz where qid='$start'";

}

$result=mysql_query($query);

while ($row = mysql_fetch_array($result)) {

    echo "<tr><td>",$row[0],"</td><td colspan='2'>",$row[1],"</td></tr><tr><td></td><td colspan='2'><input type='radio' name='useropt' value='a' />  ",$row[2],"</td><td colspan='2'><input type='radio' name='useropt' value='b' /> ",$row[3],"</td></tr><tr><td></td><td colspan='2'><input type='radio' name='useropt' value='c' /> ",$row[4],"</td><td colspan='2'><input type='radio' name='useropt' value='d' /> ",$row[5],"</td></tr>";

echo "<tr ><td colspan='5' align='right'><input type='hidden' name='name' value='",$name,"'><input type='hidden' name='start' value='",$row[0]+1,"'><input type='hidden' name='qid' value='",$row[0],"'><input type='hidden' name='startposition' value='",$s,"'><input type='submit' value='Next Question'><input type='hidden' name='totalquestion' value='",$totalquestion+1,"'>";

 echo "</td></tr>";

}

echo "<tr><td colspan='4'>";

$query="select woptcode from quiz where qid='$qid'";

 $result=mysql_query($query);

 while ($row = mysql_fetch_array($result)) {

 if(strcmp($row[0],$useropt)==0)

 {

 echo "<input type='hidden' name='rans' value='",$rans+1,"'>";

 $rans=$rans+1;

 }

 else

 echo "<input type='hidden' name='rans' value='",$rans,"'>";

 }

 echo "</td></tr>";

?>

 </table>

 <center>

 <br />

 <br />

</form>

<form method="post" action="quiz.php">

 <input type="hidden" name="do" value="finish" />

 <input type="hidden" name="rans" value="<? echo $rans;?>" />

 <input type="hidden" name="name" value="<? echo $name;?>" />

  <input type="hidden" name="tq" value="<? echo $totalquestion;?>" />

  <input type="hidden" name="end"  value="<? echo $start-1;?>" />

  <input type="hidden" name="startposition" value="<? echo $s;?>" />

  <input type="submit" value="Finish Online Test"  />

</form>

 

 

Quiz_Entry_Admin.php

 

 

 

<? if($_POST["do"]=="quiz")

{ include("db_mysql_connect.php");

$question=$_POST["question"];

$opt1=$_POST["opt1"];

$opt2=$_POST["opt2"];

$opt3=$_POST["opt3"];

$opt4=$_POST["opt4"];

$woptcode=$_POST["woptcode"];

$query="select * from quiz ";

$temp=1;

 $result=mysql_query($query);

while ($row = mysql_fetch_array($result)) {

$temp=$temp+1;

}

$query="insert into quiz values($temp,'$question','$opt1','$opt2','$opt3','$opt4','$woptcode')";

$result=mysql_query($query);

echo "successfully Saved";

}

?>

<form method="post" action="czone-stu-admin-login.php">

  <table>

    <tr>

      <td colspan="2" id="heading">Online Quiz Test Question Entry Module</td>

    </tr>

    <tr>

      <td>Enter Question here </td>

      <td><input type="text" name="question"  id="gunjan-textbox"/></td>

    </tr>

    <tr>

      <td>Enter First option</td>

      <td><input type="text" name="opt1" id="gunjan-textbox" /></td>

    </tr>

    <tr>

      <td>Enter Second option</td>

      <td><input type="text" name="opt2" id="gunjan-textbox" /></td>

    </tr>

    <tr>

      <td>Enter Third option</td>

      <td><input type="text" name="opt3" id="gunjan-textbox" /></td>

    </tr>

    <tr>

      <td>Enter Fourth option</td>

      <td><input type="text" name="opt4" id="gunjan-textbox" /></td>

    </tr>

    <tr>

      <td>Select Right Option code</td>

      <td><select name="woptcode" id="gunjan-textbox">

          <option value="a">A</option>

          <option value="b">B</option>

          <option value="c">C</option>

          <option value="d">D</option>

        </select>

      </td>

    </tr>

    <tr>

      <td colspan="2"><input type="hidden" name="do" value="quiz" />

        <input type="submit" value="SAVE QUESTION" />

      </td>

    </tr>

  </table>

</form>

db_mysql_connect.php

 

<?

mysql_connect("localhost");

mysql_select_db("quiz") or die("database could not connect ");

?>

 

 

 

Mysql Table “Quiz”

CREATE TABLE `quiz` (

  `qid` int(5) default NULL,

  `Question` text,

  `opt1` text,

  `opt2` text,

  `opt3` text,

  `opt4` text,

  `woptcode` varchar(5) default NULL

) ENGINE=InnoDB DEFAULT CHARSET=utf8;

if you have any information regarding Job, Study Material or any other information related to career. you can Post your article on our website. Click here to Register & Share your contents.
For Advertisment or any query email us at educratsweb@gmail.com

RELATED POST

1. A novel technology for coating carbon on lithium metal oxide electrode, can double battery life
Researchers have developed a non-expensive way to coat carbon on lithium metal oxide electrodes for lithium-ion batteries. The life of the lithium-ion cells prepared using these electrode materials is expected to be doubled due to protective carbon coating. Lithium-ion batteries are the most commonly used power source for electric vehicles. However, its penetration to the daily usage against gasoline-based vehicles require drastic improvement in the lifetime and cost as well as mileage per char
2. National Technology Day to be celebrated focusing on rebooting the economy through S&T
National Technology Day to be celebrated focusing on rebooting the economy through S&T The conference will bring together Scientists, Technocrats, Government officials, Diplomats, WHO officials and dignitaries from national and international Industry, Research Institutions and Academic Institutions   A high-level digital conference on ‘Rebooting the Economy through Science, Technology and Research Translations titled RESTART’ will be o
3. Agricultural Technology Information Centre (ATIC)
Agricultural Technology Information Centre (ATIC) started functioning from 2001 in Umiam, Meghalaya in the premises of ICAR Research Complex for NEH Region. This is a single window system to allow optimistic interaction between farmers and scientists for effective technology transfer and livelihood improvement. The outstations regional centers and Krishi Vigyan Kendras situated in different districts are also involved and part of the system for meeting the requirements of the farmers in various areas of
4. Agricultural Technology Information Centre (ATIC)
Agricultural Technology Information Centre (ATIC) started functioning from 2001 in Umiam, Meghalaya in the premises of ICAR Research Complex for NEH Region. This is a single window system to allow optimistic interaction between farmers and scientists for effective technology transfer and livelihood improvement. The outstations regional centers and Krishi Vigyan Kendras situated in different districts are also involved and part of the system for meeting the requirements of the farmers in various areas of
5. Php code for Online Quiz
Php code for Online Quiz One Question will appear on a screen when user select the option and click on next question another question appear on screen and after all opting the answer user will click on finish online test then quiz result report will be appear on screen .   Quiz.php  
6. Top 15 Online Grocery Stores (Websites + Apps) in India
Top 15 Online Grocery Stores (Websites + Apps) in India   Some of the advantages of online grocery stores are You can shop whatever you like at one place. There are many products you can find in the local market. Mostly all items are fresh. Daily you can find 5% to 15% discounts on one of the store. The online store will deliver the groceries to your home. There is also free delivery if the order is more than certain amount.
7. Free Online Automatic Text Summarization Tool
Free Online Automatic Text Summarization ToolFree Online Automatic Text Summarization Tool textcompactor.com is a free online automatic text summarization tool. You can summarize your contents through these free tools. How to summarize your contents through these tools 1.      
8. 321 Free Tools for Teachers - Free Educational Technology
Jacob Lund/Shutterstock.com Free Educational Technology for Teachers Do you support Free Technology for Teachers? If Yes, I highly encourage you to share this Free Educational Technology Reso
9. Mobile Data Protection Market Plays An Essential Role In Technology and Media Industry 2021
Mobile Data Protection Market Plays An Essential Role In Technology and Media Industry 2021Competitive Analysis For Mobile Data Protection Market is one of the most comprehensive and latest additions to TechMarketReports (Market.us) Reports Database. The Mobile Data Protection market rep
10. CSIR-Central Scientific Instruments Organisation (CSIO) transfers the UV Disinfection technology to combat SARS-CoV-2 to 27 indigenous manufacturers
There has been increasing evidence for airborne route of transmission of SARS-CoV-2 via aerosols which is now considered to be important by international agencies WHO, REHVA, ASHRAE and by health authorities in several countries. The airborne transmission is a major risk in indoor settings. Significantly, research carried out by CSIR constituent labs, Centre for Cellular and Molecular Biology (CSIR-CCMB) and CSIR-Institute of Microbial Technology (CSIR-IMTECH) in September 2020 had demonstrated experimen
11. Rajya Sabha passes Indian Institutes of Information Technology Laws (Amendment) Bill, 2020 today
Rajya Sabha passed Indian Institutes of Information Technology Laws (Amendment) Bill, 2020 in New Delhi today. The Indian Institutes of Information Technology Act of 2014 and Indian Institutes of Information Technology (Public-Private Partnership) Act, 2017 are the unique initiatives of the Government of India to impart knowledge in the field of Information Technology to provide solutions to the challenges faced by the country.The Indian Institutes of Information Technology Laws (Amendment) Bill, 2020 wa
12. ISMO: India Science Month Online | January 2021 | At your home
India Science Fest is India’s largest public celebration of science and technology.We strongly feel that India needs to step up its S&T and innovation agenda, in order to keep up its economic progress and social development. The gap between science and society needs to be bridged immediately. ISF endeavors to serve as platform for deeper engagement between scientists, researchers, professionals, entrepreneurs and students. We wish to have the public involved in the latest in science and get all
13. Science, Technology and Innovation Policy, 2020
Science, Technology and Innovation Policy, 2020 Science, Technology and Innovation Policy, 2020 Introduction As India and the world reorient in the wake of the COVID-19 crisis, a landmark policy initiative has been flagged by the Government of India. The Science, Technology and Innovation Poli
14. Prime Minister pays tributes to scientists on the National Technology Day
Prime Minister Shri Narendra Modi today paid tributes to all the scientists in the country who are using science and technology to bring a positive difference in the lives of others. Shri Modi was tweeting on the occasion of National Technology Day. “On National Technology Day, our nation salutes all those who are leveraging technology to bring a positive difference in the lives of others. We remember the exceptional achievement of our scientists on this day in 1998. It was a la
15. India International Science Festival-2020 will showcase 41 events highlighting multi-dimensional aspects of science, technology and innovation in India
Several curtain raiser events are being organized for generating awareness about the 6thIndia International Science Festival (IISF-2020) to be held virtually this year. At such an event at CSIR – Indian Institute of Toxicology Research, Lucknow,  Dr Shekhar C Mande, Secretary, Department of Scientific and Industrial Research (DSIR), Director General, Council of Scientific and Industrial Research and Chairman, Steering Committee, IISF – 2020, in his key note address, said that t
16. Zircon Tech is promoting the use of blockchain technology for electronic shipping invoices
Zircon Tech is promoting the use of blockchain technology for electronic shipping invoicesGlobal Share is a business whose mission is to improve business processes. This company has been working along with Zircon Tech. Its common project is the development of a solution for the effective handling of the info
17. Recycling Carbon technology by Bangalore startup receives TDB National Award 2021
A Bangalore based startup has received the National Award 2021 from Technology Development Board (TDB) for developing a commercial solution for conversion of CO2 to chemicals and fuels. Breathe Applied Sciences, a startup incubated at Jawaharlal Nehru Centre for Advanced Scientific Research (JNCASR) developed efficient catalysts and methodologies for the conversion of CO2 to methanol and other chemicals. It has led to improvisation of process engineering to enhance the production of c
18. Government notifies Information Technology (IntermediaryGuidelines and Digital Media Ethics Code) Rules 2021
Amidst growing concerns around lack of transparency, accountability and rights of users related to digital media and after elaborate consultation with the public and stakeholders, the Information Technology (Intermediary Guidelines and Digital Media Ethics Code) Rules 2021 has been framed in exercise of powers under section 87 (2) of the Information Technology Act, 2000 and in supersession of the earlier Information Technology (Intermediary Guidelines) Rules 2011. While finalizing these Rules,
19. Agricultural Technology Information Centre (ATIC)
Agricultural Technology Information Centre (ATIC) started functioning from 2001 in Umiam, Meghalaya in the premises of ICAR Research Complex for NEH Region. This is a single window system to allow optimistic interaction between farmers and scientists for effective technology transfer and livelihood improvement. The outstations regional centers and Krishi Vigyan Kendras situated in different districts are also involved and part of the system for meeting the requirements of the farmers in various areas of
20. Reliable Information Regarding Online Id Verification
In this day and age, many companies plus online businesses are distressed about protection in their businesses mainly because the numbers of frauds are boosting instantly. There are many fraudsters as well as impostors across the world who steal all company info easily by utilizing numerous leading-edge tools. Mostly, fraudsters enter into the company’s system as a client, and for a lot of corporations, it is very challenging to find the right one amongst fake along with genuine buyers. Identity th
21. Gmail Online Support Australia 1800826163 Gmail Toll Free Phone Number
Gmail Online Support Toll free Number Australia is 24/7 available from anywhere anytime to provide you Gmail Technical Support to recover your compromised Gmail account and help you to set -up enough security. Visit: Online Computer Support Australia | Hotmail Support Phone Numbe
22. Online Exam Websites
Schools are rigorously searching for Online Exam Websites since the enforcement of the indefinite lockdown due to covid-19. While there are a few online test software that claim to be the best, they lack far behind in terms of features when compared with Schoolzpro. The Schoolzpro application helps in conducting online exams and share lesson plans with the student on a single platform. With features like subjective exams, real-time paper checking, acc
23. CSIR-CMERI comes up with High Flow Rate Water Purification Technology for Fluoride and Iron Removal
NEED OF THE TECHNOLOGY: The contamination of fluoride and iron in drinking water is increasing day by day. Iron is the most abundant trace element in human body, responsible for accomplishment of vital biological functions such as gastrointestinal processes and the regulation of body temperature. But when iron level in water is beyond 0.3 ppm (as per WHO guideline), it shows several adverse effects including liver disease, irregular heart rhythm and neuronal disorder etc.
24. Online accounting,invoicing, and inventory management will emerge as the first preference for the new age entrepreneur : Instamojo Report
Online accounting,invoicing, and inventory management will emerge as the first preference for the new age entrepreneur : Instamojo Report   ·         125% increase in the usage of email invoices and a 150% increase in usage of invoices with payment links ·         Business owners want ­financial data to be easily accessible from their smart
25. Online Examination System
Online Examination SystemIf you’re looking for an online examination system that can help you conduct both objective & subjective exams with ease, then Schoolzpro should be your ideal choice. This particular online examination system is loaded with features like real-time paper checking, performance
We would love to hear your thoughts, concerns or problems with anything so we can improve our website educratsweb.com ! email us at educratsweb@gmail.com and submit your valuable feedback.
Save this page as PDF | Recommend to your Friends

Subscribe to our Telegram channel https://t.me/educratswebchannel | PHP CODE FOR ONLINE QUIZ #EDUCRATSWEB educratsweb.com Technology 2018-09-19

https://bhojpuri-actor-actress.blogspot.com/ | https://sarkariniyukti.blogspot.com/ | https://educratsweb.blogspot.com/ | https://bhaktisangam.blogspot.com/ | https://bharatpagesblog.blogspot.com/ | https://bcspatna.blogspot.com/ | https://bizinfozones.blogspot.com/ | https://cityzoneeducation.blogspot.com/ | https://consptech.blogspot.com/ | https://saralmaterials.blogspot.com/ | https://ekbihar.blogspot.com/ | https://indiahealthplus.blogspot.com/ | https://gktalk.blogspot.com/ | https://gunjanphoto.blogspot.com/ | https://mahuli-patna.blogspot.com/ | https://modicareblog.blogspot.com/ | https://biharnalanda.blogspot.com/ | https://parsapatna.blogspot.com/ | https://prakashparv.blogspot.com/ | https://chitraguptajimaharaj.blogspot.com/ | https://shrishirdisaibabasansthan.blogspot.com/ | https://speakdoor.blogspot.com/ | https://supremedealin.blogspot.com/ | https://supremedealblog.blogspot.com/