Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Web Page Programming Challenge Create a Web page named quiz.html that can be use

ID: 3665777 • Letter: W

Question

Web Page Programming Challenge

Create a Web page named quiz.html that can be used to conduct multiple choice quizzes over the Web. The page should contain at least 10 potential quiz questions, each with three possible answers (A, B, and C). When loaded, the page should first prompt the person for the number of desired questions in the quiz, with a default of 3 questions. The page should then randomly select questions and prompt the user with each question and possible answers. Each answer entered by the user should be compared with the correct answer, and the result displayed within the page (either CORRECT or INCORRECT). At the end, the number and percentage of correct guesses should be displayed in the page.

-It must display each question and all three potential answers as part of the prompt, and make it clear to the user how their answer should be formatted.

-The question, user's answer, and correctness of that answer must be displayed in the page. In the case of an incorrect answer, the correct answer must be identified.

-The number of correct answers, total number of questions, and correctness percentage must be displayed in a readable format.

-Ensure that no question appears more than once in a specific quiz. Of course, this requires enough potential questions to complete the quiz.

Explanation / Answer

<html><head><title></title>
<script language="JavaScript">
<!--

var numQues = 5;
var numChoi = 4;

var answers = new Array(5);
answers[0] = "come";
answers[1] = "hadn't arrived";
answers[2] = "had seen";
answers[3] = "has been blowing";
answers[4] = "have been married";

function getScore(form) {
var score = 0;
var currElt;
var currSelection;

for (i=0; i<numQues; i++) {
currElt = i*numChoi;
for (j=0; j<numChoi; j++) {
currSelection = form.elements[currElt + j];
if (currSelection.checked) {
if (currSelection.value == answers[i]) {
score++;
break;
}
}
}
}

score = Math.round(score/numQues*100);
form.percentage.value = score + "%";

var correctAnswers = "";
for (i=1; i<=numQues; i++) {
correctAnswers += i + ". " + answers[i-1] + " ";
}
form.solutions.value = correctAnswers;

}

// -->
</script>
</head>

<body>

<form name="quiz">
1. I'll see you in August when I _____ back.
<input type="radio" name="q1" value="will come">will come
<input type="radio" name="q1" value="came">came
<input type="radio" name="q1" value="will have com">will have com
<input type="radio" name="q1" value="come">come
<p>

2. My friend _____ when the lesson started.
<input type="radio" name="q2" value="hasn't arrived">hasn't arrived
<input type="radio" name="q2" value="wasn't arrived">wasn't arrived
<input type="radio" name="q2" value="hadn't arrived">hadn't arrived
<input type="radio" name="q2" value="wasn't arriving">wasn't arriving
<p>

3. Alex didn't come to see the film last night because he _____ it before.
<input type="radio" name="q3" value="saw">saw
<input type="radio" name="q3" value="had seen">had seen
<input type="radio" name="q3" value="has seen">has seen
<input type="radio" name="q3" value="was seen">was seen
<p>

4. A cold wind _____ for the last three days.
<input type="radio" name="q4" value="has been blowing">has been blowing
<input type="radio" name="q4" value="blows">blows
<input type="radio" name="q4" value="is blowing">is blowing
<input type="radio" name="q4" value="blew">blew
<p>

5. 13. July 10th is my wedding anniversary. Next month, my husband and I will _____ for twenty years.
<input type="radio" name="q5" value="marry">marry
<input type="radio" name="q5" value="have married">have married
<input type="radio" name="q5" value="be married">be married
<input type="radio" name="q5" value="have been married">have been married
<p>

<input type="button" value="Get score">
<input type="reset" value="Clear"><p>
Score = <input type=text size=15 name="percentage">
Correct answers:
<textarea name="solutions" wrap="virtual" rows="4" cols="40"></textarea>
</form>

</body></html>

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote