瀏覽代碼

#3715 C1125 学校/个人题库--快速组卷,增加框选组题切换题型引导提示

XW 5 月之前
父節點
當前提交
1152c5547d
共有 2 個文件被更改,包括 27 次插入14 次删除
  1. 5 5
      TEAMModelOS/ClientApp/src/common/BaseQuickPaper.vue
  2. 22 9
      TEAMModelOS/ClientApp/src/common/MarkCanvas.vue

+ 5 - 5
TEAMModelOS/ClientApp/src/common/BaseQuickPaper.vue

@@ -192,7 +192,7 @@
 			<div style="margin-top: 10px">
 			<div style="margin-top: 10px">
 			</div>
 			</div>
 			<div style="margin-top: 10px;" v-if="isScreenshot">
 			<div style="margin-top: 10px;" v-if="isScreenshot">
-				<MarkCanvas ref="markCanvasRef" :markIndex="markIndex" :list="markList" :markImgUrl="markImgUrl" :quesNum="orderItemsArr.length" :editQuesIndex="editQuesIndex"></MarkCanvas>
+				<MarkCanvas ref="markCanvasRef" :quesType="screenType" :markIndex="markIndex" :list="markList" :markImgUrl="markImgUrl" :quesNum="orderItemsArr.length" :editQuesIndex="editQuesIndex"></MarkCanvas>
 			</div>
 			</div>
 		</Modal>
 		</Modal>
 	</div>
 	</div>
