|
@@ -49,7 +49,7 @@
|
|
|
? CorrectData.sentences
|
|
|
: curQue.sentences"
|
|
|
:key="`sentence-${i}`"
|
|
|
- :data-serial="i + 1"
|
|
|
+ :data-serial="judgeAnswer == 'standardAnswer' ? changeNumber(i) : i + 1"
|
|
|
class="drag-sentence"
|
|
|
>
|
|
|
<span
|
|
@@ -175,6 +175,28 @@ export default {
|
|
|
if (this.judgeAnswer == "userAnswer") {
|
|
|
} else if (this.judgeAnswer == "standardAnswer") {
|
|
|
let data = JSON.parse(JSON.stringify(this.curQue));
|
|
|
+ let arr = [];
|
|
|
+ data.sentences.forEach((item, index) => {
|
|
|
+ let flag = false;
|
|
|
+ item.forEach((items, indexs) => {
|
|
|
+ if (items.isSpace) {
|
|
|
+ if (
|
|
|
+ this.curQue.Bookanswer.answerList[index][items.index]
|
|
|
+ .userAnswerJudge == "[JUDGE##F##JUDGE]"
|
|
|
+ ) {
|
|
|
+ if (!flag) {
|
|
|
+ flag = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ arr.push(flag);
|
|
|
+ });
|
|
|
+ arr.forEach((item, index) => {
|
|
|
+ if (!item) {
|
|
|
+ data.sentences.splice(index, 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
data.sentences.forEach((item, index) => {
|
|
|
item.forEach((items, indexs) => {
|
|
|
if (items.isSpace) {
|
|
@@ -221,6 +243,37 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 计算序号
|
|
|
+ changeNumber(i) {
|
|
|
+ let index = null;
|
|
|
+ this.curQue.sentences.forEach((item, indexs) => {
|
|
|
+ let flag = true;
|
|
|
+ if (this.CorrectData.sentences[i].length == item.length) {
|
|
|
+ item.forEach((items, indexss) => {
|
|
|
+ if (items.isSpace) {
|
|
|
+ if (
|
|
|
+ this.CorrectData.sentences[i][indexss].answer != items.answer
|
|
|
+ ) {
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (
|
|
|
+ this.CorrectData.sentences[i][indexss].sentence !=
|
|
|
+ items.sentence
|
|
|
+ ) {
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+ if (flag) {
|
|
|
+ index = indexs;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return index + 1;
|
|
|
+ },
|
|
|
changeClass(index, indexs, indexss) {
|
|
|
let className = "";
|
|
|
if (Object.prototype.toString.call(index).indexOf("Number") != -1) {
|
|
@@ -244,13 +297,14 @@ export default {
|
|
|
}
|
|
|
} else if (this.judgeAnswer == "standardAnswer") {
|
|
|
if (this.CorrectData.sentences[index][indexss].isSpace) {
|
|
|
- if (this.CorrectData.sentences[index][indexss].dragList.length > 0) {
|
|
|
+ if (
|
|
|
+ this.CorrectData.sentences[index][indexss].dragList.length > 0
|
|
|
+ ) {
|
|
|
className = "correct";
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
return className;
|
|
|
},
|
|
|
onMove(e) {
|
|
@@ -300,20 +354,27 @@ export default {
|
|
|
},
|
|
|
// 判断对错
|
|
|
changeuserAnswerJudge() {
|
|
|
- this.curQue.Bookanswer.answerList.forEach((item, index) => {
|
|
|
+ this.curQue.sentences.forEach((item, index) => {
|
|
|
item.forEach((items, indexs) => {
|
|
|
- if (items.answer) {
|
|
|
- if (this.curQue.Bookanswer.dragList[index][indexs]) {
|
|
|
- if (
|
|
|
- items.answer ==
|
|
|
- this.curQue.Bookanswer.dragList[index][indexs].sentence
|
|
|
- ) {
|
|
|
- items.userAnswerJudge = "[JUDGE##T##JUDGE]";
|
|
|
- } else {
|
|
|
- items.userAnswerJudge = "[JUDGE##F##JUDGE]";
|
|
|
+ if (items.isSpace) {
|
|
|
+ if (items.answer) {
|
|
|
+ if (items.dragList) {
|
|
|
+ if (items.dragList.length > 0) {
|
|
|
+ if (items.answer == items.dragList[0].sentence) {
|
|
|
+ this.curQue.Bookanswer.answerList[index][
|
|
|
+ items.index
|
|
|
+ ].userAnswerJudge = "[JUDGE##T##JUDGE]";
|
|
|
+ } else {
|
|
|
+ this.curQue.Bookanswer.answerList[index][
|
|
|
+ items.index
|
|
|
+ ].userAnswerJudge = "[JUDGE##F##JUDGE]";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.curQue.Bookanswer.answerList[index][
|
|
|
+ items.index
|
|
|
+ ].userAnswerJudge = "[JUDGE##F##JUDGE]";
|
|
|
+ }
|
|
|
}
|
|
|
- } else {
|
|
|
- items.userAnswerJudge = "[JUDGE##F##JUDGE]";
|
|
|
}
|
|
|
}
|
|
|
});
|