Commit fcda5d36 authored by BooDonky's avatar BooDonky
Browse files

new html file created

parent 770f7b11
......@@ -39,11 +39,3 @@
Button:
text: "OK"
\ No newline at end of file
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<script src="script.js"></script>
<style src="style.css"></style>
<title>Question for Right Password</title>
<title>Quiz App</title>
<meta name="viewport" content="width=Ddevice-width, initial-scale=1">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="home-box">
<h3>SICHERHEITSCHECK</h3>
<p>Hi, es werden jetzt einige Sicherheitsfragen abgefragt<span class="total-question"></span></p>
<button type="button" class="btn">Starten mit dem Sicherheitscheck</buttor>
</div>
</body>
</html>
\ No newline at end of file
const startButton = document.getElementById('start-btn')
const nextButton = document.getElementById('next-btn')
const questionContainerElement = document.getElementById('question-container')
const questionElement = document.getElementById('question')
const answerButtonsElement = document.getElementById('answer-buttons')
let currentQuestionIndex
startButton.addEventListener('click', startGame)
nextButton.addEventListener('click', () => {
currentQuestionIndex++
setNextQuestion()
})
function startGame() {
startButton.classList.add('hide')
currentQuestionIndex = 0
questionContainerElement.classList.remove('hide')
setNextQuestion()
}
function setNextQuestion() {
resetState()
showQuestion(currentQuestionIndex)
}
function showQuestion(question) {
questionElement.innerText = question.question
question.answers.forEach(answer => {
const button = document.createElement('button')
button.innerText = answer.text
button.classList.add('btn')
if (answer.correct) {
button.dataset.correct = answer.correct
}
button.addEventListener('click', selectAnswer)
answerButtonsElement.appendChild(button)
})
}
function resetState() {
clearStatusClass(document.body)
nextButton.classList.add('hide')
while (answerButtonsElement.firstChild) {
answerButtonsElement.removeChild(answerButtonsElement.firstChild)
}
}
function selectAnswer(e) {
const selectedButton = e.target
const correct = selectedButton.dataset.correct
setStatusClass(document.body, correct)
Array.from(answerButtonsElement.children).forEach(button => {
setStatusClass(button, button.dataset.correct)
})
if (questions.length > currentQuestionIndex + 1) {
nextButton.classList.remove('hide')
} else {
startButton.innerText = 'Restart'
startButton.classList.remove('hide')
}
}
function setStatusClass(element, correct) {
clearStatusClass(element)
if (correct) {
element.classList.add('correct')
} else {
element.classList.add('wrong')
}
}
function clearStatusClass(element) {
element.classList.remove('correct')
element.classList.remove('wrong')
}
const questions = [
{
question: 'What is 2 + 2?',
answers: [
{ text: '4', correct: true },
{ text: '22', correct: false }
]
},
{
question: 'Who is the best YouTuber?',
answers: [
{ text: 'Web Dev Simplified', correct: true },
{ text: 'Traversy Media', correct: true },
{ text: 'Dev Ed', correct: true },
{ text: 'Fun Fun Function', correct: true }
]
},
{
question: 'Is web development fun?',
answers: [
{ text: 'Kinda', correct: false },
{ text: 'YES!!!', correct: true },
{ text: 'Um no', correct: false },
{ text: 'IDK', correct: false }
]
},
{
question: 'What is 4 * 2?',
answers: [
{ text: '6', correct: false },
{ text: '8', correct: true }
]
}
]
\ No newline at end of file
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital@1&display=swap');
body{
margin: 0;
font-size: 16px;
background-color: #FFB6C1;
font-family: 'Open Sans', sans-serif;
font-weight: 400;
}
*{
box-sizing: border-box;
margin:0;
padding:0;
outline: none;
}
.home-box{
max-width: 70%;
background-color: #ffffff;
margin: 40px auto;
padding: 30px;
border-radius: 10px;
}
.home-box h3{
font-size: 18px;
color:#000000;
margin-bottom: 15px;
Line-height: 25px;
}
.home-box p{
font-size: 16px;
margin-bottom: 10px;
Line-height: 22px;
color:#000000;
font-weight: 400;
}
.home-box p span{
font-weight: 500;
}
\ No newline at end of file
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment