Commit 9b3584a0 authored by limingzhe's avatar limingzhe

fix: debug

parent 642da394
......@@ -592,12 +592,12 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
ques.zh_cn = zh_cn;
ques.pos = pos;
console.log("word: " , word);
console.log("ipa: " , ipa);
console.log("zh_cn: " , zh_cn);
console.log("pos: " , pos);
console.log("word: ", word);
console.log("ipa: ", ipa);
console.log("zh_cn: ", zh_cn);
console.log("pos: ", pos);
console.log("targetRow: " , targetRow);
console.log("targetRow: ", targetRow);
this.refresh();
};
......@@ -761,7 +761,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
if (_rightData) {
option = _rightData;
} else {
const randomIndex = Math.floor( Math.random() * copyData.length );
const randomIndex = Math.floor(Math.random() * copyData.length);
option = copyData[randomIndex];
copyData.splice(randomIndex, 1);
}
......@@ -795,6 +795,12 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
oneOption
)
for (let i = optionArr.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[optionArr[i], optionArr[j]] = [optionArr[j], optionArr[i]]; // 使用ES6的解构赋值进行交换
}
this.refresh();
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment