Fix button generator

This commit is contained in:
Thomas A. Christensen II 2022-09-24 19:02:54 -05:00
parent f1879cb843
commit 51e18968c9

View file

@ -9,7 +9,7 @@
<input id="num-questions" type="number" value="15" /> <input id="num-questions" type="number" value="15" />
</div> </div>
<hr /> <hr />
<button onClick="generate_quiz">Generate!</button> <button id="generator">Generate!</button>
<hr /> <hr />
<h2>Quiz</h2> <h2>Quiz</h2>
<ul id="quiz-terms"></ul> <ul id="quiz-terms"></ul>
@ -183,6 +183,8 @@
const terms_list = document.getElementById("quiz-terms"); const terms_list = document.getElementById("quiz-terms");
function generate_quiz() { function generate_quiz() {
terms_list.innerHTML = "";
let weights = []; let weights = [];
let types = []; let types = [];
@ -556,6 +558,10 @@
"Iliopsoas" "Iliopsoas"
]; ];
document
.getElementById("generator")
.addEventListener("click", generate_quiz);
generate_quiz(); generate_quiz();
</script> </script>
</body> </body>