mirror of
https://github.com/olehomelchenko/minivlat-local-ua.git
synced 2025-12-21 21:22:24 +00:00
reorganize files
This commit is contained in:
14
public/js/consent.js
Normal file
14
public/js/consent.js
Normal file
@@ -0,0 +1,14 @@
|
||||
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';
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user