Commit 77fa942a6b3ba05f32000003df435b3b06f2ddfe

Authored by LH_PC
1 parent b79b1091

feat:修改打印对接

src/utils/index.js
@@ -885,7 +885,7 @@ export function formatGradeNameClass(data) { @@ -885,7 +885,7 @@ export function formatGradeNameClass(data) {
885 885
886 ///试卷定制化打印 886 ///试卷定制化打印
887 export async function paperPrint(paper) { 887 export async function paperPrint(paper) {
888 - let printWin = window.open("", "_blank", ""); 888 + let printWin = window.open("", "_blank", "");
889 var browser = getBrowserEngine(printWin); 889 var browser = getBrowserEngine(printWin);
890 var subjectName = paper.subjectName; 890 var subjectName = paper.subjectName;
891 var paperTitle = paper.title; 891 var paperTitle = paper.title;
@@ -911,7 +911,7 @@ export async function paperPrint(paper) { @@ -911,7 +911,7 @@ export async function paperPrint(paper) {
911 } 911 }
912 return "Blink"; // Assume it's Chrome, Safari, or an alternative Blink-based browser 912 return "Blink"; // Assume it's Chrome, Safari, or an alternative Blink-based browser
913 } 913 }
914 - function windowPrint(windowParams) { 914 + function windowPrint(windowParams) {
915 windowParams.print(); 915 windowParams.print();
916 windowParams.close(); 916 windowParams.close();
917 } 917 }
src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue
1 <template> 1 <template>
2 - <el-dialog  
3 - :visible.sync="visible"  
4 - width="70%"  
5 - :before-close="handleClose"  
6 - :modal-append-to-body="false"  
7 - > 2 + <el-dialog :visible.sync="visible" width="70%" :before-close="handleClose" :modal-append-to-body="false">
8 <div class="test-box" v-if="groups"> 3 <div class="test-box" v-if="groups">
9 <div class="test"> 4 <div class="test">
10 <div class="test-title" @click="enableEditing"> 5 <div class="test-title" @click="enableEditing">
11 - <div  
12 - class="test-title"  
13 - v-if="!isEditing"  
14 - @mouseenter="handleMouseEnter"  
15 - @mouseleave="handleMouseLeave"  
16 - :class="isHovered ? 'hover' : ''"  
17 - > 6 + <div class="test-title" v-if="!isEditing" @mouseenter="handleMouseEnter" @mouseleave="handleMouseLeave"
  7 + :class="isHovered ? 'hover' : ''">
18 {{ inputValue }} 8 {{ inputValue }}
19 </div> 9 </div>
20 - <div  
21 - v-if="isHovered"  
22 - class="tooltip"  
23 - :style="{  
24 - top: tooltipPosition.y + 'px',  
25 - left: tooltipPosition.x + 'px',  
26 - }"  
27 - > 10 + <div v-if="isHovered" class="tooltip" :style="{
  11 + top: tooltipPosition.y + 'px',
  12 + left: tooltipPosition.x + 'px',
  13 + }">
28 单击设置试卷标题 14 单击设置试卷标题
29 </div> 15 </div>
30 - <el-input  
31 - class="test-title"  
32 - ref="editInput"  
33 - v-if="isEditing"  
34 - v-model="inputValue"  
35 - @blur="save"  
36 - @keyup.enter.native="save"  
37 - style="padding: 0 200px"  
38 - /> 16 + <el-input class="test-title" ref="editInput" v-if="isEditing" v-model="inputValue" @blur="save"
  17 + @keyup.enter.native="save" style="padding: 0 200px" />
39 </div> 18 </div>
40 <div class="test-group"> 19 <div class="test-group">
41 - <div  
42 - class="outer-item"  
43 - v-for="(group, index) in groups"  
44 - :key="group.questionType"  
45 - :class="{  
46 - border: selectedIndex === group.questionType,  
47 - }"  
48 - @mouseenter="handleGroupMouseEnter(group.questionType, 'all')"  
49 - @mouseleave="handleGroupMouseLeave"  
50 - >  
51 - <div  
52 - v-if="selectedIndex == group.questionType"  
53 - class="border-del"  
54 - @click="handleDel(group.questionType, 'all')"  
55 - > 20 + <div class="outer-item" v-for="(group, index) in groups" :key="group.questionType" :class="{
  21 + border: selectedIndex === group.questionType,
  22 + }" @mouseenter="handleGroupMouseEnter(group.questionType, 'all')" @mouseleave="handleGroupMouseLeave">
  23 + <div v-if="selectedIndex == group.questionType" class="border-del"
  24 + @click="handleDel(group.questionType, 'all')">
56 删除 25 删除
57 </div> 26 </div>
58 <!-- 每个组的标题 --> 27 <!-- 每个组的标题 -->
59 - <div  
60 - class="test-group-title"  
61 - :class="{  
62 - border: selectedIndex == group.questionType,  
63 - }"  
64 - @mouseenter="handleGroupMouseEnter(group.questionType, 'all')"  
65 - > 28 + <div class="test-group-title" :class="{
  29 + border: selectedIndex == group.questionType,
  30 + }" @mouseenter="handleGroupMouseEnter(group.questionType, 'all')">
66 <div class="size-16" style="font-weight: 600"> 31 <div class="size-16" style="font-weight: 600">
67 {{ index + 1 }}、 32 {{ index + 1 }}、
68 - <span  
69 - @mouseenter="  
70 - (event) => handleItemMouseEnter(event, group.questionType)  
71 - "  
72 - @mouseleave="handleItemMouseLeave"  
73 - :class="isItemHovered == group.questionType ? 'hover' : ''"  
74 - class="size-16"  
75 - @click="groupEditing(index)"  
76 - v-show="!group.input"  
77 - >{{ group.questionTitle }}</span  
78 - >  
79 -  
80 - <el-input  
81 - :ref="'refInput' + index"  
82 - class="size-16"  
83 - size="mini"  
84 - v-show="group.input"  
85 - v-model="group.questionTitle"  
86 - @blur="groupSave(index)"  
87 - @keyup.enter.native="groupSave(index)"  
88 - style="width: fit-content"  
89 - />  
90 - <div  
91 - v-if="isItemHovered == group.questionType"  
92 - class="tooltip"  
93 - :style="{  
94 - top: tooltipPosition.y + 'px',  
95 - left: tooltipPosition.x + 'px',  
96 - }"  
97 - > 33 + <span @mouseenter="(event) => handleItemMouseEnter(event, group.questionType)
  34 + " @mouseleave="handleItemMouseLeave" :class="isItemHovered == group.questionType ? 'hover' : ''"
  35 + class="size-16" @click="groupEditing(index)" v-show="!group.input">{{ group.questionTitle }}</span>
  36 +
  37 + <el-input :ref="'refInput' + index" class="size-16" size="mini" v-show="group.input"
  38 + v-model="group.questionTitle" @blur="groupSave(index)" @keyup.enter.native="groupSave(index)"
  39 + style="width: fit-content" />
  40 + <div v-if="isItemHovered == group.questionType" class="tooltip" :style="{
  41 + top: tooltipPosition.y + 'px',
  42 + left: tooltipPosition.x + 'px',
  43 + }">
98 单击设置试卷标题 44 单击设置试卷标题
99 </div> 45 </div>
100 46
101 - <span  
102 - v-if="group.subQuestionIds"  
103 - class="size-16"  
104 - style="margin-left: 10px"  
105 - >(共{{ group.subQuestionIds.length }}题 / 共{{ 47 + <span v-if="group.subQuestionIds" class="size-16" style="margin-left: 10px">(共{{
  48 + group.subQuestionIds.length }}题 / 共{{
106 group.questionScore * group.subQuestionIds.length 49 group.questionScore * group.subQuestionIds.length
107 - }}分)</span  
108 - > 50 + }}分)</span>
109 </div> 51 </div>
110 </div> 52 </div>
111 53
112 <!-- 内部的题目列表,允许组内排序 --> 54 <!-- 内部的题目列表,允许组内排序 -->
113 - <div  
114 - style="display: flex"  
115 - v-for="question in group.subQuestionIds"  
116 - :key="question.id"  
117 - :class="{  
118 - border: selectedItemIndex === question.id,  
119 - }"  
120 - @mouseenter="handleGroupMouseEnter(question.id, 'number')"  
121 - @mouseleave="handleGroupMouseLeave"  
122 - class="inner-item"  
123 - >  
124 - <div  
125 - v-if="selectedItemIndex === question.id"  
126 - class="border-del"  
127 - @click="handleDel(question.id, group.questionType)"  
128 - > 55 + <div style="display: flex" v-for="question in group.subQuestionIds" :key="question.id" :class="{
  56 + border: selectedItemIndex === question.id,
  57 + }" @mouseenter="handleGroupMouseEnter(question.id, 'number')" @mouseleave="handleGroupMouseLeave"
  58 + class="inner-item">
  59 + <div v-if="selectedItemIndex === question.id" class="border-del"
  60 + @click="handleDel(question.id, group.questionType)">
129 删除 61 删除
130 </div> 62 </div>
131 <div class="size color" style="margin-top: 20px"> 63 <div class="size color" style="margin-top: 20px">
132 - <div  
133 - style="max-width: 100px; white-space: nowrap; /* 不换行 */"  
134 - > 64 + <div style="max-width: 100px; white-space: nowrap; /* 不换行 */">
135 {{ question.globalIndex }}、 65 {{ question.globalIndex }}、
136 </div> 66 </div>
137 </div> 67 </div>
138 68
139 - <iframe  
140 - :src="question.screenshot"  
141 - :ref="'iframe' + question.id"  
142 - @load="onIFrameLoad(question.id)"  
143 - style=" 69 + <iframe :src="question.screenshot" :ref="'iframe' + question.id" @load="onIFrameLoad(question.id)" style="
144 width: 100%; 70 width: 100%;
145 pointer-events: none; 71 pointer-events: none;
146 border: none; /* 启用点击穿透 */ 72 border: none; /* 启用点击穿透 */
147 - "  
148 - ></iframe> 73 + "></iframe>
149 </div> 74 </div>
150 </div> 75 </div>
151 </div> 76 </div>
@@ -153,43 +78,23 @@ @@ -153,43 +78,23 @@
153 <div class="edit"> 78 <div class="edit">
154 <div class="edit-title"> 79 <div class="edit-title">
155 <div class="edit-title-info"> 80 <div class="edit-title-info">
156 - 共<span>{{ list.length }}</span  
157 - >小题,卷面分<span>{{ sumValues() }}</span  
158 - >分 81 + 共<span>{{ list.length }}</span>小题,卷面分<span>{{ sumValues() }}</span>分
159 </div> 82 </div>
160 <div class="edit-button"> 83 <div class="edit-button">
161 - <el-button class="button-width" type="primary" @click="handleSava"  
162 - >保存试卷</el-button  
163 - >  
164 - <el-button class="button-width" plain @click="handleSava('print')"  
165 - >保存并打印</el-button  
166 - >  
167 - <el-button  
168 - class="button-width"  
169 - type="danger"  
170 - plain  
171 - @click="handleClear"  
172 - >清空题目</el-button  
173 - >  
174 - <el-button class="button-width" plain @click="handleSelect"  
175 - >继续选题</el-button  
176 - > 84 + <el-button class="button-width" type="primary" @click="handleSava">保存试卷</el-button>
  85 + <el-button class="button-width" plain @click="handleSava('print')">保存并打印</el-button>
  86 + <el-button class="button-width" type="danger" plain @click="handleClear">清空题目</el-button>
  87 + <el-button class="button-width" plain @click="handleSelect">继续选题</el-button>
177 </div> 88 </div>
178 </div> 89 </div>
179 <div class="edit-info"> 90 <div class="edit-info">
180 <div class="title size color" style="padding: 15px 0 0 10px"> 91 <div class="title size color" style="padding: 15px 0 0 10px">
181 题目排序 92 题目排序
182 - <span class="title size" style="color: #999999"  
183 - >(拖拽题号可拖拽排序)</span  
184 - > 93 + <span class="title size" style="color: #999999">(拖拽题号可拖拽排序)</span>
185 </div> 94 </div>
186 <!-- 外层容器,允许拖拽整个组 --> 95 <!-- 外层容器,允许拖拽整个组 -->
187 <draggable v-model="groups" group="groups" @end="onEnd"> 96 <draggable v-model="groups" group="groups" @end="onEnd">
188 - <div  
189 - v-for="(group, index) in groups"  
190 - :key="group.id"  
191 - class="group-item"  
192 - > 97 + <div v-for="(group, index) in groups" :key="group.id" class="group-item">
193 <!-- 每个组的标题 --> 98 <!-- 每个组的标题 -->
194 <div class="group-title"> 99 <div class="group-title">
195 <div class="size" style="font-weight: 600"> 100 <div class="size" style="font-weight: 600">
@@ -197,28 +102,14 @@ @@ -197,28 +102,14 @@
197 </div> 102 </div>
198 <div class="size"> 103 <div class="size">
199 单题分值: 104 单题分值:
200 - <el-input-number  
201 - size="mini"  
202 - v-model="group.questionScore"  
203 - :min="1"  
204 - :max="30"  
205 - style="width: 100px"  
206 - ></el-input-number> 105 + <el-input-number size="mini" v-model="group.questionScore" :min="1" :max="30"
  106 + style="width: 100px"></el-input-number>
207 </div> 107 </div>
208 </div> 108 </div>
209 109
210 <!-- 内部的题目列表,允许组内排序 --> 110 <!-- 内部的题目列表,允许组内排序 -->
211 - <draggable  
212 - class="questions"  
213 - v-model="group.subQuestionIds"  
214 - group="questions"  
215 - @end="onItemEnd(group)"  
216 - >  
217 - <div  
218 - v-for="question in group.subQuestionIds"  
219 - :key="question.id"  
220 - class="question-item"  
221 - > 111 + <draggable class="questions" v-model="group.subQuestionIds" group="questions" @end="onItemEnd(group)">
  112 + <div v-for="question in group.subQuestionIds" :key="question.id" class="question-item">
222 {{ question.globalIndex }} 113 {{ question.globalIndex }}
223 </div> 114 </div>
224 </draggable> 115 </draggable>
@@ -234,6 +125,7 @@ @@ -234,6 +125,7 @@
234 <script> 125 <script>
235 import { number } from "echarts"; 126 import { number } from "echarts";
236 import draggable from "vuedraggable"; 127 import draggable from "vuedraggable";
  128 +import { paperPrint } from "@/utils";
237 export default { 129 export default {
238 components: { draggable }, 130 components: { draggable },
239 name: "wrongQuestionDialog", 131 name: "wrongQuestionDialog",
@@ -665,7 +557,11 @@ export default { @@ -665,7 +557,11 @@ export default {
665 this.$emit("setQuestions"); 557 this.$emit("setQuestions");
666 this.handleClose(); 558 this.handleClose();
667 if (type) { 559 if (type) {
668 - console.log(123); 560 + this.$request.tPaperDetail({
  561 + paperId: res.data
  562 + }).then(detail => {
  563 + paperPrint(detail.data);
  564 + });
669 } 565 }
670 } 566 }
671 }); 567 });
@@ -708,9 +604,11 @@ export default { @@ -708,9 +604,11 @@ export default {
708 .title { 604 .title {
709 font-weight: 600; 605 font-weight: 600;
710 } 606 }
  607 +
711 .test-box { 608 .test-box {
712 display: flex; 609 display: flex;
713 min-height: 742px; 610 min-height: 742px;
  611 +
714 .test { 612 .test {
715 flex: 1; 613 flex: 1;
716 height: fit-content; 614 height: fit-content;
@@ -720,6 +618,7 @@ export default { @@ -720,6 +618,7 @@ export default {
720 margin-right: 20px; 618 margin-right: 20px;
721 box-sizing: border-box; 619 box-sizing: border-box;
722 padding: 0 20px; 620 padding: 0 20px;
  621 +
723 .test-title { 622 .test-title {
724 font-size: 20px !important; 623 font-size: 20px !important;
725 font-weight: 700; 624 font-weight: 700;
@@ -737,6 +636,7 @@ export default { @@ -737,6 +636,7 @@ export default {
737 justify-content: space-around; 636 justify-content: space-around;
738 align-items: center; 637 align-items: center;
739 } 638 }
  639 +
740 .test-group { 640 .test-group {
741 .test-group-title { 641 .test-group-title {
742 position: relative; 642 position: relative;
@@ -746,14 +646,17 @@ export default { @@ -746,14 +646,17 @@ export default {
746 } 646 }
747 } 647 }
748 } 648 }
  649 +
749 .edit { 650 .edit {
750 width: 400px; 651 width: 400px;
751 display: flex; 652 display: flex;
752 flex-direction: column; 653 flex-direction: column;
  654 +
753 .edit-title { 655 .edit-title {
754 width: 100%; 656 width: 100%;
755 height: 200px; 657 height: 200px;
756 border: 1px solid #999999; 658 border: 1px solid #999999;
  659 +
757 .edit-title-info { 660 .edit-title-info {
758 height: 60px; 661 height: 60px;
759 width: 100%; 662 width: 100%;
@@ -762,22 +665,26 @@ export default { @@ -762,22 +665,26 @@ export default {
762 font-size: 16px !important; 665 font-size: 16px !important;
763 line-height: 60px; 666 line-height: 60px;
764 color: #000000; 667 color: #000000;
  668 +
765 span { 669 span {
766 color: rgb(234, 163, 73); 670 color: rgb(234, 163, 73);
767 } 671 }
768 } 672 }
  673 +
769 .edit-button { 674 .edit-button {
770 box-sizing: border-box; 675 box-sizing: border-box;
771 padding: 0 20px; 676 padding: 0 20px;
772 display: flex; 677 display: flex;
773 flex-wrap: wrap; 678 flex-wrap: wrap;
774 justify-content: space-around; 679 justify-content: space-around;
  680 +
775 .button-width { 681 .button-width {
776 width: 160px !important; 682 width: 160px !important;
777 margin: 10px 0; 683 margin: 10px 0;
778 } 684 }
779 } 685 }
780 } 686 }
  687 +
781 .edit-info { 688 .edit-info {
782 flex: 1; 689 flex: 1;
783 border: 1px solid #999999; 690 border: 1px solid #999999;
@@ -785,10 +692,12 @@ export default { @@ -785,10 +692,12 @@ export default {
785 max-height: 500px; 692 max-height: 500px;
786 padding: 10px; 693 padding: 10px;
787 overflow: auto; 694 overflow: auto;
  695 +
788 .group-item { 696 .group-item {
789 margin: 10px; 697 margin: 10px;
790 background: rgba(243, 243, 243, 0.6); 698 background: rgba(243, 243, 243, 0.6);
791 border-radius: 5px; 699 border-radius: 5px;
  700 +
792 .group-title { 701 .group-title {
793 display: flex; 702 display: flex;
794 align-items: center; 703 align-items: center;
@@ -797,9 +706,11 @@ export default { @@ -797,9 +706,11 @@ export default {
797 cursor: pointer; 706 cursor: pointer;
798 } 707 }
799 } 708 }
  709 +
800 .questions { 710 .questions {
801 display: flex; 711 display: flex;
802 flex-wrap: wrap; 712 flex-wrap: wrap;
  713 +
803 .question-item { 714 .question-item {
804 width: 35px; 715 width: 35px;
805 height: 35px; 716 height: 35px;
@@ -819,25 +730,31 @@ export default { @@ -819,25 +730,31 @@ export default {
819 } 730 }
820 } 731 }
821 } 732 }
  733 +
822 .size { 734 .size {
823 font-size: 14px !important; 735 font-size: 14px !important;
824 } 736 }
  737 +
825 .color { 738 .color {
826 color: #000000; 739 color: #000000;
827 } 740 }
  741 +
828 .size-16 { 742 .size-16 {
829 font-size: 16px !important; 743 font-size: 16px !important;
830 font-weight: 600; 744 font-weight: 600;
831 color: #333333; 745 color: #333333;
832 } 746 }
  747 +
833 ::v-deep { 748 ::v-deep {
834 .el-dialog { 749 .el-dialog {
835 margin-top: 10vh !important; 750 margin-top: 10vh !important;
836 } 751 }
837 } 752 }
  753 +
838 .border { 754 .border {
839 border: 1px solid rgb(173, 190, 250); 755 border: 1px solid rgb(173, 190, 250);
840 position: relative; 756 position: relative;
  757 +
841 .border-del { 758 .border-del {
842 position: absolute; 759 position: absolute;
843 top: -30px; 760 top: -30px;
@@ -853,11 +770,13 @@ export default { @@ -853,11 +770,13 @@ export default {
853 cursor: pointer; 770 cursor: pointer;
854 } 771 }
855 } 772 }
  773 +
856 .outer-item, 774 .outer-item,
857 .inner-item { 775 .inner-item {
858 height: fit-content; 776 height: fit-content;
859 margin-bottom: 20px; 777 margin-bottom: 20px;
860 } 778 }
  779 +
861 .tooltip { 780 .tooltip {
862 position: absolute; 781 position: absolute;
863 background: rgba(0, 0, 0, 0.7); 782 background: rgba(0, 0, 0, 0.7);
@@ -866,11 +785,13 @@ export default { @@ -866,11 +785,13 @@ export default {
866 border-radius: 5px; 785 border-radius: 5px;
867 font-size: 12px !important; 786 font-size: 12px !important;
868 } 787 }
  788 +
869 .hover { 789 .hover {
870 border: 1px solid rgb(115, 142, 246); 790 border: 1px solid rgb(115, 142, 246);
871 background: rgb(233, 237, 253); 791 background: rgb(233, 237, 253);
872 width: fit-content; 792 width: fit-content;
873 } 793 }
  794 +
874 .title-bg { 795 .title-bg {
875 background: rgb(115, 142, 246); 796 background: rgb(115, 142, 246);
876 border-bottom: 1px solid rgb(115, 142, 246); 797 border-bottom: 1px solid rgb(115, 142, 246);
src/views/basic/askTestQuestion/update.vue
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <back-box class="detailBack"> 4 <back-box class="detailBack">
5 <template slot="title"> 5 <template slot="title">
6 <span class="default-title"> 6 <span class="default-title">
7 - {{ isViewer ? "详情" : type == 1 ? paperType == 1 ? "修改课件" : "修改试卷" : "修改答案" }}</span> 7 + {{ isViewer && !isWrong ? "详情" : type == 1 ? paperType == 1 ? "修改课件" : "修改试卷" : "修改答案" }}</span>
8 </template> 8 </template>
9 </back-box> 9 </back-box>
10 </el-header> 10 </el-header>
@@ -21,12 +21,13 @@ @@ -21,12 +21,13 @@
21 <div class="answer-title" :class="type == 1 ? 't-left' : ''"> 21 <div class="answer-title" :class="type == 1 ? 't-left' : ''">
22 <p class="name-box"> 22 <p class="name-box">
23 <span>试卷名称:</span> 23 <span>试卷名称:</span>
24 - <el-input :disabled="isViewer" class="ipt-name" v-model="form.title"></el-input> 24 + <el-input :disabled="isViewer && !isWrong" class="ipt-name" v-model="form.title"></el-input>
25 </p> 25 </p>
26 <p class="name-box"> 26 <p class="name-box">
27 <span>分享范围:</span> 27 <span>分享范围:</span>
28 - <el-radio :disabled="isViewer" class="name-radio" v-model="form.sharingType" :label="0">任课班级分享</el-radio>  
29 - <el-radio :disabled="isViewer" class="name-radio" @click.native="_selectClassSharingType" 28 + <el-radio :disabled="isViewer && !isWrong" class="name-radio" v-model="form.sharingType"
  29 + :label="0">任课班级分享</el-radio>
  30 + <el-radio :disabled="isViewer && !isWrong" class="name-radio" @click.native="_selectClassSharingType"
30 v-model="form.sharingType" :label="1">自定义分享班级</el-radio> 31 v-model="form.sharingType" :label="1">自定义分享班级</el-radio>
31 </p> 32 </p>
32 </div> 33 </div>
@@ -47,7 +48,7 @@ @@ -47,7 +48,7 @@
47 <div class="bigQuestionTitle" v-if="paperType != 1"> 48 <div class="bigQuestionTitle" v-if="paperType != 1">
48 {{ question.questionTitle }} 49 {{ question.questionTitle }}
49 (共{{ question.subQuestions.filter(subQuestion => subQuestion && 50 (共{{ question.subQuestions.filter(subQuestion => subQuestion &&
50 - subQuestion.questionIndex && subQuestion.questionType).length }}小题, 51 + subQuestion.questionIndex && subQuestion.questionType).length }}小题,
51 共{{ question.score }}分) 52 共{{ question.score }}分)
52 </div> 53 </div>
53 <div v-if="paperType == 2 && index == 0" class="courseware-title sub-questions"> 54 <div v-if="paperType == 2 && index == 0" class="courseware-title sub-questions">
@@ -61,7 +62,7 @@ @@ -61,7 +62,7 @@
61 </div> 62 </div>
62 63
63 <div class="courseware-content sub-questions" v-if="subQuestion && 64 <div class="courseware-content sub-questions" v-if="subQuestion &&
64 - subQuestion.questionIndex && subQuestion.questionType && question.subQuestions" 65 + subQuestion.questionIndex && subQuestion.questionType && question.subQuestions"
65 v-for="(subQuestion, subIndex) in question.subQuestions"> 66 v-for="(subQuestion, subIndex) in question.subQuestions">
66 <div class="qs-num">{{ subQuestion.questionIndex }}</div> 67 <div class="qs-num">{{ subQuestion.questionIndex }}</div>
67 <div class="qs-stem"> 68 <div class="qs-stem">
@@ -74,8 +75,8 @@ @@ -74,8 +75,8 @@
74 </el-select> 75 </el-select>
75 </div> 76 </div>
76 <div class="qs-score"> 77 <div class="qs-score">
77 - <el-input-number :disabled="isViewer" class="number-ipt" size="medium" :min="1" :max="200"  
78 - :precision="2" :step="1" v-model="subQuestion.score" label="单题分值" /> 78 + <el-input-number :disabled="isViewer && !isWrong" class="number-ipt" size="medium" :min="1"
  79 + :max="200" :precision="2" :step="1" v-model="subQuestion.score" label="单题分值" />
79 </div> 80 </div>
80 <div class="qs-partScore"> 81 <div class="qs-partScore">
81 <p v-if="subQuestion.questionType != 3">------</p> 82 <p v-if="subQuestion.questionType != 3">------</p>
@@ -103,7 +104,7 @@ @@ -103,7 +104,7 @@
103 @click="changAnswer(subQuestion, option)">{{ option }}</span> 104 @click="changAnswer(subQuestion, option)">{{ option }}</span>
104 <span v-if="option && isViewer" class="answer-s" 105 <span v-if="option && isViewer" class="answer-s"
105 :class="subQuestion.correctAnswer.includes(option) ? 'answer-active' : ''" :key="option">{{ 106 :class="subQuestion.correctAnswer.includes(option) ? 'answer-active' : ''" :key="option">{{
106 - option }}</span> 107 + option }}</span>
107 </template> 108 </template>
108 <span class="answer-s answer-opration" v-if="!isViewer" 109 <span class="answer-s answer-opration" v-if="!isViewer"
109 @click="openStem(subQuestion, 4, index, subIndex)">+</span> 110 @click="openStem(subQuestion, 4, index, subIndex)">+</span>
@@ -117,7 +118,7 @@ @@ -117,7 +118,7 @@
117 @click="subQuestion.correctAnswer = option">{{ option }}</span> 118 @click="subQuestion.correctAnswer = option">{{ option }}</span>
118 <span v-if="option && isViewer" class="answer-s" 119 <span v-if="option && isViewer" class="answer-s"
119 :class="subQuestion.correctAnswer.includes(option) ? 'answer-active' : ''" :key="option">{{ 120 :class="subQuestion.correctAnswer.includes(option) ? 'answer-active' : ''" :key="option">{{
120 - option }}</span> 121 + option }}</span>
121 </template> 122 </template>
122 <span class="answer-s answer-opration" v-if="!isViewer" 123 <span class="answer-s answer-opration" v-if="!isViewer"
123 @click="openStem(subQuestion, 4, index, subIndex)">+</span> 124 @click="openStem(subQuestion, 4, index, subIndex)">+</span>
@@ -156,8 +157,8 @@ @@ -156,8 +157,8 @@
156 </el-select> 157 </el-select>
157 </div> 158 </div>
158 <div class="qs-score"> 159 <div class="qs-score">
159 - <el-input-number :disabled="isViewer" class="number-ipt" size="medium" :min="1" :max="200"  
160 - :precision="2" :step="1" v-model="question.score" label="单题分值" /> 160 + <el-input-number :disabled="isViewer && !isWrong" class="number-ipt" size="medium" :min="1"
  161 + :max="200" :precision="2" :step="1" v-model="question.score" label="单题分值" />
161 </div> 162 </div>
162 <div class="qs-partScore"> 163 <div class="qs-partScore">
163 <p v-if="question.questionType != 3">------</p> 164 <p v-if="question.questionType != 3">------</p>
@@ -168,16 +169,16 @@ @@ -168,16 +169,16 @@
168 <p v-if="question.questionType == 5">--</p> 169 <p v-if="question.questionType == 5">--</p>
169 <p v-if="question.questionType == 4" class="answer-box"> 170 <p v-if="question.questionType == 4" class="answer-box">
170 <span class="answer-s" :class="question.correctAnswer == 1 ? 'answer-active' : '' 171 <span class="answer-s" :class="question.correctAnswer == 1 ? 'answer-active' : ''
171 - " @click="question.correctAnswer = 1">✓</span> 172 + " @click="question.correctAnswer = 1">✓</span>
172 <span class="answer-s" :class="question.correctAnswer == 2 ? 'answer-active' : '' 173 <span class="answer-s" :class="question.correctAnswer == 2 ? 'answer-active' : ''
173 - " @click="question.correctAnswer = 2">✗</span> 174 + " @click="question.correctAnswer = 2">✗</span>
174 </p> 175 </p>
175 <p v-if="question.questionType == 3" class="answer-box"> 176 <p v-if="question.questionType == 3" class="answer-box">
176 <template v-for="option in question.answerOptions.split(',')"> 177 <template v-for="option in question.answerOptions.split(',')">
177 <span v-if="option" class="answer-s" :class="question.correctAnswer.includes(option) 178 <span v-if="option" class="answer-s" :class="question.correctAnswer.includes(option)
178 - ? 'answer-active'  
179 - : ''  
180 - " :key="option" @click="changAnswer(question, option)">{{ option }}</span> 179 + ? 'answer-active'
  180 + : ''
  181 + " :key="option" @click="changAnswer(question, option)">{{ option }}</span>
181 </template> 182 </template>
182 <span class="answer-s answer-opration" v-if="!isViewer" 183 <span class="answer-s answer-opration" v-if="!isViewer"
183 @click="openStem(question, 4, index, 0)">+</span> 184 @click="openStem(question, 4, index, 0)">+</span>
@@ -187,9 +188,9 @@ @@ -187,9 +188,9 @@
187 <p v-if="question.questionType == 2" class="answer-box"> 188 <p v-if="question.questionType == 2" class="answer-box">
188 <template v-for="option in question.answerOptions.split(',')"> 189 <template v-for="option in question.answerOptions.split(',')">
189 <span class="answer-s" v-if="option" :class="question.correctAnswer == option 190 <span class="answer-s" v-if="option" :class="question.correctAnswer == option
190 - ? 'answer-active'  
191 - : ''  
192 - " :key="option" @click="question.correctAnswer = option">{{ option }}</span> 191 + ? 'answer-active'
  192 + : ''
  193 + " :key="option" @click="question.correctAnswer = option">{{ option }}</span>
193 </template> 194 </template>
194 <span class="answer-s answer-opration" v-if="!isViewer" 195 <span class="answer-s answer-opration" v-if="!isViewer"
195 @click="openStem(question, 4, index, 0)">+</span> 196 @click="openStem(question, 4, index, 0)">+</span>
@@ -225,7 +226,7 @@ @@ -225,7 +226,7 @@
225 :append-to-body="true"> 226 :append-to-body="true">
226 <div :key="classSharingType"> 227 <div :key="classSharingType">
227 <div class="row-subfix"> 228 <div class="row-subfix">
228 - <div > 229 + <div>
229 <span class="line-subfix">年级:</span> 230 <span class="line-subfix">年级:</span>
230 <span class="line-value">{{ gradeName }}</span> 231 <span class="line-value">{{ gradeName }}</span>
231 </div> 232 </div>
@@ -233,9 +234,10 @@ @@ -233,9 +234,10 @@
233 <div v-if="gradeClass.length >= 1" class="row-subfix" 234 <div v-if="gradeClass.length >= 1" class="row-subfix"
234 style="margin-top: 20px;margin-bottom: 20px;overflow: auto"> 235 style="margin-top: 20px;margin-bottom: 20px;overflow: auto">
235 <span class="line-subfix" style="float: left;">班级:</span> 236 <span class="line-subfix" style="float: left;">班级:</span>
236 - <div style="float: left;background:rgb(245,247,250);padding:15px 10px;width: calc(100% - 80px);border-radius:5px;"> 237 + <div
  238 + style="float: left;background:rgb(245,247,250);padding:15px 10px;width: calc(100% - 80px);border-radius:5px;">
237 <span class="line-value" style="min-height: 300px;border-radius: 4px; background: rgb(247,247,250);"> 239 <span class="line-value" style="min-height: 300px;border-radius: 4px; background: rgb(247,247,250);">
238 - <el-checkbox v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox> 240 + <el-checkbox v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
239 <div> 241 <div>
240 <el-checkbox @change="handleCheckedClassChange" v-model="item.isChecked" :key="index" 242 <el-checkbox @change="handleCheckedClassChange" v-model="item.isChecked" :key="index"
241 v-for="(item, index) in gradeClass" :label="item.id"> 243 v-for="(item, index) in gradeClass" :label="item.id">
@@ -267,15 +269,15 @@ @@ -267,15 +269,15 @@
267 <p class="answer-box"> 269 <p class="answer-box">
268 <template v-if="formAns.qusType == 4"> 270 <template v-if="formAns.qusType == 4">
269 <span class="answer-s answer-active" @click=" 271 <span class="answer-s answer-active" @click="
270 - formAns.answerList.length < formAns.subNum  
271 - ? (formAns.answerList += '✓')  
272 - : ''  
273 - ">✓</span> 272 + formAns.answerList.length < formAns.subNum
  273 + ? (formAns.answerList += '✓')
  274 + : ''
  275 + ">✓</span>
274 <span class="answer-s answer-active" @click=" 276 <span class="answer-s answer-active" @click="
275 - formAns.answerList.length < formAns.subNum  
276 - ? (formAns.answerList += '✗')  
277 - : ''  
278 - ">✗</span> 277 + formAns.answerList.length < formAns.subNum
  278 + ? (formAns.answerList += '✗')
  279 + : ''
  280 + ">✗</span>
279 </template> 281 </template>
280 <template v-if="formAns.qusType == 3"> 282 <template v-if="formAns.qusType == 3">
281 <span class="answer-s answer-active" v-for="option in formAns.answerOptions.split(',')" :key="option" 283 <span class="answer-s answer-active" v-for="option in formAns.answerOptions.split(',')" :key="option"
@@ -285,10 +287,10 @@ @@ -285,10 +287,10 @@
285 <template v-if="formAns.qusType == 2"> 287 <template v-if="formAns.qusType == 2">
286 <span class="answer-s answer-active" v-for="option in formAns.answerOptions.split(',')" :key="option" 288 <span class="answer-s answer-active" v-for="option in formAns.answerOptions.split(',')" :key="option"
287 @click=" 289 @click="
288 - formAns.answerList.length < formAns.subNum  
289 - ? (formAns.answerList += option)  
290 - : ''  
291 - ">{{ option }}</span> 290 + formAns.answerList.length < formAns.subNum
  291 + ? (formAns.answerList += option)
  292 + : ''
  293 + ">{{ option }}</span>
292 </template> 294 </template>
293 <span class="answer-s delButton" @click="formAns.answerList = formAns.answerList.slice(0, -1)">x</span> 295 <span class="answer-s delButton" @click="formAns.answerList = formAns.answerList.slice(0, -1)">x</span>
294 <span class="answer-s ac" @click="formAns.answerList = ''">ac</span> 296 <span class="answer-s ac" @click="formAns.answerList = ''">ac</span>
@@ -350,6 +352,7 @@ export default { @@ -350,6 +352,7 @@ export default {
350 gradeClass: [], 352 gradeClass: [],
351 subjectName: "", 353 subjectName: "",
352 isViewer: false, 354 isViewer: false,
  355 + isWrong: false,
353 isIndeterminate: true, 356 isIndeterminate: true,
354 type: 1, //1:答题卡 2:即时测报表题目列表 3:课时题目列表 357 type: 1, //1:答题卡 2:即时测报表题目列表 3:课时题目列表
355 questionList: [], 358 questionList: [],
@@ -501,7 +504,7 @@ export default { @@ -501,7 +504,7 @@ export default {
501 }, 504 },
502 async _selectClassSharingType() { 505 async _selectClassSharingType() {
503 506
504 - if (this.isViewer) return; 507 + if (this.isViewer && !this.isWrong) return;
505 508
506 this.gradeClass = []; 509 this.gradeClass = [];
507 510
@@ -522,7 +525,7 @@ export default { @@ -522,7 +525,7 @@ export default {
522 } 525 }
523 })]; 526 })];
524 527
525 - this.checkAll = this.checkedClass.length === this.gradeClass.length; 528 + this.checkAll = this.checkedClass.length === this.gradeClass.length;
526 }, 529 },
527 // v1.5 530 // v1.5
528 //上传截图 531 //上传截图
@@ -996,8 +999,11 @@ export default { @@ -996,8 +999,11 @@ export default {
996 return a.questionIndex - b.questionIndex; 999 return a.questionIndex - b.questionIndex;
997 }); 1000 });
998 } 1001 }
  1002 + if (data.tag == "错题复习" && this.isViewer == false) {
  1003 + this.isViewer = true;
  1004 + this.isWrong = true;
  1005 + }
999 this.questionList = questionList; 1006 this.questionList = questionList;
1000 - console.log(this.questionList)  
1001 this.formateQuestion(); 1007 this.formateQuestion();
1002 this.checkedClass = data.classList?.map(item => item.classId); 1008 this.checkedClass = data.classList?.map(item => item.classId);
1003 } else { 1009 } else {
src/views/examinationPaper/add.vue
@@ -11,17 +11,18 @@ @@ -11,17 +11,18 @@
11 :modal-append-to-body="false" :append-to-body="true"> 11 :modal-append-to-body="false" :append-to-body="true">
12 <div :key="classSharingType"> 12 <div :key="classSharingType">
13 <div class="row-subfix"> 13 <div class="row-subfix">
14 - <div > 14 + <div>
15 <span class="line-subfix">年级:</span> 15 <span class="line-subfix">年级:</span>
16 <span class="line-value">{{ gradeName }}</span> 16 <span class="line-value">{{ gradeName }}</span>
17 </div> 17 </div>
18 </div> 18 </div>
19 - <div v-if="shareClass.length >= 1" class="row-subfix" style="margin-top: 20px;margin-bottom: 20px;overflow: auto"> 19 + <div v-if="shareClass.length >= 1" class="row-subfix"
  20 + style="margin-top: 20px;margin-bottom: 20px;overflow: auto">
20 <span class="line-subfix" style="float: left;">班级:</span> 21 <span class="line-subfix" style="float: left;">班级:</span>
21 - <div style="float: left; 22 + <div style="float: left;
22 background:rgb(245,247,250);padding:15px 10px;width: calc(100% - 80px);border-radius:5px;"> 23 background:rgb(245,247,250);padding:15px 10px;width: calc(100% - 80px);border-radius:5px;">
23 <span class="line-value" style="min-height: 300px;border-radius: 4px; background: rgb(247,247,250);"> 24 <span class="line-value" style="min-height: 300px;border-radius: 4px; background: rgb(247,247,250);">
24 - <el-checkbox v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox> 25 + <el-checkbox v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
25 <div> 26 <div>
26 <el-checkbox @change="handleCheckedClassChange" v-model="item.isChecked" :key="index" 27 <el-checkbox @change="handleCheckedClassChange" v-model="item.isChecked" :key="index"
27 v-for="(item, index) in shareClass" :label="item.id"> 28 v-for="(item, index) in shareClass" :label="item.id">
@@ -54,7 +55,7 @@ @@ -54,7 +55,7 @@
54 <el-select v-model="form.tagId" placeholder="选择测验类型"> 55 <el-select v-model="form.tagId" placeholder="选择测验类型">
55 <el-option label="--" value=""> </el-option> 56 <el-option label="--" value=""> </el-option>
56 <el-option v-for="item in answerTypeList" :key="item.id" :label="item.typeName" :value="item.id">{{ 57 <el-option v-for="item in answerTypeList" :key="item.id" :label="item.typeName" :value="item.id">{{
57 - item.typeName }}</el-option> 58 + item.typeName }}</el-option>
58 </el-select> 59 </el-select>
59 <el-button class="ml-20" type="primary" round circle icon="el-icon-edit" @click="openTagDia"></el-button> 60 <el-button class="ml-20" type="primary" round circle icon="el-icon-edit" @click="openTagDia"></el-button>
60 </el-form-item> 61 </el-form-item>
@@ -67,8 +68,8 @@ @@ -67,8 +68,8 @@
67 <el-form-item label="科目:" prop="subjectName"> 68 <el-form-item label="科目:" prop="subjectName">
68 <el-select class="sel" v-model="form.subjectName" placeholder=""> 69 <el-select class="sel" v-model="form.subjectName" placeholder="">
69 <el-option v-for="item in subjectList" :key="item.value" :label="item.label" :value="item.value">{{ 70 <el-option v-for="item in subjectList" :key="item.value" :label="item.label" :value="item.value">{{
70 - item.label  
71 - }} 71 + item.label
  72 + }}
72 </el-option> 73 </el-option>
73 </el-select> 74 </el-select>
74 </el-form-item> 75 </el-form-item>
@@ -91,17 +92,17 @@ @@ -91,17 +92,17 @@
91 <div class="dia-content"> 92 <div class="dia-content">
92 <p class="add-type" v-for="item in tagList" :key="item.id"> 93 <p class="add-type" v-for="item in tagList" :key="item.id">
93 <el-row :gutter="10"> 94 <el-row :gutter="10">
94 - <el-col :span="18"><el-input v-model="item.typeName" :maxlength="10" 95 + <el-col :span="18"><el-input :disabled="item.typeName == '错题复习'" v-model="item.typeName" :maxlength="10"
95 placeholder="请输入答题卡类型名称"></el-input></el-col> 96 placeholder="请输入答题卡类型名称"></el-input></el-col>
96 <el-col :span="6"> 97 <el-col :span="6">
97 <el-tooltip effect="dark" content="保存" placement="top"> 98 <el-tooltip effect="dark" content="保存" placement="top">
98 - <el-button class="js-set" type="primary" size="small" round circle icon="el-icon-check"  
99 - @click="editTypeName(item)"></el-button> 99 + <el-button v-if="item.typeName != '错题复习'" class="js-set" type="primary" size="small" round circle
  100 + icon="el-icon-check" @click="editTypeName(item)"></el-button>
100 </el-tooltip> 101 </el-tooltip>
101 <el-tooltip effect="dark" content="删除" placement="right"> 102 <el-tooltip effect="dark" content="删除" placement="right">
102 <el-popconfirm title="确定删除这道大题吗?" @confirm="removeTypeName(item)"> 103 <el-popconfirm title="确定删除这道大题吗?" @confirm="removeTypeName(item)">
103 - <el-button class="js-set" type="danger" size="small" round circle icon="el-icon-delete"  
104 - slot="reference"></el-button> 104 + <el-button v-if="item.typeName != '错题复习'" class="js-set" type="danger" size="small" round circle
  105 + icon="el-icon-delete" slot="reference"></el-button>
105 </el-popconfirm> 106 </el-popconfirm>
106 </el-tooltip> 107 </el-tooltip>
107 </el-col> 108 </el-col>
@@ -181,27 +182,27 @@ @@ -181,27 +182,27 @@
181 <p v-if="subQuestions.questionType == 5">--</p> 182 <p v-if="subQuestions.questionType == 5">--</p>
182 <p v-if="subQuestions.questionType == 4" class="answer-box"> 183 <p v-if="subQuestions.questionType == 4" class="answer-box">
183 <span class="answer-s" :class="subQuestions.correctAnswer == 1 ? 'active' : '' 184 <span class="answer-s" :class="subQuestions.correctAnswer == 1 ? 'active' : ''
184 - " @click="subQuestions.correctAnswer = 1">✓</span> 185 + " @click="subQuestions.correctAnswer = 1">✓</span>
185 <span class="answer-s" :class="subQuestions.correctAnswer == 2 ? 'active' : '' 186 <span class="answer-s" :class="subQuestions.correctAnswer == 2 ? 'active' : ''
186 - " @click="subQuestions.correctAnswer = 2">✗</span> 187 + " @click="subQuestions.correctAnswer = 2">✗</span>
187 </p> 188 </p>
188 <p v-if="subQuestions.questionType == 3" class="answer-box"> 189 <p v-if="subQuestions.questionType == 3" class="answer-box">
189 <span class="answer-s" v-for="option in subQuestions.answerOptions.split( 190 <span class="answer-s" v-for="option in subQuestions.answerOptions.split(
190 - ','  
191 - )" :class="subQuestions.correctAnswer ? subQuestions.correctAnswer.includes(option)  
192 - ? 'active'  
193 - : '' : ''  
194 - " :key="option" @click="changAnswer(subQuestions, option)">{{ option }}</span> 191 + ','
  192 + )" :class="subQuestions.correctAnswer ? subQuestions.correctAnswer.includes(option)
  193 + ? 'active'
  194 + : '' : ''
  195 + " :key="option" @click="changAnswer(subQuestions, option)">{{ option }}</span>
195 </p> 196 </p>
196 <p v-if="subQuestions.questionType == 2" class="answer-box"> 197 <p v-if="subQuestions.questionType == 2" class="answer-box">
197 <span class="answer-s" v-for="option in subQuestions.answerOptions.split( 198 <span class="answer-s" v-for="option in subQuestions.answerOptions.split(
198 - ','  
199 - )" :class="subQuestions.correctAnswer == option ? 'active' : ''  
200 - " :key="option" @click="subQuestions.correctAnswer = option">{{ option }}</span> 199 + ','
  200 + )" :class="subQuestions.correctAnswer == option ? 'active' : ''
  201 + " :key="option" @click="subQuestions.correctAnswer = option">{{ option }}</span>
201 </p> 202 </p>
202 <p v-if="subQuestions.questionType == 3 || 203 <p v-if="subQuestions.questionType == 3 ||
203 - subQuestions.questionType == 2  
204 - " class="answer-box answer-box2"> 204 + subQuestions.questionType == 2
  205 + " class="answer-box answer-box2">
205 <el-button size="mini" type="primary" icon="el-icon-plus" circle 206 <el-button size="mini" type="primary" icon="el-icon-plus" circle
206 @click="addOptions(subQuestions)"></el-button> 207 @click="addOptions(subQuestions)"></el-button>
207 <el-button size="mini" type="primary" icon="el-icon-minus" round circle 208 <el-button size="mini" type="primary" icon="el-icon-minus" round circle
@@ -269,8 +270,8 @@ @@ -269,8 +270,8 @@
269 :step-strictly="true" :step="1" label="label"></el-input-number> 270 :step-strictly="true" :step="1" label="label"></el-input-number>
270 </el-form-item> 271 </el-form-item>
271 <el-form-item label="选项个数:" v-show="questionForm.questionType != 4 && 272 <el-form-item label="选项个数:" v-show="questionForm.questionType != 4 &&
272 - questionForm.questionType != 5  
273 - "> 273 + questionForm.questionType != 5
  274 + ">
274 <el-input-number v-model="questionForm.selectNum" :min="3" :max="10" :step-strictly="true" :step="1" 275 <el-input-number v-model="questionForm.selectNum" :min="3" :max="10" :step-strictly="true" :step="1"
275 label="label"></el-input-number> 276 label="label"></el-input-number>
276 </el-form-item> 277 </el-form-item>
@@ -283,33 +284,33 @@ @@ -283,33 +284,33 @@
283 :step="0.5" label="label"></el-input-number> 284 :step="0.5" label="label"></el-input-number>
284 </el-form-item> 285 </el-form-item>
285 <el-form-item label="设置答案:" v-show="questionForm.questionType != 5 && 286 <el-form-item label="设置答案:" v-show="questionForm.questionType != 5 &&
286 - questionForm.questionType != 6  
287 - "> 287 + questionForm.questionType != 6
  288 + ">
288 <div class="qs-options"> 289 <div class="qs-options">
289 <p class="ipt"> 290 <p class="ipt">
290 <el-input v-if="questionForm.questionType == 2 || 291 <el-input v-if="questionForm.questionType == 2 ||
291 - questionForm.questionType == 3 ||  
292 - questionForm.questionType == 6  
293 - " ref="formAnsIpt2" v-model="questionForm.answerList" @keydown.native="  
294 - keydownAnswer($event, questionForm.questionType, 1)  
295 - " @input="  
296 - setAllAnswer($event, questionForm.questionType, 1)  
297 - "></el-input> 292 + questionForm.questionType == 3 ||
  293 + questionForm.questionType == 6
  294 + " ref="formAnsIpt2" v-model="questionForm.answerList" @keydown.native="
  295 + keydownAnswer($event, questionForm.questionType, 1)
  296 + " @input="
  297 + setAllAnswer($event, questionForm.questionType, 1)
  298 + "></el-input>
298 <el-input v-if="questionForm.questionType == 4" v-model="questionForm.answerList" 299 <el-input v-if="questionForm.questionType == 4" v-model="questionForm.answerList"
299 readonly=""></el-input> 300 readonly=""></el-input>
300 </p> 301 </p>
301 <p class="answer-box"> 302 <p class="answer-box">
302 <template v-if="questionForm.questionType == 4"> 303 <template v-if="questionForm.questionType == 4">
303 <span class="answer-s active" @click=" 304 <span class="answer-s active" @click="
304 - questionForm.answerList.length < questionForm.number  
305 - ? (questionForm.answerList += '✓')  
306 - : ''  
307 - ">✓</span> 305 + questionForm.answerList.length < questionForm.number
  306 + ? (questionForm.answerList += '✓')
  307 + : ''
  308 + ">✓</span>
308 <span class="answer-s active" @click=" 309 <span class="answer-s active" @click="
309 - questionForm.answerList.length < questionForm.number  
310 - ? (questionForm.answerList += '✗')  
311 - : ''  
312 - ">✗</span> 310 + questionForm.answerList.length < questionForm.number
  311 + ? (questionForm.answerList += '✗')
  312 + : ''
  313 + ">✗</span>
313 </template> 314 </template>
314 <template v-if="questionForm.questionType == 3"> 315 <template v-if="questionForm.questionType == 3">
315 <template v-for="(option, opIdx) in rightOptions"> 316 <template v-for="(option, opIdx) in rightOptions">
@@ -319,21 +320,21 @@ @@ -319,21 +320,21 @@
319 <span class="answer-s active" @click="setMultiple(questionForm, ',', 1)">,</span> 320 <span class="answer-s active" @click="setMultiple(questionForm, ',', 1)">,</span>
320 </template> 321 </template>
321 <template v-if="questionForm.questionType == 2 || 322 <template v-if="questionForm.questionType == 2 ||
322 - questionForm.questionType == 6  
323 - "> 323 + questionForm.questionType == 6
  324 + ">
324 <template v-for="(option, opIdx) in rightOptions"> 325 <template v-for="(option, opIdx) in rightOptions">
325 <span v-if="opIdx < questionForm.selectNum" class="answer-s active" :key="option" @click=" 326 <span v-if="opIdx < questionForm.selectNum" class="answer-s active" :key="option" @click="
326 - questionForm.answerList.length <  
327 - questionForm.number  
328 - ? (questionForm.answerList += option)  
329 - : ''  
330 - ">{{ option }}</span> 327 + questionForm.answerList.length <
  328 + questionForm.number
  329 + ? (questionForm.answerList += option)
  330 + : ''
  331 + ">{{ option }}</span>
331 </template> 332 </template>
332 </template> 333 </template>
333 <span class="answer-s delButton" @click=" 334 <span class="answer-s delButton" @click="
334 - questionForm.answerList =  
335 - questionForm.answerList.slice(0, -1)  
336 - ">x</span> 335 + questionForm.answerList =
  336 + questionForm.answerList.slice(0, -1)
  337 + ">x</span>
337 <span class="answer-s ac" @click="questionForm.answerList = ''">ac</span> 338 <span class="answer-s ac" @click="questionForm.answerList = ''">ac</span>
338 </p> 339 </p>
339 </div> 340 </div>
@@ -377,9 +378,9 @@ @@ -377,9 +378,9 @@
377 </li> 378 </li>
378 <li v-for="(subQuestions, indexs) in question.subQuestions" :key="indexs"> 379 <li v-for="(subQuestions, indexs) in question.subQuestions" :key="indexs">
379 <p class="set-ans-btn" v-if="subQuestions.qusType && 380 <p class="set-ans-btn" v-if="subQuestions.qusType &&
380 - subQuestions.subNum &&  
381 - subQuestions.subNum > 4  
382 - "> 381 + subQuestions.subNum &&
  382 + subQuestions.subNum > 4
  383 + ">
383 <el-button type="primary" @click="setFormAns(indexs, index)">批量设置答案</el-button> 384 <el-button type="primary" @click="setFormAns(indexs, index)">批量设置答案</el-button>
384 </p> 385 </p>
385 <div v-else class="sub-questions"> 386 <div v-else class="sub-questions">
@@ -388,10 +389,10 @@ @@ -388,10 +389,10 @@
388 </div> 389 </div>
389 <div class="qs-type"> 390 <div class="qs-type">
390 <el-select v-model="subQuestions.questionType" placeholder="选择题目类型" 391 <el-select v-model="subQuestions.questionType" placeholder="选择题目类型"
391 - @change="changeSubQuestions($event, subQuestions)">  
392 - <el-option v-for="options in questionOptions" :key="options.value" :label="options.label"  
393 - :value="options.value"></el-option>  
394 - </el-select> 392 + @change="changeSubQuestions($event, subQuestions)">
  393 + <el-option v-for="options in questionOptions" :key="options.value" :label="options.label"
  394 + :value="options.value"></el-option>
  395 + </el-select>
395 </div> 396 </div>
396 <div class="qs-score"> 397 <div class="qs-score">
397 <el-input-number class="number-ipt" size="medium" :min="1" :max="200" :precision="2" 398 <el-input-number class="number-ipt" size="medium" :min="1" :max="200" :precision="2"
@@ -413,17 +414,17 @@ @@ -413,17 +414,17 @@
413 </p> 414 </p>
414 <p v-if="subQuestions.questionType == 3" class="answer-box"> 415 <p v-if="subQuestions.questionType == 3" class="answer-box">
415 <span class="answer-s" v-for="option in subQuestions.answerOptions.split(',')" :class="subQuestions.correctAnswer?.includes(option) 416 <span class="answer-s" v-for="option in subQuestions.answerOptions.split(',')" :class="subQuestions.correctAnswer?.includes(option)
416 - ? 'active'  
417 - : ''  
418 - " :key="option" @click="changAnswer(subQuestions, option)">{{ option }}</span> 417 + ? 'active'
  418 + : ''
  419 + " :key="option" @click="changAnswer(subQuestions, option)">{{ option }}</span>
419 </p> 420 </p>
420 <p v-if="subQuestions.questionType == 2" class="answer-box"> 421 <p v-if="subQuestions.questionType == 2" class="answer-box">
421 <span class="answer-s" v-for="option in subQuestions.answerOptions.split(',')" :class="subQuestions.correctAnswer == option ? 'active' : '' 422 <span class="answer-s" v-for="option in subQuestions.answerOptions.split(',')" :class="subQuestions.correctAnswer == option ? 'active' : ''
422 - " :key="option" @click="subQuestions.correctAnswer = option">{{ option }}</span> 423 + " :key="option" @click="subQuestions.correctAnswer = option">{{ option }}</span>
423 </p> 424 </p>
424 <p v-if="subQuestions.questionType == 3 || 425 <p v-if="subQuestions.questionType == 3 ||
425 - subQuestions.questionType == 2  
426 - " class="answer-box answer-box2"> 426 + subQuestions.questionType == 2
  427 + " class="answer-box answer-box2">
427 <el-button size="mini" type="primary" icon="el-icon-plus" circle 428 <el-button size="mini" type="primary" icon="el-icon-plus" circle
428 @click="addOptions(subQuestions)"></el-button> 429 @click="addOptions(subQuestions)"></el-button>
429 <el-button size="mini" type="primary" icon="el-icon-minus" round circle 430 <el-button size="mini" type="primary" icon="el-icon-minus" round circle
@@ -470,15 +471,15 @@ @@ -470,15 +471,15 @@
470 <p class="answer-box"> 471 <p class="answer-box">
471 <template v-if="formAns.qusType == 4"> 472 <template v-if="formAns.qusType == 4">
472 <span class="answer-s active" @click=" 473 <span class="answer-s active" @click="
473 - formAns.answerList.length < formAns.subNum  
474 - ? (formAns.answerList += '✓')  
475 - : ''  
476 - ">✓</span> 474 + formAns.answerList.length < formAns.subNum
  475 + ? (formAns.answerList += '✓')
  476 + : ''
  477 + ">✓</span>
477 <span class="answer-s active" @click=" 478 <span class="answer-s active" @click="
478 - formAns.answerList.length < formAns.subNum  
479 - ? (formAns.answerList += '✗')  
480 - : ''  
481 - ">✗</span> 479 + formAns.answerList.length < formAns.subNum
  480 + ? (formAns.answerList += '✗')
  481 + : ''
  482 + ">✗</span>
482 </template> 483 </template>
483 <template v-if="formAns.qusType == 3"> 484 <template v-if="formAns.qusType == 3">
484 <span class="answer-s active" v-for="option in formAns.answerOptions.split(',')" :key="option" 485 <span class="answer-s active" v-for="option in formAns.answerOptions.split(',')" :key="option"
@@ -487,10 +488,10 @@ @@ -487,10 +488,10 @@
487 </template> 488 </template>
488 <template v-if="formAns.qusType == 2"> 489 <template v-if="formAns.qusType == 2">
489 <span class="answer-s active" v-for="option in formAns.answerOptions.split(',')" :key="option" @click=" 490 <span class="answer-s active" v-for="option in formAns.answerOptions.split(',')" :key="option" @click="
490 - formAns.answerList.length < formAns.subNum  
491 - ? (formAns.answerList += option)  
492 - : ''  
493 - ">{{ option }}</span> 491 + formAns.answerList.length < formAns.subNum
  492 + ? (formAns.answerList += option)
  493 + : ''
  494 + ">{{ option }}</span>
494 </template> 495 </template>
495 <span class="answer-s delButton" @click="formAns.answerList = formAns.answerList.slice(0, -1)">x</span> 496 <span class="answer-s delButton" @click="formAns.answerList = formAns.answerList.slice(0, -1)">x</span>
496 <span class="answer-s ac" @click="formAns.answerList = ''">ac</span> 497 <span class="answer-s ac" @click="formAns.answerList = ''">ac</span>
@@ -806,7 +807,7 @@ export default { @@ -806,7 +807,7 @@ export default {
806 }, 807 },
807 handleCheckedClassChange(value) { 808 handleCheckedClassChange(value) {
808 var value = this.shareClass.filter(item => item.isChecked); 809 var value = this.shareClass.filter(item => item.isChecked);
809 - var checkedCount = value.length; 810 + var checkedCount = value.length;
810 this.checkAll = checkedCount === this.shareClass.length; 811 this.checkAll = checkedCount === this.shareClass.length;
811 this.isIndeterminate = checkedCount > 0 && checkedCount < this.shareClass.length; 812 this.isIndeterminate = checkedCount > 0 && checkedCount < this.shareClass.length;
812 }, 813 },
@@ -1269,9 +1270,9 @@ export default { @@ -1269,9 +1270,9 @@ export default {
1269 id: item.id, 1270 id: item.id,
1270 className: item.className 1271 className: item.className
1271 } 1272 }
1272 - })]; 1273 + })];
1273 1274
1274 - this.checkAll = this.checkedClass.length == this.shareClass.length; 1275 + this.checkAll = this.checkedClass.length == this.shareClass.length;
1275 }, 1276 },
1276 openQuestion() { 1277 openQuestion() {
1277 this.questionForm = { ...questionForm }; 1278 this.questionForm = { ...questionForm };
@@ -1491,7 +1492,7 @@ export default { @@ -1491,7 +1492,7 @@ export default {
1491 this.$message.error(info); 1492 this.$message.error(info);
1492 } 1493 }
1493 }, 1494 },
1494 - async addPaperType() { 1495 + async addPaperType(type) {
1495 //保存测验类型 1496 //保存测验类型
1496 if (!this.answerTypeName) { 1497 if (!this.answerTypeName) {
1497 this.$message.error("请填写测验名称!"); 1498 this.$message.error("请填写测验名称!");
@@ -1518,9 +1519,11 @@ export default { @@ -1518,9 +1519,11 @@ export default {
1518 if (status == 0) { 1519 if (status == 0) {
1519 await this._TypeList(); 1520 await this._TypeList();
1520 this.tagList = deepClone(this.answerTypeList); 1521 this.tagList = deepClone(this.answerTypeList);
1521 - this.form.tagId = data || "";  
1522 this.answerTypeName = ""; 1522 this.answerTypeName = "";
1523 - this.$message.success("添加成功"); 1523 + if (type != -1) {
  1524 + this.form.tagId = data || "";
  1525 + this.$message.success("添加成功");
  1526 + }
1524 } else { 1527 } else {
1525 this.$message.error(info); 1528 this.$message.error(info);
1526 } 1529 }
@@ -1591,13 +1594,21 @@ export default { @@ -1591,13 +1594,21 @@ export default {
1591 type: 1, 1594 type: 1,
1592 }); 1595 });
1593 if (status == 0) { 1596 if (status == 0) {
  1597 + var hasWrongType = false;
1594 this.answerTypeList = 1598 this.answerTypeList =
1595 data.list?.map((item) => { 1599 data.list?.map((item) => {
  1600 + if (item.tag == '错题复习') {
  1601 + hasWrongType = true;
  1602 + }
1596 return { 1603 return {
1597 typeName: item.tag, 1604 typeName: item.tag,
1598 id: item.tagId, 1605 id: item.tagId,
1599 }; 1606 };
1600 }) || []; 1607 }) || [];
  1608 + if (!hasWrongType) {
  1609 + this.answerTypeName = "错题复习";
  1610 + await this.addPaperType(-1);
  1611 + }
1601 // if (this.type != 2) { 1612 // if (this.type != 2) {
1602 // this.form.tagId = this.answerTypeList[0]?.id || ""; 1613 // this.form.tagId = this.answerTypeList[0]?.id || "";
1603 // } 1614 // }