Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64e992c6b6 | ||
|
|
0fd0981a39 |
@@ -17,6 +17,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<!--{{USER}}-->
|
<!--{{USER}}-->
|
||||||
<form id="flash" action="">
|
<form id="flash" action="">
|
||||||
|
<h1 name="status"></h1>
|
||||||
<input type="text" name="idq" readonly=true value="" style="display: none;">
|
<input type="text" name="idq" readonly=true value="" style="display: none;">
|
||||||
<div name="question"></div>
|
<div name="question"></div>
|
||||||
<div name="clues"></div>
|
<div name="clues"></div>
|
||||||
@@ -36,6 +37,18 @@
|
|||||||
map((key) => [
|
map((key) => [
|
||||||
[key, knowledgebase[key]]
|
[key, knowledgebase[key]]
|
||||||
])
|
])
|
||||||
|
function shuffle(array) {
|
||||||
|
let currentIndex = array.length, randomIndex;
|
||||||
|
while (currentIndex != 0) {
|
||||||
|
randomIndex = Math.floor(Math.random() * currentIndex);
|
||||||
|
currentIndex--;
|
||||||
|
[array[currentIndex], array[randomIndex]] = [
|
||||||
|
array[randomIndex], array[currentIndex]];
|
||||||
|
}
|
||||||
|
return array;
|
||||||
|
}
|
||||||
|
shuffle(knowledgebase)
|
||||||
|
|
||||||
console.log(0, knowledgebase)
|
console.log(0, knowledgebase)
|
||||||
|
|
||||||
function passQuestion(form) {
|
function passQuestion(form) {
|
||||||
@@ -92,9 +105,15 @@
|
|||||||
todo = ["", {Q: "ALL DONE"}]
|
todo = ["", {Q: "ALL DONE"}]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
form.children.status.innerHTML = knowledgebase.length.toString()
|
||||||
|
|
||||||
form.children.idq.value = todo[0]
|
form.children.idq.value = todo[0]
|
||||||
|
|
||||||
|
if (todo[1].Q.startsWith("img:")) {
|
||||||
|
form.children.question.innerHTML = `<img src="static/${todo[1].Q.slice(4, 1000)}"/>`
|
||||||
|
} else {
|
||||||
form.children.question.innerHTML = `<h3>${todo[1].Q}</h3>`
|
form.children.question.innerHTML = `<h3>${todo[1].Q}</h3>`
|
||||||
|
}
|
||||||
form.children.question.value = todo[1].Q
|
form.children.question.value = todo[1].Q
|
||||||
|
|
||||||
let clues = ""
|
let clues = ""
|
||||||
|
|||||||
Reference in New Issue
Block a user