parent
0fd0981a39
commit
64e992c6b6
|
|
@ -37,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) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue