mirror of
https://github.com/olehomelchenko/minivlat-local-ua.git
synced 2025-12-21 21:22:24 +00:00
14 lines
612 B
JavaScript
14 lines
612 B
JavaScript
document.addEventListener('DOMContentLoaded', function() {
|
|
const consentButton = document.getElementById('consentButton');
|
|
|
|
consentButton.addEventListener('click', function() {
|
|
fetch('../data/questions.json')
|
|
.then(response => response.json())
|
|
.then(data => {
|
|
const quizVersions = Object.keys(data.quizzes);
|
|
const randomVersion = quizVersions[Math.floor(Math.random() * quizVersions.length)];
|
|
localStorage.setItem('quizVersion', randomVersion);
|
|
window.location.href = 'quiz.html';
|
|
});
|
|
});
|
|
}); |