JAVASCRIPT FOR ONLINE QUIZ

Ads

 
 

Share on Google+Share on Google+

vanan
JAVASCRIPT FOR ONLINE QUIZ
1 Answer(s)      5 years and 2 months ago
Posted in : JavaScript Questions

i m creating a set of online questionnaire consist of 12 questions with choice of answers from 0-6.i've done creating a html codes.but have to calculate percentage based on total scores.my problem is i want to use get element by id function to read the score.if any questions is missed out there must be an alert box require user to answer all questions before proceeding to calculate score.below is a sample of questionnaire which i need to modify to include get element id function.I REALLY NEED YOUR HELP IN THIS.PLS

<form method="GET" action="post.html">`print("code sample");`

    Choose one from this group<br>
    RED <input type = "radio" name = "rad1" value = "0" >
    BLUE <input type = "radio" name = "rad1" value = "1" >
    GREEN  <input type = "radio" name = "rad1" value = "2" >
    YELLOW <input type = "radio" name = "rad1" value = "3">
    BROWN <input type = "radio" name = "rad1" value = "4">
    <br>
    And one from this group<br>
    PINK<input type = "radio" name = "rad2" value = "0" >
    PURPLE<input type = "radio" name = "rad2" value = "1" >
    GREY<input type = "radio" name = "rad2" value = "2" >
    BLACK<input type = "radio" name = "rad2" value = "3" >
    WHITE <input type = "radio" name = "rad2" value = "4">
    <br><br>
    <input type = "button" value = "Calculate Score" onclick ="calc()">
    </form>

    <script type = "text/javascript">

    var numOfGroups = 2;  // the number of radio button groups - here 2

    function calc() {
    var score = 0;
    for (var j=1; j<=numOfGroups; j++) {
    var f = document["myform"]["rad"+j];
    for (var i=0; i<f.length; i++) {
    if (f[i].checked) {
    score += Number(f[i].value/72 *100));
    }
    }
    }

    alert ("You scored "  + score);

    }
    </script>
Ads
View Answers

May 26, 2013 at 2:25 PM


You can check this link. Everything has been explained stepwise and you can implement the score in percentage. The source code is also available there. Your problem will be solved within minutes. Interactive Quiz with javaScript


Ads









