I am trying to creat a html/css/javascript page that looks like this....       I am almost done but I need help debugging. I have an issue where it plays in a slide kind of and I need all the questions to be on the same page. Also, the final results are supposed to be on the right-hand side after the questions. So I cant figure out how to fix that. Also I can get the name to print with the score data at the end so I need help with that also.       If you could help me fix that would be great!!!       My current end result is supposed to look exactly like that picture above so if you could help me fix the final few things that would help me a lot.       Quiz First Name: Last Name:   HTML BASICS Quiz Answer   Answer   Answer   Answer     Submit           CSS   body { background-color: #F2D2BD; }           JavaScript   const quizData = [ { question: "Question 1: Select the tag used to display an image on a web page", a: "< a href>", b: "", c: "", d: "", correct: "b", }, { question: "Question 2: Choose the attribute used to provide accessbility by configuring a text alteration that is available to browsers and other user agents that do not support graphics", a: "alt", b: "txt", c: "src", d: "none of the above", correct: "a", }, { question: "Question 3: Use the ____________ property to resize or scale the4 background image.", a: "background-image", b: "background-clip", c: "background-ongin", d: "background-size", correct: "d", }, { question: "Question 4: Choose the item below that describes the process of creating an image with the lowest file size that still renders a good quality image", a: "validation", b: "multimedia", c: "optimization", d: "bandwidth", correct: "b", },     ];   const quiz = document.getElementById('quiz') const answerEls = document.querySelectorAll('.answer') const questionEl = document.getElementById('question') const optiona = document.getElementById('optiona') const optionb = document.getElementById('optionb') const optionc = document.getElementById('optionc') const optiond = document.getElementById('optiond') const submitBtn = document.getElementById('submit')     let currentQuiz = 0 let score = 0   loadQuiz()   function loadQuiz() {   deselectAnswers()   const currentQuizData = quizData[currentQuiz]   questionEl.innerText = currentQuizData.question optiona.innerText = currentQuizData.a optionb.innerText = currentQuizData.b optionc.innerText = currentQuizData.c optiond.innerText = currentQuizData.d }   function deselectAnswers() { answerEls.forEach(answerEl => answerEl.checked = false) }   function getSelected() { let answer answerEls.forEach(answerEl => { if (answerEl.checked) { answer = answerEl.id } }) return answer }     submitBtn.addEventListener('click', () => { const answer = getSelected() if (answer) { if (answer === quizData[currentQuiz].correct) { score++ }   currentQuiz++   if (currentQuiz < quizData.length) { loadQuiz() } else { quiz.innerHTML = ` You answered ${score}/${quizData.length} questions correct: ${(score / quizData.length) * 100}% `   } } })

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

I am trying to creat a html/css/javascript page that looks like this....

 

 

 

I am almost done but I need help debugging. I have an issue where it plays in a slide kind of and I need all the questions to be on the same page. Also, the final results are supposed to be on the right-hand side after the questions. So I cant figure out how to fix that. Also I can get the name to print with the score data at the end so I need help with that also.

 

 

 

If you could help me fix that would be great!!!

 

 

 

My current end result is supposed to look exactly like that picture above so if you could help me fix the final few things that would help me a lot.

 

 

 

<html>

<head lang="en">

<meta charset="UTF-8">

<title>Quiz</title>

<link rel="stylesheet" type="text/css" href="s2.css">

</head>

<body>

<form class="form-inline" action="/action_page.php">

<div class="form-group">

<label for="email">First Name:</label>

<input type="text" class="form-control" id="fname">

</div>

<div class="form-group">

<label for="pwd">Last Name:</label>

<input type="text" class="form-control" id="lname">

</div>

 

<input type="text" placeholder="Enter your Last name:" id="ln" required /><br><br>

<div style="background-color: #967969;"><h3>HTML BASICS</h3></div>

<div class="quiz-container" id="quiz">

<div class="quiz-header">

<h2 id="question">Quiz</h2>

<ul>

<li>

<input type="radio" name="answer" id="a" class="answer">

<label for="a" id="optiona">Answer</label>

</li>

 

<li>

<input type="radio" name="answer" id="b" class="answer">

<label for="b" id="optionb">Answer</label>

</li>

 

<li>

<input type="radio" name="answer" id="c" class="answer">

<label for="c" id="optionc">Answer</label>

</li>

 

<li>

<input type="radio" name="answer" id="d" class="answer">

<label for="d" id="optiond">Answer</label>

</li>

 

</ul>

</div>

 

<button id="submit" style="background-color: #967969;">Submit</button>

<script src="quiz.js"></script>

<script src="quiz2.js"></script>

</div>

</body>

</html>

 

 

 

 

 

CSS

 

body {

background-color: #F2D2BD;

}

 

 

 

 

 

JavaScript

 

const quizData = [

{

question: "Question 1: Select the tag used to display an image on a web page",

a: "< a href>",

b: "<img>",

c: "<image>",

d: "<graphic>",

correct: "b",

},

{

question: "Question 2: Choose the attribute used to provide accessbility by configuring a text alteration that is available to browsers and other user agents that do not support graphics",

a: "alt",

b: "txt",

c: "src",

d: "none of the above",

correct: "a",

},

{

question: "Question 3: Use the ____________ property to resize or scale the4 background image.",

a: "background-image",

b: "background-clip",

c: "background-ongin",

d: "background-size",

correct: "d",

},

{

question: "Question 4: Choose the item below that describes the process of creating an image with the lowest file size that still renders a good quality image",

a: "validation",

b: "multimedia",

c: "optimization",

d: "bandwidth",

correct: "b",

},

 

 

];

 

const quiz = document.getElementById('quiz')

const answerEls = document.querySelectorAll('.answer')

const questionEl = document.getElementById('question')

const optiona = document.getElementById('optiona')

const optionb = document.getElementById('optionb')

const optionc = document.getElementById('optionc')

const optiond = document.getElementById('optiond')

const submitBtn = document.getElementById('submit')

 

 

let currentQuiz = 0

let score = 0

 

loadQuiz()

 

function loadQuiz() {

 

deselectAnswers()

 

const currentQuizData = quizData[currentQuiz]

 

questionEl.innerText = currentQuizData.question

optiona.innerText = currentQuizData.a

optionb.innerText = currentQuizData.b

optionc.innerText = currentQuizData.c

optiond.innerText = currentQuizData.d

}

 

function deselectAnswers() {

answerEls.forEach(answerEl => answerEl.checked = false)

}

 

function getSelected() {

let answer

answerEls.forEach(answerEl => {

if (answerEl.checked) {

answer = answerEl.id

}

})

return answer

}

 

 

submitBtn.addEventListener('click', () => {

const answer = getSelected()

if (answer) {

if (answer === quizData[currentQuiz].correct) {

score++

}

 

currentQuiz++

 

if (currentQuiz < quizData.length) {

loadQuiz()

} else {

quiz.innerHTML = `

<h2>You answered ${score}/${quizData.length} questions correct: ${(score / quizData.length) * 100}% </h2>`

 

}

}

})

First Name: dfs
Last Name: dvfefwefw
HTML Basics
Question1. Select the tag used to place an image on a web page.
Oka href >
Student Name: dfs dvfefwefw
O < img >
O < image >
O « graphic >
Final grade: 50%
Question2. Choose the attribute used to provide accessibility by configuring a text alternative that is
Question Your Answer Correct Answer
available to browsers and other user agents that do not support graphics.
text
alt
O alt
multimedia optimization
O text
O src
O none of the above
Question3. Use the
property to resize or scale the background image.
O background - image
O background - clip
O background - origin
O background - size
Question4. Choose the item below that describes the process of creating an image with the lowest file
size that still renders a good quality image.
O validation
O multimedia
O optimization
O bandwidth
Submit
Author: First Name, Last Name; Assignment 3
Transcribed Image Text:First Name: dfs Last Name: dvfefwefw HTML Basics Question1. Select the tag used to place an image on a web page. Oka href > Student Name: dfs dvfefwefw O < img > O < image > O « graphic > Final grade: 50% Question2. Choose the attribute used to provide accessibility by configuring a text alternative that is Question Your Answer Correct Answer available to browsers and other user agents that do not support graphics. text alt O alt multimedia optimization O text O src O none of the above Question3. Use the property to resize or scale the background image. O background - image O background - clip O background - origin O background - size Question4. Choose the item below that describes the process of creating an image with the lowest file size that still renders a good quality image. O validation O multimedia O optimization O bandwidth Submit Author: First Name, Last Name; Assignment 3
Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Image Element
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education