|
@@ -39,7 +39,7 @@
|
|
-->
|
|
-->
|
|
<div
|
|
<div
|
|
class="text"
|
|
class="text"
|
|
- :class="['left' + index, YouranswerClass(item, 'left')]"
|
|
|
|
|
|
+ :class="['left' + index, YouranswerClass(index, 'left')]"
|
|
v-if="
|
|
v-if="
|
|
item.detail.wordsList.length > 0 || item.detail.sentence
|
|
item.detail.wordsList.length > 0 || item.detail.sentence
|
|
"
|
|
"
|
|
@@ -157,7 +157,7 @@
|
|
-->
|
|
-->
|
|
<div
|
|
<div
|
|
class="text"
|
|
class="text"
|
|
- :class="['right' + index, YouranswerClass(item, 'right')]"
|
|
|
|
|
|
+ :class="['right' + index, YouranswerClass(index, 'right')]"
|
|
v-if="
|
|
v-if="
|
|
item.detail.wordsList.length > 0 || item.detail.sentence
|
|
item.detail.wordsList.length > 0 || item.detail.sentence
|
|
"
|
|
"
|
|
@@ -263,44 +263,44 @@ export default {
|
|
//方法集合
|
|
//方法集合
|
|
methods: {
|
|
methods: {
|
|
// 判断对错
|
|
// 判断对错
|
|
- YouranswerClass(item, type) {
|
|
|
|
|
|
+ YouranswerClass(index, type) {
|
|
if (
|
|
if (
|
|
this.judgeAnswer == "studentAnswer" ||
|
|
this.judgeAnswer == "studentAnswer" ||
|
|
this.judgeAnswer == "userAnswer" ||
|
|
this.judgeAnswer == "userAnswer" ||
|
|
this.judgeAnswer == "standardAnswer"
|
|
this.judgeAnswer == "standardAnswer"
|
|
) {
|
|
) {
|
|
let clss = "";
|
|
let clss = "";
|
|
- this.data.data.forEach((items) => {
|
|
|
|
|
|
+ this.data.data.forEach((items, i) => {
|
|
if (type == "left") {
|
|
if (type == "left") {
|
|
- if (items.source) {
|
|
|
|
- if (items.correct) {
|
|
|
|
- clss = "correct";
|
|
|
|
- } else if (items.error) {
|
|
|
|
- clss = "error";
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- if (
|
|
|
|
- Object.prototype.toString
|
|
|
|
- .call(items.answer)
|
|
|
|
- .indexOf("Number") != -1
|
|
|
|
- ) {
|
|
|
|
- clss = "error";
|
|
|
|
|
|
+ if (index == i) {
|
|
|
|
+ if (items.source) {
|
|
|
|
+ if (items.correct) {
|
|
|
|
+ clss = "correct";
|
|
|
|
+ } else if (items.error) {
|
|
|
|
+ clss = "error";
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (items.correct) {
|
|
|
|
+ clss = "correct";
|
|
|
|
+ } else if (items.error) {
|
|
|
|
+ clss = "error";
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- if (items.target) {
|
|
|
|
- if (items.correct) {
|
|
|
|
- clss = "correct";
|
|
|
|
- } else if (items.error) {
|
|
|
|
- clss = "error";
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- if (
|
|
|
|
- Object.prototype.toString
|
|
|
|
- .call(items.answer)
|
|
|
|
- .indexOf("Number") != -1
|
|
|
|
- ) {
|
|
|
|
- clss = "error";
|
|
|
|
|
|
+ if (index == i) {
|
|
|
|
+ if (items.target) {
|
|
|
|
+ if (items.correct) {
|
|
|
|
+ clss = "correct";
|
|
|
|
+ } else if (items.error) {
|
|
|
|
+ clss = "error";
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (items.correct) {
|
|
|
|
+ clss = "correct";
|
|
|
|
+ } else if (items.error) {
|
|
|
|
+ clss = "error";
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -712,23 +712,24 @@ export default {
|
|
) {
|
|
) {
|
|
if (item.target == this.curQue.option[con.AnswerList].nodeId) {
|
|
if (item.target == this.curQue.option[con.AnswerList].nodeId) {
|
|
item.correct = true;
|
|
item.correct = true;
|
|
|
|
+ item.error = false;
|
|
} else {
|
|
} else {
|
|
|
|
+ item.correct = false;
|
|
item.error = true;
|
|
item.error = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ } else {
|
|
|
|
+ if (
|
|
|
|
+ Object.prototype.toString.call(item.answer).indexOf("Number") != -1
|
|
|
|
+ ) {
|
|
|
|
+ item.error = true;
|
|
|
|
+ item.correct = false;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- // else if (
|
|
|
|
- // !item.source &&
|
|
|
|
- // !item.target &&
|
|
|
|
- // Object.prototype.toString.call(item.answer).indexOf("Number") != -1
|
|
|
|
- // ) {
|
|
|
|
- // item.error = true;
|
|
|
|
- // }
|
|
|
|
});
|
|
});
|
|
}
|
|
}
|
|
-
|
|
|
|
if (this.data.data.length > 0) {
|
|
if (this.data.data.length > 0) {
|
|
this.data.data.forEach((item) => {
|
|
this.data.data.forEach((item) => {
|
|
this.jsPlumb.connect({
|
|
this.jsPlumb.connect({
|