Compare commits

...

3 Commits

Author SHA1 Message Date
Bel LaPointe d32d8059bb todo 2023-04-07 14:06:42 -06:00
Bel LaPointe 64e992c6b6 shuffle http 2023-04-07 14:01:52 -06:00
Bel LaPointe 0fd0981a39 Q can be image in http 2023-04-07 13:56:04 -06:00
2 changed files with 24 additions and 3 deletions

View File

@ -17,6 +17,7 @@
<body>
<!--{{USER}}-->
<form id="flash" action="">
<h1 name="status"></h1>
<input type="text" name="idq" readonly=true value="" style="display: none;">
<div name="question"></div>
<div name="clues"></div>
@ -36,6 +37,18 @@
map((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)
function passQuestion(form) {
@ -92,9 +105,15 @@
todo = ["", {Q: "ALL DONE"}]
}
form.children.status.innerHTML = knowledgebase.length.toString()
form.children.idq.value = todo[0]
form.children.question.innerHTML = `<h3>${todo[1].Q}</h3>`
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.value = todo[1].Q
let clues = ""

View File

@ -3,9 +3,7 @@ todo:
- exemplary answers; declaring
- exemplary answers; sharing
- tags; declare mastery
- tags; assign to a user
- entrypoint; explicit answer all
- entrypoint; answer tag
- entrypoint; edit question
- entrypoint; delete question
- ascii images from url
@ -31,3 +29,7 @@ done:
ts: Fri Apr 7 10:46:14 MDT 2023
- todo: entrypoint; create question
ts: Fri Apr 7 10:46:14 MDT 2023
- todo: tags; assign to a user
ts: Fri Apr 7 14:06:39 MDT 2023
- todo: entrypoint; answer tag
ts: Fri Apr 7 14:06:39 MDT 2023