Commit 2793105a authored by Felix Felbermayer's avatar Felix Felbermayer
Browse files

Finish Task 3

parent ae51fa7f
......@@ -4,6 +4,8 @@
<head>
<title>FHS-Modules</title>
<link rel="stylesheet" href="style.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Langar&family=Poppins&display=swap" rel="stylesheet">
</head>
<body>
......@@ -13,6 +15,7 @@
<div id="content">
<div id="question"></div>
<div id="answer"></div>
<div id="result"></div>
</div>
<script src="index.js" type="module"></script>
</body>
......
......@@ -11,6 +11,7 @@ window.addEventListener('load', function () {
nothide.style.display="initial";
document.getElementById('question').innerHTML=''
document.getElementById('answer').innerHTML=''
document.getElementById('result').innerHTML=''
}else if(pathname==='/quiz'){
window.question = await askQuestion()
console.log(window.question)
......@@ -68,10 +69,12 @@ async function displayAnswer(question, answer){
console.log(question)
const ans = await answerQuestion(question, answer)
if(ans === true){
document.getElementById('question').innerHTML='Correct Answer'
document.getElementById('result').appendChild(createQuestion('Correct answer!🥳'))
document.getElementById('question').innerHTML=''
document.getElementById('answer').innerHTML=''
}else{
document.getElementById('question').innerHTML='Wrong Answer'
document.getElementById('result').appendChild(createQuestion('Wrong answer!😢'))
document.getElementById('question').innerHTML=''
document.getElementById('answer').innerHTML=''
}
}
......
......@@ -12,4 +12,41 @@ body{
h1{
margin-top: 1em;
margin-bottom: 0.7em;
font-family: 'Poppins', sans-serif;
font-size: 50px;
}
#question p{
font-family: 'Langar', cursive;
background-color: rgb(193, 193, 193);
border: 1px solid;
border-radius: 5px;
font-size: 40px;
}
#question{
margin-bottom: 2em;
}
#answer{
display: flex;
flex-direction: column;
justify-content: space-between;
}
#answer a{
text-decoration: none;
color: black;
font-size: 30px;
font-family: 'Poppins', sans-serif;
}
#answer a:hover{
color: white;
}
#result p{
font-family: 'Poppins', sans-serif;
font-size: 25px;
}
#goHome, #goQuiz{
font-family: 'Poppins', sans-serif;
font-size: 25px;
}
#goHome a, #goQuiz a{
color: rgb(110, 123, 173);
}
\ No newline at end of file
Markdown is supported
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