|
@@ -1032,6 +1032,7 @@
|
|
|
if (!this.disabledDrag) {
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
let index = -1
|
|
|
for (var j = 0; j < this.drag[this.scantron.sort].option.length; j++) {
|
|
|
let option = this.drag[this.scantron.sort].option[j]
|
|
@@ -1046,6 +1047,7 @@
|
|
|
let asda = (event) => {
|
|
|
document.removeEventListener('mouseup', asda)
|
|
|
this.disabledDrag = false
|
|
|
+ let dragOne;
|
|
|
let bxs = true
|
|
|
// 处理鼠标抬起事件
|
|
|
for (var i = 0; i < this.drag[this.scantron.sort].answer.length; i++) {
|
|
@@ -1066,7 +1068,21 @@
|
|
|
.scantron.sort].option[index]
|
|
|
.height)) >= drag.y
|
|
|
) {
|
|
|
+ for (var p = 0; p < this.drag[this.scantron.sort].answer.length; p++) {
|
|
|
+ if (this.drag[this.scantron.sort].answer[p].op !== undefined&&this.drag[this.scantron.sort].answer[p].op === index) {
|
|
|
+ this.drag[this.scantron.sort].answer[p].op = undefined
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.drag[this.scantron.sort].answer[i].op !== undefined) {
|
|
|
+ this.tap(this.drag[this.scantron.sort].answer[i].op, this.drag[this.scantron.sort]
|
|
|
+ .option[this.drag[this.scantron.sort].answer[i].op].old.ax, this.drag[this.scantron.sort]
|
|
|
+ .option[this.drag[this.scantron.sort].answer[i].op].old.by);
|
|
|
+ this.drag[this.scantron.sort].answer[i].op = index
|
|
|
+ } else {
|
|
|
+ this.drag[this.scantron.sort].answer[i].op = index
|
|
|
+ }
|
|
|
this.tap(index, x, y);
|
|
|
+ dragOne = drag
|
|
|
bxs = false
|
|
|
break;
|
|
|
}
|
|
@@ -1077,13 +1093,9 @@
|
|
|
.sort].option[index].old.by);
|
|
|
}
|
|
|
setTimeout(() => {
|
|
|
- for (var i = 0; i < this.drag[this.scantron.sort].option.length; i++) {
|
|
|
- this.drag[this.scantron.sort].option[i]
|
|
|
- for (var j = 0; j < this.drag[this.scantron.sort].answer.length; j++) {
|
|
|
- this.drag[this.scantron.sort].answer[j]
|
|
|
- }
|
|
|
+ if (dragOne !== undefined) {
|
|
|
+ this.radioAdd(this.dragItem, dragOne.id.replace("answer", ""), this.scantron)
|
|
|
}
|
|
|
- this.radioAdd(this.dragItem, i, this.scantron)
|
|
|
this.disabledDrag = true
|
|
|
}, 700)
|
|
|
}
|
|
@@ -1488,6 +1500,10 @@
|
|
|
content: blankAnswer[j].content
|
|
|
})
|
|
|
} else {
|
|
|
+ arrAnswer.push({
|
|
|
+ tag: index,
|
|
|
+ content: value.id
|
|
|
+ })
|
|
|
bc = false
|
|
|
}
|
|
|
}
|