Commit 9b3584a0 authored by limingzhe's avatar limingzhe

fix: debug

parent 642da394
......@@ -585,19 +585,19 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
const ipa = targetRow[1].replace(/"/g, '');
const zh_cn = targetRow[3].replace(/"/g, '');
const pos = targetRow[4].replace(/"/g, '');
ques.word = word;
ques.ipa = ipa;
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("targetRow: " , targetRow);
console.log("word: ", word);
console.log("ipa: ", ipa);
console.log("zh_cn: ", zh_cn);
console.log("pos: ", pos);
console.log("targetRow: ", targetRow);
this.refresh();
};
......@@ -644,7 +644,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
const ipa = targetRow[1].replace(/"/g, '');
const zh_cn = targetRow[3].replace(/"/g, '');
const pos = targetRow[4].replace(/"/g, '');
ques.word = word.split('').join(' ');
......@@ -657,7 +657,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
// ques.ipa = ipa;
// ques.zh_cn = zh_cn;
// ques.pos = pos;
// console.log("word: " , word);
// console.log("ipa: " , ipa);
// console.log("zh_cn: " , zh_cn);
......@@ -667,7 +667,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this.refresh();
};
reader.readAsText(textFile);
......@@ -681,18 +681,18 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
// 听写
this.addOnePageBtnClick(false);
var curQues = this.item.quesArr[this.item.quesArr.length - 1];
curQues.type = 'dictation';
curQues.title = 'Listen. Write down the word on your note book.';
const optionArr = [];
this.addOnePageBtnClick(false);
var curQues = this.item.quesArr[this.item.quesArr.length - 1];
curQues.type = 'dictation';
curQues.title = 'Listen. Write down the word on your note book.';
const optionArr = [];
for (let i = 0; i < this.wordDataArr.length; i++) {
for (let i = 0; i < this.wordDataArr.length; i++) {
const textFile = this.wordDataArr[i].textFile;
const audioFile = this.wordDataArr[i].audioFile;
......@@ -712,12 +712,12 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
// const ipa = targetRow[1].replace(/"/g, '');
// const zh_cn = targetRow[3].replace(/"/g, '');
// const pos = targetRow[4].replace(/"/g, '');
option['text'] = word;
};
reader.readAsText(textFile);
optionArr.push(option);
}
......@@ -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);
}
......@@ -782,19 +782,25 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
const zh_cn = targetRow[3].replace(/"/g, '');
const pos = targetRow[4].replace(/"/g, '');
const oneOption = {
const oneOption = {
text: quesData.selectType == 'en' ? zh_cn : word,
answer: _rightData ? 'isRight' : 'isWrong'
};
if (quesData.selectType != 'en') {
oneOption['audio_url'] = audioFile?.response?.url || '';
}
}
optionArr.push(
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();
};
......@@ -817,7 +823,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
......
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