@@ -1185,8 +1185,8 @@
 					if(this.editQuesIndex != -1) {
 					if(this.editQuesIndex != -1) {
 						item.qIndex = this.editQuesIndex
 						item.qIndex = this.editQuesIndex
 						this.orderItemsArr[this.editQuesIndex] = ({
 						this.orderItemsArr[this.editQuesIndex] = ({
-							type: this.screenType,
-							options: ["single", "multiple"].includes(this.screenType) ? 4 : 0,
+							type: item.type,
+							options: ["single", "multiple"].includes(item.type) ? 4 : 0,
 							answer: "",
 							answer: "",
 							answerType: "text",
 							answerType: "text",
 							answerLang: "zh",
 							answerLang: "zh",
@@ -1198,8 +1198,8 @@
 					} else {
 					} else {
 						item.qIndex = this.orderItemsArr.length
 						item.qIndex = this.orderItemsArr.length
 						this.orderItemsArr.push({
 						this.orderItemsArr.push({
-							type: this.screenType,
-							options: ["single", "multiple"].includes(this.screenType) ? 4 : 0,
+							type: item.type,
+							options: ["single", "multiple"].includes(item.type) ? 4 : 0,
 							answer: "",
 							answer: "",
 							answerType: "text",
 							answerType: "text",
 							answerLang: "zh",
 							answerLang: "zh",

+ 22 - 9
TEAMModelOS/ClientApp/src/common/MarkCanvas.vue

@@ -29,6 +29,10 @@ export default {
             type: Number,
             type: Number,
             default: 0
             default: 0
         },
         },
+        quesType: {
+            type: String,
+            default: ''
+        },
     },
     },
     data() {
     data() {
         return {
         return {
@@ -253,7 +257,8 @@ export default {
                                 y: em.offsetY,
                                 y: em.offsetY,
                                 w: mark.w - (em.offsetX - sX),
                                 w: mark.w - (em.offsetX - sX),
                                 h: mark.h - (em.offsetY - sY),
                                 h: mark.h - (em.offsetY - sY),
-                                addIndex: mark.addIndex
+                                addIndex: mark.addIndex,
+                                type: mark.type,
                             }
                             }
                             break;
                             break;
                         case 2:
                         case 2:
@@ -262,7 +267,8 @@ export default {
                                 y: mark.y + (em.offsetY - sY),
                                 y: mark.y + (em.offsetY - sY),
                                 w: mark.w + (em.offsetX - sX),
                                 w: mark.w + (em.offsetX - sX),
                                 h: mark.h - (em.offsetY - sY),
                                 h: mark.h - (em.offsetY - sY),
-                                addIndex: mark.addIndex
+                                addIndex: mark.addIndex,
+                                type: mark.type,
                             }
                             }
                             break;
                             break;
                         case 3:
                         case 3:
@@ -271,7 +277,8 @@ export default {
                                 y: mark.y,
                                 y: mark.y,
                                 w: mark.w - (em.offsetX - sX),
                                 w: mark.w - (em.offsetX - sX),
                                 h: mark.h + (em.offsetY - sY),
                                 h: mark.h + (em.offsetY - sY),
-                                addIndex: mark.addIndex
+                                addIndex: mark.addIndex,
+                                type: mark.type,
                             }
                             }
                             break;
                             break;
                         case 4:
                         case 4:
@@ -280,7 +287,8 @@ export default {
                                 y: mark.y,
                                 y: mark.y,
                                 w: mark.w + (em.offsetX - sX),
                                 w: mark.w + (em.offsetX - sX),
                                 h: mark.h + (em.offsetY - sY),
                                 h: mark.h + (em.offsetY - sY),
-                                addIndex: mark.addIndex
+                                addIndex: mark.addIndex,
+                                type: mark.type,
                             }
                             }
                             break;
                             break;
                     }
                     }
@@ -351,7 +359,9 @@ export default {
                     if (start && Math.abs(eu.offsetX - sX) > 10 && Math.abs(eu.offsetY - sY) > 10) {
                     if (start && Math.abs(eu.offsetX - sX) > 10 && Math.abs(eu.offsetY - sY) > 10) {
                         // 改变矩形数组
                         // 改变矩形数组
                         let frame = {
                         let frame = {
-                            x: sX, y: sY, w: eu.offsetX - sX, h: eu.offsetY - sY, addIndex: that.cavList.length - that.list.length + 1 + that.quesNum
+                            x: sX, y: sY, w: eu.offsetX - sX, h: eu.offsetY - sY,
+                            addIndex: that.cavList.length - that.list.length + 1 + that.quesNum,
+                            type: that.quesType,
                         };
                         };
                         that.cavList.push(frame);
                         that.cavList.push(frame);
                         // 重新绘制
                         // 重新绘制
@@ -375,7 +385,9 @@ export default {
                     if (start && Math.abs(eo.offsetX - sX) > 10 && Math.abs(eo.offsetY - sY) > 10) {
                     if (start && Math.abs(eo.offsetX - sX) > 10 && Math.abs(eo.offsetY - sY) > 10) {
                         // 改变矩形数组
                         // 改变矩形数组
                         let frame = {
                         let frame = {
-                            x: sX, y: sY, w: eo.offsetX - sX, h: eo.offsetY - sY, addIndex: that.cavList.length - that.list.length + 1 + that.quesNum
+                            x: sX, y: sY, w: eo.offsetX - sX, h: eo.offsetY - sY,
+                            addIndex: that.cavList.length - that.list.length + 1 + that.quesNum,
+                            type: that.quesType,
                         };
                         };
                         that.cavList.push(frame);
                         that.cavList.push(frame);
                         // 重新绘制
                         // 重新绘制
@@ -441,7 +453,8 @@ export default {
                     y: mark.y + (em.offsetY - sY),
                     y: mark.y + (em.offsetY - sY),
                     w: mark.w,
                     w: mark.w,
                     h: mark.h,
                     h: mark.h,
-                    addIndex: mark.addIndex
+                    addIndex: mark.addIndex,
+                    type: mark.type,
                 }
                 }
                 // 更新矩形数组中选中矩形的数据
                 // 更新矩形数组中选中矩形的数据
                 that.cavList.splice(i, 1, iframe);
                 that.cavList.splice(i, 1, iframe);
@@ -535,7 +548,7 @@ export default {
                     this.contentText.rect(value.x, value.y, value.w, value.h);
                     this.contentText.rect(value.x, value.y, value.w, value.h);
                     this.contentText.stroke();
                     this.contentText.stroke();
                     this.contentText.fillStyle = 'blue'
                     this.contentText.fillStyle = 'blue'
-                    this.contentText.fillText(`${this.$t('answerSheet.tip2')}${this.editQuesIndex != -1 ? this.editQuesIndex + 1 : (value.qIndex !== undefined ? value.qIndex + 1 : value.addIndex)}${this.$t('answerSheet.tip14')}`, value.x + 5, value.y + 20)
+                    this.contentText.fillText(`${this.$t('answerSheet.tip2')}${this.editQuesIndex != -1 ? this.editQuesIndex + 1 : (value.qIndex !== undefined ? value.qIndex + 1 : value.addIndex)}${this.$t('answerSheet.tip14')}(${this.$t(`evaluation.${value.type}`)})`, value.x + 5, value.y + 20)
                 }
                 }
             });
             });
             // 绘制已选中部分
             // 绘制已选中部分
@@ -580,7 +593,7 @@ export default {
                     this.contentText.fillStyle = "red";
                     this.contentText.fillStyle = "red";
                     this.contentText.fill();// 画终点实心圆
                     this.contentText.fill();// 画终点实心圆
                     this.contentText.stroke();
                     this.contentText.stroke();
-                    this.contentText.fillText(`${this.$t('answerSheet.tip2')}${this.editQuesIndex != -1 ? this.editQuesIndex + 1 : (value.qIndex !== undefined ? value.qIndex + 1 : value.addIndex)}${this.$t('answerSheet.tip14')}`, value.x + 5, value.y + 20)
+                    this.contentText.fillText(`${this.$t('answerSheet.tip2')}${this.editQuesIndex != -1 ? this.editQuesIndex + 1 : (value.qIndex !== undefined ? value.qIndex + 1 : value.addIndex)}${this.$t('answerSheet.tip14')}(${this.$t(`evaluation.${value.type}`)})`, value.x + 5, value.y + 20)
                 }
                 }
             })
             })
         }
         }