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 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>
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  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 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 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
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
ModuleNotFoundError: No module named 'quiz'
ModuleNotFoundError: No module named 'quiz'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'quiz' How to remove the ModuleNotFoundError: No module named 'quiz' error
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
coursera deep learning quiz
deep learning quiz Try to provide me good examples or tutorials links so that I... guide to learn Data Science Big Data and Data Science online training course for software developers What is predictive analytics? Online
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
JavaScript
JavaScript  clone JavaScript
ModuleNotFoundError: No module named 'kotti_quiz'
ModuleNotFoundError: No module named 'kotti_quiz'  Hi, My Python... 'kotti_quiz' How to remove the ModuleNotFoundError: No module named 'kotti_quiz' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'py-quiz'
ModuleNotFoundError: No module named 'py-quiz'  Hi, My Python...-quiz' How to remove the ModuleNotFoundError: No module named 'py-quiz... to install padas library. You can install py-quiz python with following command
ModuleNotFoundError: No module named 'simple-quiz'
ModuleNotFoundError: No module named 'simple-quiz'  Hi, My Python... 'simple-quiz' How to remove the ModuleNotFoundError: No module named 'simple-quiz' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'django-quiz'
ModuleNotFoundError: No module named 'django-quiz'  Hi, My Python... 'django-quiz' How to remove the ModuleNotFoundError: No module named 'django-quiz' error? Thanks   Hi, In your python environment
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
deep learning coursera github quiz
learning coursera github quiz Try to provide me good examples or tutorials... online training course for software developers What is predictive analytics? Online TensorFlow 2.0 training course Thanks
coursera convolutional neural networks quiz
to learn: coursera convolutional neural networks quiz Try to provide me good... Big Data and Data Science online training course for software developers What is predictive analytics? Online TensorFlow 2.0 training course Thanks
recurrent neural networks coursera quiz
: recurrent neural networks coursera quiz Try to provide me good examples... and Data Science online training course for software developers What is predictive analytics? Online TensorFlow 2.0 training course Thanks
Javascript
Javascript  How validations are done using javascript ,with example? and interview questions on javASCRIPT
JavaScript
should use JavaScript? Thanks   Hi, JavaScript is scripting language that runs on browser. You have to embed JavaScript in HTML page. Please see JavaScript tutorial. Thanks
JavaScript
JavaScript  how to get full path of a file type in javascript
javascript
javascript  Hi deepak, how to write form validation on javascript
javascript
javascript  write a program to display implement about browsers using javascript
javaScript
javaScript  How to open a browser window that cannot be resized? (HTML + Javascript
javascript
javascript  i have just learned javascript... can you tell me what kind of applications can be made by javascript?? thank you
coursera convolutional neural networks quiz solutions
coursera convolutional neural networks quiz solutions  Hi, I am... for the tutorials to learn: coursera convolutional neural networks quiz solutions Try...;coursera convolutional neural networks quiz solutions". Also tell me which
javascript
javascript  how to set the request or session attribute in javascript head part of jsp page
javascript
javascript  Hi sir, This is sinduri, i want to learn javascript, so plz can u help me.how to learn
javascript
javascript  hi sir, if i want to learn javascript. what concepts i want to know
JAVASCRIPT
JAVASCRIPT  I have one textbox and I want to validate that it must start with number(1-0). can anyone tell me a javascript for that ? thanks in advance
Javascript
Javascript   Javascript to check Numeric entry in checkbox.....   Hi Please find the following code for numeric entry validation in javascript function validateBox(){ var data=document.myForm.someText.value
javascript
javascript  hi, I was actually working on to calculate the number of days between two dates of yyyy-mm-dd format using javascript, and when i click on button then number of days should be display in textbox
javaScript
javaScript  . Print a table like below in JAVASCRIPT 5 x 1 = 5 5 x 2 = 10 ΓΆβ?¬Β¦ΓΆβ?¬Β¦ΓΆβ?¬Β¦. 5 x 20 = 100
javascript
javascript  passing javascript values to jsp   Hi Friend, Try the following code:ADS_TO_REPLACE_1 form.jsp: <html> <script>... Javascript value In JSP"> <% String st=request.getParameter("msg"); if(st
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
Javascript
this format xxx-xxx-xxxx, i want the code in javascript. as a function.   Javascript Phone Number Validation <html> <script> function..." method="post" onsubmit="javascript:return validate();"> Phone Number:<
Javascript
Javascript  Dear Sir, Thank You a lot for your continuos support.Again i am in need of your help. What is the javascript code to disable a link,once... javascript or css Please help me.Urgent Regards Debasis   Hello Friend
ModuleNotFoundError: No module named 'comp-sci-quiz'
ModuleNotFoundError: No module named 'comp-sci-quiz'  Hi, My... 'comp-sci-quiz' How to remove the ModuleNotFoundError: No module named 'comp-sci-quiz' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'comp-sci-quiz'
ModuleNotFoundError: No module named 'comp-sci-quiz'  Hi, My... 'comp-sci-quiz' How to remove the ModuleNotFoundError: No module named 'comp-sci-quiz' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'django-simple-quiz'
ModuleNotFoundError: No module named 'django-simple-quiz'  Hi, My... named 'django-simple-quiz' How to remove the ModuleNotFoundError: No module named 'django-simple-quiz' error? Thanks   Hi, In your

Ads