Related Tutorials/Questions & Answers:
JAVASCRIPT FOR ONLINE QUIZ
JAVASCRIPT FOR ONLINE QUIZ  i m creating a set of online questionnaire consist of 12 questions with choice of answers from 0-6.i've done creating... = "text/javascript"> var numOfGroups = 2; // the number of radio button
online quiz
online quiz  Define a Question class which stores a multiple choice...) level. Use the Question class to define a Quiz class. A quiz can be composed of up to 10 questions. Define the add method of the Quiz class to add a question
Advertisements
online quiz
online quiz  Define a Question class which stores a multiple choice...) level. Use the Question class to define a Quiz class. A quiz can be composed of up to 10 questions. Define the add method of the Quiz class to add a question
online quiz
online quiz  Define a Question class which stores a multiple choice...) level. Use the Question class to define a Quiz class. A quiz can be composed of up to 10 questions. Define the add method of the Quiz class to add a question
online quiz
online quiz  Define a Question class which stores a multiple choice...) level. Use the Question class to define a Quiz class. A quiz can be composed of up to 10 questions. Define the add method of the Quiz class to add a question
online quiz
online quiz  Define a Question class which stores a multiple choice...) level. Use the Question class to define a Quiz class. A quiz can be composed of up to 10 questions. Define the add method of the Quiz class to add a question
online quiz
online quiz  Define a Question class which stores a multiple choice...) level. Use the Question class to define a Quiz class. A quiz can be composed of up to 10 questions. Define the add method of the Quiz class to add a question
Online quiz mini project
Online quiz mini project  Hi. I follow one of the code for "Online quiz mini project". I would like to know how to count the number of wrong answers in jsp
Online quiz mini project
Online quiz mini project  Sir i need a online quiz program coding using java servlet, jdbc odbc connection with ms. access. If possible send that source code to me. Thank you
Online Quiz Application in JSP
Online Quiz Application in JSP  ... are going to implement of Online quiz application using of JSP. Step 1: Create... quiz question and answer form using with JSP or JDBC database.  Here
Failed to run Online Quiz Application in JSP - JSP-Interview Questions
Failed to run Online Quiz Application in JSP   Hi, I have been following your following link to run the online quiz application, but I failed... your question. Thanks  Hi, I cannot run your online quiz
quiz
question has a complexity (difficulty) level. Use the Question class to define a Quiz class. A quiz can be composed of up to 10 questions. Define the add method of the Quiz class to add a question to a quiz. Define the giveQuiz method
Need Help in creating online quiz application using JSP - JSP-Servlet
Need Help in creating online quiz application using JSP  Hi, i am creating online Quiz application using JSP and MySQl ,Apache 6 in Netbeans IDE. i... of database mySql-->select * from quiz
online quiz program coding using jsp, jdbc odbc connection with ms. access.. Thank you.
online quiz program coding using jsp, jdbc odbc connection with ms. access.. Thank you.  please provide online quiz program coding using jsp, jdbc...: http://www.roseindia.net/jsp/online-quiz-application-jsp.shtml
How to Create Quiz Application using iPhone
How to Create Quiz Application using iPhone  Hi, I am learning iphone application Programming Language. my question is that how to create a quiz application using iPhone. Please provide online reference to study and example
Should we go for javascript or applets for online exam project using java
Should we go for javascript or applets for online exam project using java  Hi, I am new to java and i am working on online examination project.As soon as the candidate login successfully a window pop up should appear
identification quiz - Java Beginners
identification quiz  what is the html java code for a identification quiz? plz help me..  Hi Friend, Please clarify your question. Thanks
Quiz Extreme
Quiz Extreme       Use Quiz Extreme quiz software to make your own quizzes on any subject, using a variety of question types. Create any kind of quiz you can imagine
iPhone Quiz App Tutorial
iPhone Quiz App Tutorial In this simple iPhone quiz application tutorial, we are going to learn how to create simple quiz in iphone. Creating a simple quiz in iPhone is really easy..Just follow the given steps to create the quiz
sir plz send the project on quiz system code
sir plz send the project on quiz system code  sir plz send the client server based project in core java database in my sql
How to provide navigation in quiz application using jsp?
How to provide navigation in quiz application using jsp?  hi everyone. i am using jsp with mysql connectivity. i have to retrieve questions from db one at a time. on clicking the next it should go the next question
quiz asked by my lecturer for array reverse....
quiz asked by my lecturer for array reverse....  consider a 2 dimensional array size m by n.Derive a function that can be used to reverse the elements of the array such that the last element of the array becomes the first
Online Test System Project
://www.roseindia.net/jsp/online-quiz-application-jsp.shtml...Online Test System Project  I want a full ready-made project on online test system in jsp. i am not using servlet but only jsp.And backend database
quiz asked by my lecturer for array reverse....
quiz asked by my lecturer for array reverse....  consider a 2 dimensional array size m by n.Derive a function that can be used to reverse the elements of the array such that the last element of the array becomes the first
online test system
/online-quiz-application-jsp.shtml http://www.roseindia.net/answers/viewqa/JSP...online test system  Hi, I am creating a project for online test system.There should be a timer,on pressing next button it will retrieve a next
JavaScript
JavaScript  clone JavaScript
online examination
: http://www.roseindia.net/jsp/online-quiz-application-jsp.shtml...online examination  coding for multiple choice question in jsp   We are providing you a simple application. Create table test
online bookbank
online bookbank  Need online book bank with mvc architecture
online voting
online voting  can i have the code for online voting in java
online voting
online voting  can i have the code for online voting in java
javascript
javascript  javascript code to dynamically add table on button click.../javascript/javascriptexamples/javascript-add-row-dynamically.shtml http://www.roseindia.net/javascript/javascript-add-row-to-table.shtml http://www.roseindia.net
Tutorials   
Java Spring Hibernate Struts Training code for programming How can I dynamically load user-entered data as content of jquery dialog? java webcam integration question java coding Fix Scrollbar position in a checkboxList after postback Information Save Alert Country wise redirection to files Interface in javascript connect database with javascript Zip Code ZipCode how to validate the email login How to play FLV video files on Ipad using HTML code or javascript code? Nitobi Grid is not working in IE10/IE11 jquery issue plese help RegEx Tree structure from json whose parents can be dragged and dropped from child newyorklife insurance getElementById not working javascript code for search in html file Implement The Skeleton Code Implement This Skeleton Code Mobile Automation using Appium Computer forensic application Java: Searching a string from doc files java linked list urgent !!! java linked list urgent!!! library management library management library management library management question Html form using JavaScript to display the table content java how to prevent no from unroundin off on clicking text box again in JSP and Jquery graph generation from xml design file display data from database in textbox when id entered in textbox Javascript Code for all fields how to get HTTP GET request value using javascript array Javascript Querry autocomplete(): Spring mvc with jquery: I am not getting correct value in the text filed. Please help me Create SpreadSheet same as excel using java applet Create SpreadSheet same as excel using java applet How to change focus among multiple select boxes? Write JQUERY Code Write JQUERY Code Converting jsp variable to java variable java

Ads

 
Advertisement null

Ads