|
@@ -10,20 +10,8 @@
|
|
|
: true
|
|
|
"
|
|
|
>
|
|
|
- <h6
|
|
|
- v-if="judgeAnswer == 'userAnswer' || judgeAnswer == 'studentAnswer'"
|
|
|
- class="standardTitle"
|
|
|
- style="margin: 10px 0 8px 24px"
|
|
|
- >
|
|
|
- {{ judgeAnswer == "userAnswer" ? "Your answer" : "Student answers" }}
|
|
|
- </h6>
|
|
|
- <h6
|
|
|
- v-else-if="judgeAnswer == 'standardAnswer'"
|
|
|
- class="standardTitle"
|
|
|
- style="margin: 10px 0 8px 24px"
|
|
|
- >
|
|
|
- Standard answer
|
|
|
- </h6>
|
|
|
+ <AnswerTitle :judgeAnswer="judgeAnswer" />
|
|
|
+
|
|
|
<h2>{{ curQue.title }}</h2>
|
|
|
<div
|
|
|
class="item-box"
|
|
@@ -43,7 +31,7 @@
|
|
|
:options="{
|
|
|
group: { name: 'itxst' + index, pull: 'clone' },
|
|
|
}"
|
|
|
- :sort="TaskModel == 'ANSWER' ? 'false' : 'true'"
|
|
|
+ :sort="TaskModel == 'ANSWER' ? false : true"
|
|
|
class="content-box"
|
|
|
>
|
|
|
<transition-group>
|
|
@@ -55,7 +43,8 @@
|
|
|
: '',
|
|
|
judgeAnswer == 'standardAnswer'
|
|
|
? 'correct'
|
|
|
- : judgeAnswer == 'studentAnswer'
|
|
|
+ : judgeAnswer == 'studentAnswer' ||
|
|
|
+ judgeAnswer == 'userAnswer'
|
|
|
? itemNode.correct == 'correct'
|
|
|
? 'correct'
|
|
|
: 'error'
|
|
@@ -89,8 +78,10 @@
|
|
|
|
|
|
<script>
|
|
|
import draggable from "vuedraggable";
|
|
|
+import AnswerTitle from "../preview/components/AnswerTitle.vue";
|
|
|
+
|
|
|
export default {
|
|
|
- components: { draggable },
|
|
|
+ components: { draggable, AnswerTitle },
|
|
|
props: ["curQue", "TaskModel", "judgeAnswer"],
|
|
|
data() {
|
|
|
return {
|
|
@@ -133,11 +124,15 @@ export default {
|
|
|
},
|
|
|
// 清空当前选中的文字
|
|
|
removeCurrentSortArr(item, index) {
|
|
|
+ if (this.TaskModel || this.TaskModel == "ANSWER") {
|
|
|
+ return;
|
|
|
+ }
|
|
|
//this.$set(this.SortArr, index, []);
|
|
|
let wordsList = JSON.parse(
|
|
|
JSON.stringify(this.orgData[index].detail.wordsList)
|
|
|
);
|
|
|
this.$set(item.detail, "wordsList", wordsList);
|
|
|
+ this.$forceUpdate();
|
|
|
},
|
|
|
NOremove() {
|
|
|
this.$message.warning("当前没有可清空的数据");
|
|
@@ -166,50 +161,28 @@ export default {
|
|
|
},
|
|
|
onStart(e, index) {
|
|
|
this.drag = true;
|
|
|
- this.dragData = JSON.parse(
|
|
|
- JSON.stringify(this.curQue.option[index].detail.wordsList)
|
|
|
- );
|
|
|
+ // this.dragData = JSON.parse(
|
|
|
+ // JSON.stringify(this.curQue.option[index].detail.wordsList)
|
|
|
+ // );
|
|
|
},
|
|
|
//拖拽结束事件
|
|
|
onEnd(e, index) {
|
|
|
let _this = this;
|
|
|
_this.drag = false;
|
|
|
- let newarr = [
|
|
|
- ...new Set(this.SortArr[index].map((item) => JSON.stringify(item))),
|
|
|
- ];
|
|
|
- let arr = newarr.map((item) => JSON.parse(item));
|
|
|
+ // let newarr = [
|
|
|
+ // ...new Set(this.SortArr[index].map((item) => JSON.stringify(item))),
|
|
|
+ // ];
|
|
|
+ // let arr = newarr.map((item) => JSON.parse(item));
|
|
|
// this.curQue.option[index].detail.wordsList = JSON.parse(
|
|
|
// JSON.stringify(this.dragData)
|
|
|
// );
|
|
|
this.changeuserAnswerJudge(index);
|
|
|
//如果左边
|
|
|
- if (arr.length == this.SortArr[index].length) {
|
|
|
- return;
|
|
|
- }
|
|
|
- this.SortArr[index].splice(e.newDraggableIndex, 1);
|
|
|
- },
|
|
|
- onStart2(e, index) {
|
|
|
- this.drag = true;
|
|
|
- this.dragData = JSON.parse(JSON.stringify(this.SortArr[index]));
|
|
|
- },
|
|
|
- //拖拽结束事件
|
|
|
- onEnd2(e, index) {
|
|
|
- this.drag = false;
|
|
|
- // 不再删除
|
|
|
- this.SortArr[index] = this.dragData;
|
|
|
- let newarr = [
|
|
|
- ...new Set(
|
|
|
- this.curQue.option[index].detail.wordsList.map((item) =>
|
|
|
- JSON.stringify(item)
|
|
|
- )
|
|
|
- ),
|
|
|
- ];
|
|
|
- let arr = newarr.map((item) => JSON.parse(item));
|
|
|
- //如果左边
|
|
|
- if (arr.length == this.curQue.option[index].detail.wordsList.length) {
|
|
|
- return;
|
|
|
- }
|
|
|
- this.curQue.option[index].detail.wordsList.splice(e.newDraggableIndex, 1);
|
|
|
+ // if (arr.length == this.SortArr[index].length) {
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // this.SortArr[index].splice(e.newDraggableIndex, 1);
|
|
|
+ this.$forceUpdate();
|
|
|
},
|
|
|
onMove(e) {
|
|
|
// this.moveId = e.relatedContext.element.id;
|
|
@@ -250,7 +223,10 @@ export default {
|
|
|
);
|
|
|
}
|
|
|
});
|
|
|
- } else if (this.judgeAnswer == "studentAnswer") {
|
|
|
+ } else if (
|
|
|
+ this.judgeAnswer == "studentAnswer" ||
|
|
|
+ this.judgeAnswer == "userAnswer"
|
|
|
+ ) {
|
|
|
this.curQue.Bookanswer.forEach((item) => {
|
|
|
if (item.userAnswerJudge == "[JUDGE##F##JUDGE]") {
|
|
|
item.detail.wordsList.forEach((items, i) => {
|