Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JavaScriptQuestions JAVASCRIPT FOR ONLINE QUIZ
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


vanan
JAVASCRIPT FOR ONLINE QUIZ
1 Answer(s)      2 years and 7 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>

Advertisement
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



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
 

 

 

DMCA.com