Skip to content

Commit

Permalink
quiz?
Browse files Browse the repository at this point in the history
  • Loading branch information
RasperRevision committed Feb 9, 2024
1 parent e37ad4c commit af02066
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
16 changes: 9 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Rasper Revision</title>

<link href="RasperRevision.github.io/node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<script src="RasperRevision.github.io/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js" //issue here
<link href="/node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<script src="/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
crossorigin="anonymous"></script>
crossorigin="anonymous"></script>
<link href="style.css" rel="stylesheet">
</head>

Expand All @@ -20,7 +21,7 @@ <h1 class="welcome_title pt-5 m-0 text-center"></h1>
<div class="flex-grow-1">
<div class="games d-flex p-5 w-100 h-100">
<button class="game btn text-white fs-1 bg-danger" style="flex-basis: 50%">Matchup</button>
<button class="game btn text-white fs-1 bg-success" style="flex-basis: 50%">Quiz (Work in progress)</button>
<button class="game btn text-white fs-1 bg-success" style="flex-basis: 50%">Quiz</button>
</div>
<div class="topics d-flex p-5 w-100 h-100">
<button class="topic btn text-white fs-1 bg-danger" style="flex-basis: 33.3%">Dynamics</button>
Expand Down Expand Up @@ -54,6 +55,7 @@ <h1 class="welcome_title pt-5 m-0 text-center"></h1>
</section>

<script src="matchup.js"></script>
<script src="quiz.js"></script>

<script>
function start() {
Expand Down Expand Up @@ -102,7 +104,7 @@ <h1 class="welcome_title pt-5 m-0 text-center"></h1>
document.querySelector(".match-up").classList.remove('d-none');
startStopwatch();
script("Music", topic_chosen);
} else if (game_chosen == "Quiz (Work in progress)") {
} else if (game_chosen == "Quiz") {
document.querySelector(".quiz").classList.remove('d-none');
startQuizStopwatch();
quiz("Music", topic_chosen);
Expand All @@ -116,4 +118,4 @@ <h1 class="welcome_title pt-5 m-0 text-center"></h1>

</body>

</html>
</html>
13 changes: 5 additions & 8 deletions quiz.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const sect = document.querySelector('.quiz');
const option1 = document.querySelector('.opt1');
const option2 = document.querySelector('.opt2');
const option3 = document.querySelector('.opt3');
const option4 = document.querySelector('.opt4');

const section = document.querySelector('.quiz');

let timer;
let stopwatch = document.querySelector('.stopwatch');
let s = 0;
Expand Down Expand Up @@ -55,7 +56,7 @@ function quiz(subject, topic) {
.then(response => response.json())
.then(data => {
console.log("Test 2 passed");

let shuffled = shuffle(data);

shuffled.forEach(item => {
Expand All @@ -71,11 +72,7 @@ function quiz(subject, topic) {
option4.innerHTML = item.meaning;
}
});



});
})
.catch(error => console.error('Error fetching JSON', error));
})
.catch(error => console.error('Error fetching JSON', error));

}

0 comments on commit af02066

Please sign in to comment.