Calculator Tools Calculator Tools
Create

Roman Hodovanyi Career Stats Quiz

Nov 22, 2023

About this app

Interactive quiz about Ukrainian footballer Roman Hodovanyi's career stats and facts.

Roman Hodovanyi Career Stats Quiz Roman Hodovanyi Career Stats Quiz 🏆 Test your knowledge about the Ukrainian footballer! Next Question Learn more about Roman Hodovanyi on Wikipedia Your Score: /5 Restart Quiz

Related apps

Put this on your site

Source

                    <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Roman Hodovanyi Career Stats Quiz</title>
<meta name="description" content="Interactive quiz about Ukrainian footballer Roman Hodovanyi's career stats and facts.">
<meta name="keywords" content="Roman Hodovanyi, Football, Quiz, Career Stats, Interactive, Game, Ukrainian Footballer">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/css2?family=Bangers&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Lobster&display=swap" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">

<style>
body {
font-family: 'Lobster', cursive;
background: linear-gradient(to right, #6dd5ed, #2193b0);
color: #FFF;
}

h1, h2 {
font-family: 'Bangers', cursive;
text-align: center;
}

.container {
margin-top: 50px;
}

#question {
margin-bottom: 20px;
}

.answer {
cursor: pointer;
background-color: #f8d7da;
border-radius: 5px;
margin: 10px 0;
padding: 10px;
transition: background-color 0.3s ease;
}

.answer:hover {
background-color: #fce4e4;
}

.correct {
background-color: #d4edda;
color: #155724;
}

.quiz-info {
text-align: center;
margin-top: 20px;
}

#wikipedia-link {
text-decoration: none;
color: #FFF;
}

.fa {
margin-right: 5px;
}

#result {
display: none;
text-align: center;
margin-top: 20px;
}
</style>
</head>
<body>
<div class="container">
<h1>Roman Hodovanyi Career Stats Quiz 🏆</h1>
<h2>Test your knowledge about the Ukrainian footballer!</h2>

<div id="question"></div>
<div id="answers"></div>

<div class="quiz-info">
<button id="next-question" class="btn btn-primary">Next Question</button>
<p>Learn more about Roman Hodovanyi on <a href="https://en.wikipedia.org/wiki/Roman_Hodovanyi" target="_blank" rel="nofollow" id="wikipedia-link">Wikipedia <i class="fa fa-external-link"></i></a></p>
</div>

<div id="result">
<h3>Your Score: <span id="score"></span>/5</h3>
<button id="restart-quiz" class="btn btn-success">Restart Quiz</button>
</div>
</div>

<script>
const questions = [
{
question: "In which year did Roman Hodovanyi start his senior career?",
answers: [
{ text: "2007", correct: false },
{ text: "2009", correct: true },
{ text: "2010", correct: false },
{ text: "2006", correct: false }
]
},
{
question: "What position does Roman Hodovanyi usually play?",
answers: [
{ text: "Midfielder", correct: false },
{ text: "Defender", correct: true },
{ text: "Forward", correct: false },
{ text: "Goalkeeper", correct: false }
]
},
{
question: "For which team did Roman Hodovanyi play from 2010 to 2015?",
answers: [
{ text: "FC Slavia Mozyr", correct: false },
{ text: "FC Volyn Lutsk", correct: true },
{ text: "FC Nyva Ternopil", correct: false },
{ text: "FC Ternopil", correct: false }
]
},
{
question: "How tall is Roman Hodovanyi?",
answers: [
{ text: "1.70 m", correct: false },
{ text: "1.87 m", correct: true },
{ text: "1.75 m", correct: false },
{ text: "1.82 m", correct: false }
]
},
{
question: "Where was Roman Hodovanyi born?",
answers: [
{ text: "Kyiv", correct: false },
{ text: "Ternopil", correct: true },
{ text: "Lviv", correct: false },
{ text: "Kharkiv", correct: false }
]
}
];

let currentQuestionIndex = 0;
let score = 0;

document.addEventListener("DOMContentLoaded", function() {
showQuestion();

$('#next-question').click(function() {
if (currentQuestionIndex < questions.length - 1) {
currentQuestionIndex++;
resetState();
showQuestion();
} else {
$('#main-container').hide();
$('#result').show();
$('#score').text(score);
}
});

$('#restart-quiz').click(function() {
score = 0;
currentQuestionIndex = 0;
resetState();
showQuestion();
$('#main-container').show();
$('#result').hide();
});
});

function showQuestion() {
const question = questions[currentQuestionIndex];
$('#question').text(question.question);
question.answers.forEach(answer => {
const button = $('<button>').addClass('answer').text(answer.text);
if (answer.correct) {
button.addClass('correct');
}
button.click(selectAnswer);
$('#answers').append(button);
});
}

function resetState() {
$('.answer').remove();
}

function selectAnswer(e) {
const selectedButton = $(e.target);
const correct = selectedButton.hasClass('correct');
if (correct) {
score++;
}
$('.answer').each(function() {
$(this).prop('disabled', true);
if ($(this).hasClass('correct')) {
$(this).addClass('correct');
}
});
if (questions.length > currentQuestionIndex + 1) {
$('#next-question').prop('disabled', false);
}
}
</script>
</body>
</html>