Commit 03cd547e3b4a4852294d543159d5cae550182e92
1 parent
0586b4d7
单体型以及其他类型试卷修改答案逻辑
Showing
8 changed files
with
497 additions
and
157 deletions
src/api/urls/apis.js
@@ -414,7 +414,7 @@ export default { | @@ -414,7 +414,7 @@ export default { | ||
414 | 414 | ||
415 | // 删除班级信息(新) | 415 | // 删除班级信息(新) |
416 | deleteClass: "/api_html/school/manager/deleteClass", | 416 | deleteClass: "/api_html/school/manager/deleteClass", |
417 | - // 清除老师下所有关联班级 | 417 | + // 清除老师所有关联班级 |
418 | clearTeacherClasses: "/api_html/school/manager/clearTeacherClasses", | 418 | clearTeacherClasses: "/api_html/school/manager/clearTeacherClasses", |
419 | 419 | ||
420 | // 下载即时测导入分数模板 | 420 | // 下载即时测导入分数模板 |
src/views/basic/test/analysis.vue
@@ -2,29 +2,62 @@ | @@ -2,29 +2,62 @@ | ||
2 | <div ref="main" class="page-container"> | 2 | <div ref="main" class="page-container"> |
3 | <back-box> | 3 | <back-box> |
4 | <template slot="title"> | 4 | <template slot="title"> |
5 | - <span>{{ type == 1 ? '单卷测练报表' : type == 2 ? subjectName + "汇总报表" : type == 3 ? "多科汇总报表" : | ||
6 | - `多班_${subjectName}_${title}_测练成绩对比分析` }}</span> | 5 | + <span>{{ |
6 | + type == 1 | ||
7 | + ? "单卷测练报表" | ||
8 | + : type == 2 | ||
9 | + ? subjectName + "汇总报表" | ||
10 | + : type == 3 | ||
11 | + ? "多科汇总报表" | ||
12 | + : `多班_${subjectName}_${title}_测练成绩对比分析` | ||
13 | + }}</span> | ||
7 | </template> | 14 | </template> |
8 | </back-box> | 15 | </back-box> |
9 | - <Test v-if="type == 1" :role="role" :id="id" :classId="classId" :subjectName="subjectName" :title="title" | ||
10 | - :score="score" /> | ||
11 | - <MultipleTest v-else-if="type == 2" :role="role" :ids="ids" :classId="classId" :subjectName="subjectName" /> | ||
12 | - <MultipleSubTest v-else-if="type == 3" :role="role" :ids="ids" :classId="classId" :subjectName="subjectName" /> | ||
13 | - <Contrast v-else-if="type == 4" :role="role" :ids="ids" :subjectName="subjectName" :title="title" /> | 16 | + <Test |
17 | + v-if="type == 1" | ||
18 | + :role="role" | ||
19 | + :id="id" | ||
20 | + :classId="classId" | ||
21 | + :subjectName="subjectName" | ||
22 | + :title="title" | ||
23 | + :score="score" | ||
24 | + :examType="examType" | ||
25 | + /> | ||
26 | + <MultipleTest | ||
27 | + v-else-if="type == 2" | ||
28 | + :role="role" | ||
29 | + :ids="ids" | ||
30 | + :classId="classId" | ||
31 | + :subjectName="subjectName" | ||
32 | + /> | ||
33 | + <MultipleSubTest | ||
34 | + v-else-if="type == 3" | ||
35 | + :role="role" | ||
36 | + :ids="ids" | ||
37 | + :classId="classId" | ||
38 | + :subjectName="subjectName" | ||
39 | + /> | ||
40 | + <Contrast | ||
41 | + v-else-if="type == 4" | ||
42 | + :role="role" | ||
43 | + :ids="ids" | ||
44 | + :subjectName="subjectName" | ||
45 | + :title="title" | ||
46 | + /> | ||
14 | </div> | 47 | </div> |
15 | </template> | 48 | </template> |
16 | 49 | ||
17 | <script> | 50 | <script> |
18 | -import Test from "./components/test.vue" | ||
19 | -import MultipleTest from "./components/multipleTest.vue" | ||
20 | -import MultipleSubTest from "./components/multipleSubTest.vue" | ||
21 | -import Contrast from "./components/contrast.vue" | 51 | +import Test from "./components/test.vue"; |
52 | +import MultipleTest from "./components/multipleTest.vue"; | ||
53 | +import MultipleSubTest from "./components/multipleSubTest.vue"; | ||
54 | +import Contrast from "./components/contrast.vue"; | ||
22 | export default { | 55 | export default { |
23 | components: { | 56 | components: { |
24 | Test, | 57 | Test, |
25 | MultipleTest, | 58 | MultipleTest, |
26 | MultipleSubTest, | 59 | MultipleSubTest, |
27 | - Contrast | 60 | + Contrast, |
28 | }, | 61 | }, |
29 | data() { | 62 | data() { |
30 | return { | 63 | return { |
@@ -33,9 +66,10 @@ export default { | @@ -33,9 +66,10 @@ export default { | ||
33 | ids: [], | 66 | ids: [], |
34 | type: 0, | 67 | type: 0, |
35 | classId: "", | 68 | classId: "", |
36 | - subjectName: '', | ||
37 | - title: '', | ||
38 | - score: 0 | 69 | + subjectName: "", |
70 | + title: "", | ||
71 | + score: 0, | ||
72 | + examType: 2, | ||
39 | }; | 73 | }; |
40 | }, | 74 | }, |
41 | created() { | 75 | created() { |
@@ -43,16 +77,16 @@ export default { | @@ -43,16 +77,16 @@ export default { | ||
43 | this.$store.getters.info.showRole || | 77 | this.$store.getters.info.showRole || |
44 | this.$store.getters.info.permissions[0].role; | 78 | this.$store.getters.info.permissions[0].role; |
45 | this.id = this.$route.query.id || ""; | 79 | this.id = this.$route.query.id || ""; |
80 | + this.examType = this.$route.query.examType || 2; | ||
46 | this.score = Number(this.$route.query.score) || 0; | 81 | this.score = Number(this.$route.query.score) || 0; |
47 | - this.ids = this.$route.query.ids && this.$route.query.ids.split(",") || []; | ||
48 | - this.type = this.$route.query.type | 82 | + this.ids = |
83 | + (this.$route.query.ids && this.$route.query.ids.split(",")) || []; | ||
84 | + this.type = this.$route.query.type; | ||
49 | this.classId = this.$route.query.classId || ""; | 85 | this.classId = this.$route.query.classId || ""; |
50 | - this.title = this.$route.query.title || "" | ||
51 | - this.subjectName = this.$route.query.subjectName || "" | 86 | + this.title = this.$route.query.title || ""; |
87 | + this.subjectName = this.$route.query.subjectName || ""; | ||
52 | }, | 88 | }, |
53 | - methods: { | ||
54 | - | ||
55 | - } | 89 | + methods: {}, |
56 | }; | 90 | }; |
57 | </script> | 91 | </script> |
58 | <style lang="scss" scoped> | 92 | <style lang="scss" scoped> |
@@ -67,8 +101,6 @@ export default { | @@ -67,8 +101,6 @@ export default { | ||
67 | &.active { | 101 | &.active { |
68 | overflow: hidden; | 102 | overflow: hidden; |
69 | } | 103 | } |
70 | - | ||
71 | - | ||
72 | } | 104 | } |
73 | 105 | ||
74 | .error { | 106 | .error { |
@@ -79,7 +111,6 @@ export default { | @@ -79,7 +111,6 @@ export default { | ||
79 | padding: 20px 20px 0; | 111 | padding: 20px 20px 0; |
80 | } | 112 | } |
81 | 113 | ||
82 | - | ||
83 | .down { | 114 | .down { |
84 | padding-top: 20px; | 115 | padding-top: 20px; |
85 | width: 100%; | 116 | width: 100%; |
src/views/basic/test/components/test.vue
@@ -8,47 +8,128 @@ | @@ -8,47 +8,128 @@ | ||
8 | }}修改了答案,是否重新记分? | 8 | }}修改了答案,是否重新记分? |
9 | </p> | 9 | </p> |
10 | <div class="btn-box"> | 10 | <div class="btn-box"> |
11 | - <el-button type="danger" round @click="_ReScore" size="mini">重新计分</el-button> | ||
12 | - <el-button type="danger" round plain size="mini" @click="paperModifyLog.modifiedTime = ''">暂时不计</el-button> | 11 | + <el-button type="danger" round @click="_ReScore" size="mini" |
12 | + >重新计分</el-button | ||
13 | + > | ||
14 | + <el-button | ||
15 | + type="danger" | ||
16 | + round | ||
17 | + plain | ||
18 | + size="mini" | ||
19 | + @click="paperModifyLog.modifiedTime = ''" | ||
20 | + >暂时不计</el-button | ||
21 | + > | ||
13 | </div> | 22 | </div> |
14 | </div> | 23 | </div> |
15 | <div class="content-header"> | 24 | <div class="content-header"> |
16 | <div class="tab-box"> | 25 | <div class="tab-box"> |
17 | - <span v-for="(item, index) in tabList" :key="item" class="tab-item" :class="type == index ? 'active' : ''" | ||
18 | - @click="setType(index)">{{ item }}</span> | 26 | + <span |
27 | + v-for="(item, index) in tabList" | ||
28 | + :key="item" | ||
29 | + class="tab-item" | ||
30 | + :class="type == index ? 'active' : ''" | ||
31 | + @click="setType(index)" | ||
32 | + >{{ item }}</span | ||
33 | + > | ||
19 | </div> | 34 | </div> |
20 | - <el-button v-if="!status" class="setMinScore" @click="diaMinScore = true" round size="small">设置低分值</el-button> | 35 | + <el-button |
36 | + v-if="!status" | ||
37 | + class="setMinScore" | ||
38 | + @click="diaMinScore = true" | ||
39 | + round | ||
40 | + size="small" | ||
41 | + >设置低分值</el-button | ||
42 | + > | ||
21 | </div> | 43 | </div> |
22 | <div id="print-content" v-loading="loading"> | 44 | <div id="print-content" v-loading="loading"> |
23 | <div class="table-box"> | 45 | <div class="table-box"> |
24 | - <el-table :max-height="tableMaxHeight" v-show="type == 0" :data="tableData" border style="width: 100%"> | ||
25 | - <el-table-column prop="questionIndex" label="题号" align="center" fixed width="60"></el-table-column> | ||
26 | - <el-table-column prop="questionType" label="题型" align="center" fixed width="100"><template slot-scope="scope">{{ | ||
27 | - setSubPro(scope.row.questionType) | ||
28 | - }}</template></el-table-column> | ||
29 | - <el-table-column prop="score" width="100" label="满分值" sortable align="center"></el-table-column> | ||
30 | - <el-table-column width="110" prop="highestScore" label="班最高分" sortable align="center"></el-table-column> | ||
31 | - <el-table-column width="110" prop="lowestScore" label="班最低分" sortable align="center"></el-table-column> | ||
32 | - <el-table-column width="110" prop="avgScore" label="班平均分" sortable align="center"></el-table-column> | ||
33 | - <el-table-column prop="classScoringRate" width="120" sortable label="班级得分率" align="center"><template | ||
34 | - slot-scope="scoped">{{ scoped.row.classScoringRate }}%</template></el-table-column> | ||
35 | - <el-table-column prop="correctAnswer" label="答案" align="center"><template slot-scope="scoped">{{ | ||
36 | - scoped.row.correctAnswer == 1 | ||
37 | - ? "✓" | ||
38 | - : scoped.row.correctAnswer == 2 | ||
39 | - ? "✗" | ||
40 | - : scoped.row.correctAnswer | ||
41 | - }}</template> | 46 | + <el-table |
47 | + :max-height="tableMaxHeight" | ||
48 | + v-show="type == 0" | ||
49 | + :data="tableData" | ||
50 | + border | ||
51 | + style="width: 100%" | ||
52 | + > | ||
53 | + <el-table-column | ||
54 | + prop="questionIndex" | ||
55 | + label="题号" | ||
56 | + align="center" | ||
57 | + fixed | ||
58 | + width="60" | ||
59 | + ></el-table-column> | ||
60 | + <el-table-column | ||
61 | + prop="questionType" | ||
62 | + label="题型" | ||
63 | + align="center" | ||
64 | + fixed | ||
65 | + width="100" | ||
66 | + ><template slot-scope="scope">{{ | ||
67 | + setSubPro(scope.row.questionType) | ||
68 | + }}</template></el-table-column | ||
69 | + > | ||
70 | + <el-table-column | ||
71 | + prop="score" | ||
72 | + width="100" | ||
73 | + label="满分值" | ||
74 | + sortable | ||
75 | + align="center" | ||
76 | + ></el-table-column> | ||
77 | + <el-table-column | ||
78 | + width="110" | ||
79 | + prop="highestScore" | ||
80 | + label="班最高分" | ||
81 | + sortable | ||
82 | + align="center" | ||
83 | + ></el-table-column> | ||
84 | + <el-table-column | ||
85 | + width="110" | ||
86 | + prop="lowestScore" | ||
87 | + label="班最低分" | ||
88 | + sortable | ||
89 | + align="center" | ||
90 | + ></el-table-column> | ||
91 | + <el-table-column | ||
92 | + width="110" | ||
93 | + prop="avgScore" | ||
94 | + label="班平均分" | ||
95 | + sortable | ||
96 | + align="center" | ||
97 | + ></el-table-column> | ||
98 | + <el-table-column | ||
99 | + prop="classScoringRate" | ||
100 | + width="120" | ||
101 | + sortable | ||
102 | + label="班级得分率" | ||
103 | + align="center" | ||
104 | + ><template slot-scope="scoped" | ||
105 | + >{{ scoped.row.classScoringRate }}%</template | ||
106 | + ></el-table-column | ||
107 | + > | ||
108 | + <el-table-column prop="correctAnswer" label="答案" align="center" | ||
109 | + ><template slot-scope="scoped">{{ | ||
110 | + scoped.row.correctAnswer == 1 | ||
111 | + ? "✓" | ||
112 | + : scoped.row.correctAnswer == 2 | ||
113 | + ? "✗" | ||
114 | + : scoped.row.correctAnswer | ||
115 | + }}</template> | ||
42 | </el-table-column> | 116 | </el-table-column> |
43 | - <el-table-column v-for="(item, index) in optionsList" :key="index" :label="item.title" :prop="'count' + index" | ||
44 | - align="center" width="120"><template slot-scope="scope"> | 117 | + <el-table-column |
118 | + v-for="(item, index) in optionsList" | ||
119 | + :key="index" | ||
120 | + :label="item.title" | ||
121 | + :prop="'count' + index" | ||
122 | + align="center" | ||
123 | + width="120" | ||
124 | + ><template slot-scope="scope"> | ||
45 | <p class="persent"> | 125 | <p class="persent"> |
46 | {{ | 126 | {{ |
47 | scope.row.questionType == "5" | 127 | scope.row.questionType == "5" |
48 | - ? "" | ||
49 | - : scope.row["option" + index] | ||
50 | - ? `${scope.row["option" + index]}(${scope.row["persent" + index] | ||
51 | - })` | 128 | + ? "" |
129 | + : scope.row["option" + index] | ||
130 | + ? `${scope.row["option" + index]}(${ | ||
131 | + scope.row["persent" + index] | ||
132 | + })` | ||
52 | : "" | 133 | : "" |
53 | }} | 134 | }} |
54 | </p> | 135 | </p> |
@@ -86,18 +167,22 @@ | @@ -86,18 +167,22 @@ | ||
86 | <td> | 167 | <td> |
87 | {{ | 168 | {{ |
88 | tr.correctAnswer == 1 | 169 | tr.correctAnswer == 1 |
89 | - ? "✓" | ||
90 | - : tr.correctAnswer == 2 | 170 | + ? "✓" |
171 | + : tr.correctAnswer == 2 | ||
91 | ? "✗" | 172 | ? "✗" |
92 | : tr.correctAnswer | 173 | : tr.correctAnswer |
93 | }} | 174 | }} |
94 | </td> | 175 | </td> |
95 | - <td v-for="(item, index) in optionsList" :key="index" width="120"> | 176 | + <td |
177 | + v-for="(item, index) in optionsList" | ||
178 | + :key="index" | ||
179 | + width="120" | ||
180 | + > | ||
96 | <p class="persent"> | 181 | <p class="persent"> |
97 | {{ | 182 | {{ |
98 | tr.questionType == "5" | 183 | tr.questionType == "5" |
99 | - ? "" | ||
100 | - : tr["option" + index] | 184 | + ? "" |
185 | + : tr["option" + index] | ||
101 | ? `${tr["option" + index]}(${tr["persent" + index]})` | 186 | ? `${tr["option" + index]}(${tr["persent" + index]})` |
102 | : "" | 187 | : "" |
103 | }} | 188 | }} |
@@ -121,7 +206,9 @@ | @@ -121,7 +206,9 @@ | ||
121 | <span class="hui-s s2">{{ | 206 | <span class="hui-s s2">{{ |
122 | examReport.subjectiveAvgScore | 207 | examReport.subjectiveAvgScore |
123 | }}</span> | 208 | }}</span> |
124 | - <span class="hui-s s3">{{ examReport.subjectiveClassScoringRate }}%</span> | 209 | + <span class="hui-s s3" |
210 | + >{{ examReport.subjectiveClassScoringRate }}%</span | ||
211 | + > | ||
125 | </li> | 212 | </li> |
126 | <li class="hui-li"> | 213 | <li class="hui-li"> |
127 | <span class="hui-s s1">客观题</span> | 214 | <span class="hui-s s1">客观题</span> |
@@ -133,7 +220,9 @@ | @@ -133,7 +220,9 @@ | ||
133 | examReport.objectiveLowestScore | 220 | examReport.objectiveLowestScore |
134 | }}</span> | 221 | }}</span> |
135 | <span class="hui-s s2">{{ examReport.objectiveAvgScore }}</span> | 222 | <span class="hui-s s2">{{ examReport.objectiveAvgScore }}</span> |
136 | - <span class="hui-s s3">{{ examReport.objectiveClassScoringRate }}%</span> | 223 | + <span class="hui-s s3" |
224 | + >{{ examReport.objectiveClassScoringRate }}%</span | ||
225 | + > | ||
137 | </li> | 226 | </li> |
138 | <li class="hui-li"> | 227 | <li class="hui-li"> |
139 | <span class="hui-s s1">整卷</span> | 228 | <span class="hui-s s1">整卷</span> |
@@ -146,51 +235,176 @@ | @@ -146,51 +235,176 @@ | ||
146 | </ul> | 235 | </ul> |
147 | </div> | 236 | </div> |
148 | </div> | 237 | </div> |
149 | - <el-table v-show="type == 1" :max-height="tableMaxHeight" :data="tableData2" border style="width: 100%" | ||
150 | - :default-sort="{ prop: 'dadui', order: 'descending' }"> | ||
151 | - <el-table-column prop="studentCode" label="学号" align="center" fixed></el-table-column> | ||
152 | - <el-table-column prop="studentName" label="姓名" fixed align="center"></el-table-column> | ||
153 | - <el-table-column prop="examScore" label="总分" sortable align="center"></el-table-column> | ||
154 | - <el-table-column prop="scoringRate" label="得分率" sortable align="center"><template slot-scope="scope">{{ | ||
155 | - scope.row.scoringRate }}%</template></el-table-column> | ||
156 | - <el-table-column prop="classRank" label="班名" sortable align="center"></el-table-column> | 238 | + <el-table |
239 | + v-show="type == 1" | ||
240 | + :max-height="tableMaxHeight" | ||
241 | + :data="tableData2" | ||
242 | + border | ||
243 | + style="width: 100%" | ||
244 | + :default-sort="{ prop: 'dadui', order: 'descending' }" | ||
245 | + > | ||
246 | + <el-table-column | ||
247 | + prop="studentCode" | ||
248 | + label="学号" | ||
249 | + align="center" | ||
250 | + fixed | ||
251 | + ></el-table-column> | ||
252 | + <el-table-column | ||
253 | + prop="studentName" | ||
254 | + label="姓名" | ||
255 | + fixed | ||
256 | + align="center" | ||
257 | + ></el-table-column> | ||
258 | + <el-table-column | ||
259 | + prop="examScore" | ||
260 | + label="总分" | ||
261 | + sortable | ||
262 | + align="center" | ||
263 | + ></el-table-column> | ||
264 | + <el-table-column | ||
265 | + prop="scoringRate" | ||
266 | + label="得分率" | ||
267 | + sortable | ||
268 | + align="center" | ||
269 | + ><template slot-scope="scope" | ||
270 | + >{{ scope.row.scoringRate }}%</template | ||
271 | + ></el-table-column | ||
272 | + > | ||
273 | + <el-table-column | ||
274 | + prop="classRank" | ||
275 | + label="班名" | ||
276 | + sortable | ||
277 | + align="center" | ||
278 | + ></el-table-column> | ||
157 | <el-table-column label="客观题" align="center"> | 279 | <el-table-column label="客观题" align="center"> |
158 | - <el-table-column prop="objectiveExamScore" label="得分" align="center"></el-table-column> | ||
159 | - <el-table-column prop="objectiveScoringRate" label="得分率" align="center"><template slot-scope="scope">{{ | ||
160 | - scope.row.objectiveScoringRate }}%</template></el-table-column> | 280 | + <el-table-column |
281 | + prop="objectiveExamScore" | ||
282 | + label="得分" | ||
283 | + align="center" | ||
284 | + ></el-table-column> | ||
285 | + <el-table-column | ||
286 | + prop="objectiveScoringRate" | ||
287 | + label="得分率" | ||
288 | + align="center" | ||
289 | + ><template slot-scope="scope" | ||
290 | + >{{ scope.row.objectiveScoringRate }}%</template | ||
291 | + ></el-table-column | ||
292 | + > | ||
161 | </el-table-column> | 293 | </el-table-column> |
162 | <el-table-column label="主观题" align="center"> | 294 | <el-table-column label="主观题" align="center"> |
163 | - <el-table-column prop="subjectiveExamScore" label="得分" align="center"></el-table-column> | ||
164 | - <el-table-column prop="subjectiveScoringRate" label="得分率" align="center"><template slot-scope="scope">{{ | ||
165 | - scope.row.subjectiveScoringRate }}%</template></el-table-column> | 295 | + <el-table-column |
296 | + prop="subjectiveExamScore" | ||
297 | + label="得分" | ||
298 | + align="center" | ||
299 | + ></el-table-column> | ||
300 | + <el-table-column | ||
301 | + prop="subjectiveScoringRate" | ||
302 | + label="得分率" | ||
303 | + align="center" | ||
304 | + ><template slot-scope="scope" | ||
305 | + >{{ scope.row.subjectiveScoringRate }}%</template | ||
306 | + ></el-table-column | ||
307 | + > | ||
166 | </el-table-column> | 308 | </el-table-column> |
167 | </el-table> | 309 | </el-table> |
168 | - <el-table v-show="type == 2" :max-height="tableMaxHeight" :data="tableData2" border style="width: 100%" | ||
169 | - :default-sort="{ prop: '', order: 'descending' }"> | ||
170 | - <el-table-column prop="studentCode" label="学号" fixed align="center" width="120"></el-table-column> | ||
171 | - <el-table-column prop="studentName" label="姓名" fixed align="center"></el-table-column> | ||
172 | - <el-table-column prop="examScore" label="总分" sortable align="center"></el-table-column> | 310 | + <el-table |
311 | + v-show="type == 2" | ||
312 | + :max-height="tableMaxHeight" | ||
313 | + :data="tableData2" | ||
314 | + border | ||
315 | + style="width: 100%" | ||
316 | + :default-sort="{ prop: '', order: 'descending' }" | ||
317 | + > | ||
318 | + <el-table-column | ||
319 | + prop="studentCode" | ||
320 | + label="学号" | ||
321 | + fixed | ||
322 | + align="center" | ||
323 | + width="120" | ||
324 | + ></el-table-column> | ||
325 | + <el-table-column | ||
326 | + prop="studentName" | ||
327 | + label="姓名" | ||
328 | + fixed | ||
329 | + align="center" | ||
330 | + ></el-table-column> | ||
331 | + <el-table-column | ||
332 | + prop="examScore" | ||
333 | + label="总分" | ||
334 | + sortable | ||
335 | + align="center" | ||
336 | + ></el-table-column> | ||
173 | <el-table-column label="分数组成" align="center"> | 337 | <el-table-column label="分数组成" align="center"> |
174 | - <el-table-column prop="objectiveExamScore" label="客观题分" align="center"></el-table-column> | ||
175 | - <el-table-column prop="subjectiveExamScore" label="主观题分" align="center"></el-table-column> | 338 | + <el-table-column |
339 | + prop="objectiveExamScore" | ||
340 | + label="客观题分" | ||
341 | + align="center" | ||
342 | + ></el-table-column> | ||
343 | + <el-table-column | ||
344 | + prop="subjectiveExamScore" | ||
345 | + label="主观题分" | ||
346 | + align="center" | ||
347 | + ></el-table-column> | ||
176 | </el-table-column> | 348 | </el-table-column> |
177 | - <el-table-column align="center" v-for="(item, index) in questionList" :key="index" :label="'Q' + item.id" | ||
178 | - :prop="'score' + item.id"> | 349 | + <el-table-column |
350 | + align="center" | ||
351 | + v-for="(item, index) in questionList" | ||
352 | + :key="index" | ||
353 | + :label="'Q' + item.id" | ||
354 | + :prop="'score' + item.id" | ||
355 | + > | ||
179 | </el-table-column> | 356 | </el-table-column> |
180 | </el-table> | 357 | </el-table> |
181 | - <el-table :max-height="tableMaxHeight" v-show="type == 3" :data="tableData2" border style="width: 100%" | ||
182 | - :default-sort="{ prop: '', order: 'descending' }"> | ||
183 | - <el-table-column prop="studentCode" label="学号" fixed align="center"></el-table-column> | ||
184 | - <el-table-column prop="studentName" label="姓名" fixed align="center"></el-table-column> | ||
185 | - <el-table-column prop="className" label="班级" align="center"></el-table-column> | ||
186 | - <el-table-column prop="examScore" label="总分" sortable align="center"></el-table-column> | ||
187 | - <el-table-column align="center" v-for="(item, index) in questionList" :key="index" :label="'Q' + item.id"> | 358 | + <el-table |
359 | + :max-height="tableMaxHeight" | ||
360 | + v-show="type == 3" | ||
361 | + :data="tableData2" | ||
362 | + border | ||
363 | + style="width: 100%" | ||
364 | + :default-sort="{ prop: '', order: 'descending' }" | ||
365 | + > | ||
366 | + <el-table-column | ||
367 | + prop="studentCode" | ||
368 | + label="学号" | ||
369 | + fixed | ||
370 | + align="center" | ||
371 | + ></el-table-column> | ||
372 | + <el-table-column | ||
373 | + prop="studentName" | ||
374 | + label="姓名" | ||
375 | + fixed | ||
376 | + align="center" | ||
377 | + ></el-table-column> | ||
378 | + <el-table-column | ||
379 | + prop="className" | ||
380 | + label="班级" | ||
381 | + align="center" | ||
382 | + ></el-table-column> | ||
383 | + <el-table-column | ||
384 | + prop="examScore" | ||
385 | + label="总分" | ||
386 | + sortable | ||
387 | + align="center" | ||
388 | + ></el-table-column> | ||
389 | + <el-table-column | ||
390 | + align="center" | ||
391 | + v-for="(item, index) in questionList" | ||
392 | + :key="index" | ||
393 | + :label="'Q' + item.id" | ||
394 | + > | ||
188 | <template slot-scope="scope"> | 395 | <template slot-scope="scope"> |
189 | <span v-if="tableData[index]?.questionType == 5">*</span> | 396 | <span v-if="tableData[index]?.questionType == 5">*</span> |
190 | - <span v-else-if="scope.row['answer' + item.id]" :class="scope.row['isRight' + item.id] ? '' : 'error'"> | 397 | + <span |
398 | + v-else-if="scope.row['answer' + item.id]" | ||
399 | + :class="scope.row['isRight' + item.id] ? '' : 'error'" | ||
400 | + > | ||
191 | {{ scope.row["answer" + item.id] }} | 401 | {{ scope.row["answer" + item.id] }} |
192 | </span> | 402 | </span> |
193 | - <span v-else :class="scope.row['questionType' + item.id] == 5 ? '' : 'error'">-</span> | 403 | + <span |
404 | + v-else | ||
405 | + :class="scope.row['questionType' + item.id] == 5 ? '' : 'error'" | ||
406 | + >-</span | ||
407 | + > | ||
194 | </template> | 408 | </template> |
195 | </el-table-column> | 409 | </el-table-column> |
196 | </el-table> | 410 | </el-table> |
@@ -198,22 +412,56 @@ | @@ -198,22 +412,56 @@ | ||
198 | </div> | 412 | </div> |
199 | <div class="down"> | 413 | <div class="down"> |
200 | <div> | 414 | <div> |
201 | - <el-button @click="exportData" type="primary" plain round icon="fa fa-cloud-download">导出报表</el-button> | ||
202 | - <el-button v-if="!this.$store.getters.code" @click="print" type="primary" plain round | ||
203 | - icon="el-icon-printer">打印</el-button> | 415 | + <el-button |
416 | + @click="exportData" | ||
417 | + type="primary" | ||
418 | + plain | ||
419 | + round | ||
420 | + icon="fa fa-cloud-download" | ||
421 | + >导出报表</el-button | ||
422 | + > | ||
423 | + <el-button | ||
424 | + v-if="!this.$store.getters.code" | ||
425 | + @click="print" | ||
426 | + type="primary" | ||
427 | + plain | ||
428 | + round | ||
429 | + icon="el-icon-printer" | ||
430 | + >打印</el-button | ||
431 | + > | ||
204 | </div> | 432 | </div> |
205 | <div v-if="!status"> | 433 | <div v-if="!status"> |
206 | - <el-button type="primary" round @click="openScoreSet">答卷录分</el-button> | 434 | + <el-button type="primary" round @click="openScoreSet" |
435 | + >答卷录分</el-button | ||
436 | + > | ||
207 | 437 | ||
208 | <template v-if="role != 'ROLE_BANZHUREN'"> | 438 | <template v-if="role != 'ROLE_BANZHUREN'"> |
209 | - <el-button @click="edit" type="primary" v-if="examReport.subjectiveScore != examReport.examPaperScore" | ||
210 | - round>查看题目</el-button></template> | 439 | + <el-button |
440 | + @click="edit" | ||
441 | + type="primary" | ||
442 | + v-if="examReport.subjectiveScore != examReport.examPaperScore" | ||
443 | + round | ||
444 | + >查看题目</el-button | ||
445 | + ></template | ||
446 | + > | ||
211 | </div> | 447 | </div> |
212 | </div> | 448 | </div> |
213 | - <ScoreSet v-show="diaScoreSet" :role="role" :id="id" :title="title" :examScore="score" :diaScoreSet="diaScoreSet" | ||
214 | - @closeScoreSet="closeScoreSet" /> | ||
215 | - <el-dialog :close-on-click-modal="false" title="低分区间设置" :visible.sync="diaMinScore" width="480px" | ||
216 | - @closed="closeDiaMinScore"> | 449 | + <ScoreSet |
450 | + v-show="diaScoreSet" | ||
451 | + :role="role" | ||
452 | + :id="id" | ||
453 | + :title="title" | ||
454 | + :examScore="score" | ||
455 | + :diaScoreSet="diaScoreSet" | ||
456 | + @closeScoreSet="closeScoreSet" | ||
457 | + /> | ||
458 | + <el-dialog | ||
459 | + :close-on-click-modal="false" | ||
460 | + title="低分区间设置" | ||
461 | + :visible.sync="diaMinScore" | ||
462 | + width="480px" | ||
463 | + @closed="closeDiaMinScore" | ||
464 | + > | ||
217 | <el-form> | 465 | <el-form> |
218 | <el-form-item label="低分设置模式:"> | 466 | <el-form-item label="低分设置模式:"> |
219 | <el-select v-model="lowRange.type" @change="changeScore"> | 467 | <el-select v-model="lowRange.type" @change="changeScore"> |
@@ -223,16 +471,35 @@ | @@ -223,16 +471,35 @@ | ||
223 | </el-select> | 471 | </el-select> |
224 | </el-form-item> | 472 | </el-form-item> |
225 | <el-form-item label="低分区间:"> | 473 | <el-form-item label="低分区间:"> |
226 | - <el-input class="score-ipt" type="number" v-model="lowRange.range[0]" :min="0" :max="100" | 474 | + <el-input |
475 | + class="score-ipt" | ||
476 | + type="number" | ||
477 | + v-model="lowRange.range[0]" | ||
478 | + :min="0" | ||
479 | + :max="100" | ||
227 | @input="lowRange.range[1] > 100 ? (lowRange.range[1] = 100) : ''" | 480 | @input="lowRange.range[1] > 100 ? (lowRange.range[1] = 100) : ''" |
228 | - @keydown.native="keydownRange($event)"></el-input>{{ lowRange.type != 0 ? "%" : "分" }}(含) | ||
229 | - <el-input class="score-ipt" type="number" v-model="lowRange.range[1]" :min="0" :max="100" | 481 | + @keydown.native="keydownRange($event)" |
482 | + ></el-input | ||
483 | + >{{ lowRange.type != 0 ? "%" : "分" }}(含) | ||
484 | + <el-input | ||
485 | + class="score-ipt" | ||
486 | + type="number" | ||
487 | + v-model="lowRange.range[1]" | ||
488 | + :min="0" | ||
489 | + :max="100" | ||
230 | @input="lowRange.range[1] > 100 ? (lowRange.range[1] = 100) : ''" | 490 | @input="lowRange.range[1] > 100 ? (lowRange.range[1] = 100) : ''" |
231 | - @keydown.native="keydownRange($event)"></el-input>{{ lowRange.type != 0 ? "%" : "分" }}(含) | 491 | + @keydown.native="keydownRange($event)" |
492 | + ></el-input | ||
493 | + >{{ lowRange.type != 0 ? "%" : "分" }}(含) | ||
232 | </el-form-item> | 494 | </el-form-item> |
233 | </el-form> | 495 | </el-form> |
234 | 496 | ||
235 | - <div class="dialog-footer" slot="footer" align="center" v-loading="loadingTange"> | 497 | + <div |
498 | + class="dialog-footer" | ||
499 | + slot="footer" | ||
500 | + align="center" | ||
501 | + v-loading="loadingTange" | ||
502 | + > | ||
236 | <el-button type="danger" @click="_SavelowRange">保存</el-button> | 503 | <el-button type="danger" @click="_SavelowRange">保存</el-button> |
237 | <el-button @click="diaMinScore = false">取 消</el-button> | 504 | <el-button @click="diaMinScore = false">取 消</el-button> |
238 | </div> | 505 | </div> |
@@ -240,7 +507,7 @@ | @@ -240,7 +507,7 @@ | ||
240 | </div> | 507 | </div> |
241 | </template> | 508 | </template> |
242 | <script> | 509 | <script> |
243 | -import ScoreSet from "./scoreSet.vue" | 510 | +import ScoreSet from "./scoreSet.vue"; |
244 | import { downloadFile, tablePrint } from "@/utils"; | 511 | import { downloadFile, tablePrint } from "@/utils"; |
245 | export default { | 512 | export default { |
246 | components: { | 513 | components: { |
@@ -252,20 +519,22 @@ export default { | @@ -252,20 +519,22 @@ export default { | ||
252 | title: String, | 519 | title: String, |
253 | classId: String, | 520 | classId: String, |
254 | subjectName: String, | 521 | subjectName: String, |
522 | + examType: String, | ||
255 | score: { | 523 | score: { |
256 | type: Number, | 524 | type: Number, |
257 | - default: 0 | 525 | + default: 0, |
258 | }, | 526 | }, |
259 | }, | 527 | }, |
260 | data() { | 528 | data() { |
261 | return { | 529 | return { |
262 | - status: 0,// 1:已归档试卷 | 530 | + status: 0, // 1:已归档试卷 |
263 | tableMaxHeight: 600, | 531 | tableMaxHeight: 600, |
264 | loading: false, | 532 | loading: false, |
265 | exportLoading: false, | 533 | exportLoading: false, |
266 | tabList: ["试题分析", "成绩排名", "小题分报表", "作答明细表"], | 534 | tabList: ["试题分析", "成绩排名", "小题分报表", "作答明细表"], |
267 | type: 0, | 535 | type: 0, |
268 | - paperModifyLog: { //修改信息 | 536 | + paperModifyLog: { |
537 | + //修改信息 | ||
269 | realName: "", | 538 | realName: "", |
270 | modifiedTime: "", | 539 | modifiedTime: "", |
271 | }, | 540 | }, |
@@ -309,7 +578,7 @@ export default { | @@ -309,7 +578,7 @@ export default { | ||
309 | 578 | ||
310 | //导出相关 | 579 | //导出相关 |
311 | diaShow: false, | 580 | diaShow: false, |
312 | - exportStudent: [] | 581 | + exportStudent: [], |
313 | }; | 582 | }; |
314 | }, | 583 | }, |
315 | created() { | 584 | created() { |
@@ -330,7 +599,7 @@ export default { | @@ -330,7 +599,7 @@ export default { | ||
330 | }, | 599 | }, |
331 | //关闭设置分数 | 600 | //关闭设置分数 |
332 | closeScoreSet() { | 601 | closeScoreSet() { |
333 | - this.diaScoreSet = false | 602 | + this.diaScoreSet = false; |
334 | this._QueryData(); | 603 | this._QueryData(); |
335 | }, | 604 | }, |
336 | setType(type) { | 605 | setType(type) { |
@@ -362,6 +631,7 @@ export default { | @@ -362,6 +631,7 @@ export default { | ||
362 | paperId: this.id, | 631 | paperId: this.id, |
363 | title: this.title, | 632 | title: this.title, |
364 | type: 2, | 633 | type: 2, |
634 | + examType: this.examType, | ||
365 | }, | 635 | }, |
366 | }); | 636 | }); |
367 | }, | 637 | }, |
@@ -386,9 +656,12 @@ export default { | @@ -386,9 +656,12 @@ export default { | ||
386 | }, | 656 | }, |
387 | // 保存低分设置 | 657 | // 保存低分设置 |
388 | async _SavelowRange() { | 658 | async _SavelowRange() { |
389 | - if (this.lowRange.range[0].trim() == "" || this.lowRange.range[1].trim() == "") { | 659 | + if ( |
660 | + this.lowRange.range[0].trim() == "" || | ||
661 | + this.lowRange.range[1].trim() == "" | ||
662 | + ) { | ||
390 | this.$message.warning("请补全低分设置!"); | 663 | this.$message.warning("请补全低分设置!"); |
391 | - return | 664 | + return; |
392 | } | 665 | } |
393 | this.loadingTange = true; | 666 | this.loadingTange = true; |
394 | let { data, status, info } = await this.$request.setLowRange({ | 667 | let { data, status, info } = await this.$request.setLowRange({ |
@@ -413,9 +686,10 @@ export default { | @@ -413,9 +686,10 @@ export default { | ||
413 | async examDetail() { | 686 | async examDetail() { |
414 | //详情 | 687 | //详情 |
415 | this.loading = true; | 688 | this.loading = true; |
416 | - const examDetail = this.role == "ROLE_PERSONAL" ? | ||
417 | - this.$request.pExamDetail | ||
418 | - : this.$request.examDetail; | 689 | + const examDetail = |
690 | + this.role == "ROLE_PERSONAL" | ||
691 | + ? this.$request.pExamDetail | ||
692 | + : this.$request.examDetail; | ||
419 | 693 | ||
420 | let { data, info, status } = await examDetail({ | 694 | let { data, info, status } = await examDetail({ |
421 | examId: this.id, | 695 | examId: this.id, |
@@ -444,7 +718,7 @@ export default { | @@ -444,7 +718,7 @@ export default { | ||
444 | }); | 718 | }); |
445 | this.loading = false; | 719 | this.loading = false; |
446 | if (status === 0) { | 720 | if (status === 0) { |
447 | - this.$store.commit("setRefreshTestList", true) | 721 | + this.$store.commit("setRefreshTestList", true); |
448 | this.$message.success(info); | 722 | this.$message.success(info); |
449 | this._QueryData(); | 723 | this._QueryData(); |
450 | this.paperModifyLog.modifiedTime = ""; | 724 | this.paperModifyLog.modifiedTime = ""; |
@@ -456,9 +730,10 @@ export default { | @@ -456,9 +730,10 @@ export default { | ||
456 | async examStudentReport() { | 730 | async examStudentReport() { |
457 | //成绩排名-小题分-作答明细 | 731 | //成绩排名-小题分-作答明细 |
458 | this.loading = true; | 732 | this.loading = true; |
459 | - const examStudentReport = this.role == "ROLE_PERSONAL" ? | ||
460 | - this.$request.pExamStudentReport | ||
461 | - : this.$request.examStudentReport; | 733 | + const examStudentReport = |
734 | + this.role == "ROLE_PERSONAL" | ||
735 | + ? this.$request.pExamStudentReport | ||
736 | + : this.$request.examStudentReport; | ||
462 | let { data, info, status } = await examStudentReport({ | 737 | let { data, info, status } = await examStudentReport({ |
463 | examId: this.id, | 738 | examId: this.id, |
464 | }); | 739 | }); |
@@ -491,7 +766,7 @@ export default { | @@ -491,7 +766,7 @@ export default { | ||
491 | this.questionList = optionsList.sort((a, b) => { | 766 | this.questionList = optionsList.sort((a, b) => { |
492 | return a.id - b.id; | 767 | return a.id - b.id; |
493 | }); | 768 | }); |
494 | - this.exportStudent = [...this.tableData2] | 769 | + this.exportStudent = [...this.tableData2]; |
495 | } else { | 770 | } else { |
496 | this.$message.error(info); | 771 | this.$message.error(info); |
497 | } | 772 | } |
@@ -499,9 +774,10 @@ export default { | @@ -499,9 +774,10 @@ export default { | ||
499 | async examQuestionReport() { | 774 | async examQuestionReport() { |
500 | //试题分析 | 775 | //试题分析 |
501 | this.loading = true; | 776 | this.loading = true; |
502 | - const examQuestionReport = this.role == "ROLE_PERSONAL" ? | ||
503 | - this.$request.pExamQuestionReport | ||
504 | - : this.$request.examQuestionReport; | 777 | + const examQuestionReport = |
778 | + this.role == "ROLE_PERSONAL" | ||
779 | + ? this.$request.pExamQuestionReport | ||
780 | + : this.$request.examQuestionReport; | ||
505 | 781 | ||
506 | let { data, info, status } = await examQuestionReport({ | 782 | let { data, info, status } = await examQuestionReport({ |
507 | examId: this.id, | 783 | examId: this.id, |
@@ -537,8 +813,8 @@ export default { | @@ -537,8 +813,8 @@ export default { | ||
537 | ? defaultArr[index]?.option == 1 | 813 | ? defaultArr[index]?.option == 1 |
538 | ? "✓" | 814 | ? "✓" |
539 | : defaultArr[index]?.option == 2 | 815 | : defaultArr[index]?.option == 2 |
540 | - ? "✗" | ||
541 | - : defaultArr[index]?.option | 816 | + ? "✗" |
817 | + : defaultArr[index]?.option | ||
542 | : ""; | 818 | : ""; |
543 | items["title"] = "选项" + (index + 1); | 819 | items["title"] = "选项" + (index + 1); |
544 | } else { | 820 | } else { |
@@ -567,9 +843,10 @@ export default { | @@ -567,9 +843,10 @@ export default { | ||
567 | async exportData() { | 843 | async exportData() { |
568 | if (this.exportLoading == true) return; | 844 | if (this.exportLoading == true) return; |
569 | this.exportLoading = true; | 845 | this.exportLoading = true; |
570 | - const exportExamReport = this.role == "ROLE_PERSONAL" ? | ||
571 | - this.$request.pExportExamReport | ||
572 | - : this.$request.exportExamReport; | 846 | + const exportExamReport = |
847 | + this.role == "ROLE_PERSONAL" | ||
848 | + ? this.$request.pExportExamReport | ||
849 | + : this.$request.exportExamReport; | ||
573 | 850 | ||
574 | const data = await exportExamReport({ | 851 | const data = await exportExamReport({ |
575 | examId: this.id, | 852 | examId: this.id, |
@@ -624,8 +901,6 @@ div::-webkit-scrollbar-thumb { | @@ -624,8 +901,6 @@ div::-webkit-scrollbar-thumb { | ||
624 | color: #f30; | 901 | color: #f30; |
625 | } | 902 | } |
626 | 903 | ||
627 | - | ||
628 | - | ||
629 | .tips { | 904 | .tips { |
630 | height: 48px; | 905 | height: 48px; |
631 | box-sizing: border-box; | 906 | box-sizing: border-box; |
src/views/basic/test/list.vue
@@ -299,6 +299,7 @@ export default { | @@ -299,6 +299,7 @@ export default { | ||
299 | subjectName: obj.subjectName, | 299 | subjectName: obj.subjectName, |
300 | classId: this.query.classId[0], | 300 | classId: this.query.classId[0], |
301 | params: this.$route.query.params, | 301 | params: this.$route.query.params, |
302 | + examType: obj.examPaperId == 0 ? 1 : 2, | ||
302 | }, | 303 | }, |
303 | }); | 304 | }); |
304 | }, | 305 | }, |
@@ -404,6 +405,7 @@ export default { | @@ -404,6 +405,7 @@ export default { | ||
404 | paperId: item.id, | 405 | paperId: item.id, |
405 | title: item.title, | 406 | title: item.title, |
406 | type: 2, | 407 | type: 2, |
408 | + examType: item.examType || 1, | ||
407 | }, | 409 | }, |
408 | }); | 410 | }); |
409 | }, | 411 | }, |
src/views/examinationPaper/add.vue
@@ -1260,13 +1260,13 @@ export default { | @@ -1260,13 +1260,13 @@ export default { | ||
1260 | this.stem.indexs = indexs; | 1260 | this.stem.indexs = indexs; |
1261 | this.stem.type = type; | 1261 | this.stem.type = type; |
1262 | if (type == 1) { | 1262 | if (type == 1) { |
1263 | - if (obj.screenshot == "") { | 1263 | + if (!obj.screenshot || obj.screenshot == "") { |
1264 | this.iframeLoading = false; | 1264 | this.iframeLoading = false; |
1265 | } | 1265 | } |
1266 | this.stem.screenshot = obj.screenshot || ""; | 1266 | this.stem.screenshot = obj.screenshot || ""; |
1267 | this.stem.answerScreenshot = ""; | 1267 | this.stem.answerScreenshot = ""; |
1268 | } else { | 1268 | } else { |
1269 | - if (obj.answerScreenshot == "") { | 1269 | + if (!obj.answerScreenshot || obj.answerScreenshot == "") { |
1270 | this.iframeLoading = false; | 1270 | this.iframeLoading = false; |
1271 | } | 1271 | } |
1272 | this.stem.answerScreenshot = obj.answerScreenshot || ""; | 1272 | this.stem.answerScreenshot = obj.answerScreenshot || ""; |
@@ -2044,10 +2044,12 @@ export default { | @@ -2044,10 +2044,12 @@ export default { | ||
2044 | let subjectArr = []; | 2044 | let subjectArr = []; |
2045 | this.subjectList = | 2045 | this.subjectList = |
2046 | data.subjectNames?.map((item) => { | 2046 | data.subjectNames?.map((item) => { |
2047 | - subjectArr.push(item.subjectName || item); | 2047 | + let subName = |
2048 | + this.role == "ROLE_PERSONAL" ? item.subjectName : item; | ||
2049 | + subjectArr.push(subName); | ||
2048 | return { | 2050 | return { |
2049 | - value: this.role == "ROLE_PERSONAL" ? item.subjectName : item, | ||
2050 | - label: this.role == "ROLE_PERSONAL" ? item.subjectName : item, | 2051 | + value: subName, |
2052 | + label: subName, | ||
2051 | }; | 2053 | }; |
2052 | }) || []; | 2054 | }) || []; |
2053 | if (this.subjectList.length) { | 2055 | if (this.subjectList.length) { |
src/views/examinationPaper/addQs.vue
@@ -448,7 +448,7 @@ | @@ -448,7 +448,7 @@ | ||
448 | </div> | 448 | </div> |
449 | </el-dialog> | 449 | </el-dialog> |
450 | </div> | 450 | </div> |
451 | - <div v-show="step == 2"> | 451 | + <div v-if="step == 2"> |
452 | <div class="answer-title"> | 452 | <div class="answer-title"> |
453 | <p class="name">{{ form.title }}</p> | 453 | <p class="name">{{ form.title }}</p> |
454 | </div> | 454 | </div> |
@@ -547,6 +547,7 @@ export default { | @@ -547,6 +547,7 @@ export default { | ||
547 | listShare: 0, | 547 | listShare: 0, |
548 | uploadUrl: "/file/uploadImgToHtml", | 548 | uploadUrl: "/file/uploadImgToHtml", |
549 | iframeLoading: false, | 549 | iframeLoading: false, |
550 | + subjectName: "", | ||
550 | }; | 551 | }; |
551 | }, | 552 | }, |
552 | computed: { | 553 | computed: { |
@@ -588,6 +589,7 @@ export default { | @@ -588,6 +589,7 @@ export default { | ||
588 | this.listShare = this.$route.query.listShare | 589 | this.listShare = this.$route.query.listShare |
589 | ? this.$route.query.listShare | 590 | ? this.$route.query.listShare |
590 | : 0; | 591 | : 0; |
592 | + this.subjectName = this.$route.query.subjectName || ""; | ||
591 | this.type = this.$route.query.type ? this.$route.query.type : 1; | 593 | this.type = this.$route.query.type ? this.$route.query.type : 1; |
592 | this.role = | 594 | this.role = |
593 | this.$store.getters.info.showRole || | 595 | this.$store.getters.info.showRole || |
@@ -622,13 +624,13 @@ export default { | @@ -622,13 +624,13 @@ export default { | ||
622 | this.stem.indexs = indexs; | 624 | this.stem.indexs = indexs; |
623 | this.stem.type = type; | 625 | this.stem.type = type; |
624 | if (type == 1) { | 626 | if (type == 1) { |
625 | - if (obj.screenshot == "") { | 627 | + if (!obj.screenshot || obj.screenshot == "") { |
626 | this.iframeLoading = false; | 628 | this.iframeLoading = false; |
627 | } | 629 | } |
628 | this.stem.screenshot = obj.screenshot || ""; | 630 | this.stem.screenshot = obj.screenshot || ""; |
629 | this.stem.answerScreenshot = ""; | 631 | this.stem.answerScreenshot = ""; |
630 | } else { | 632 | } else { |
631 | - if (obj.answerScreenshot == "") { | 633 | + if (!obj.answerScreenshot || obj.answerScreenshot == "") { |
632 | this.iframeLoading = false; | 634 | this.iframeLoading = false; |
633 | } | 635 | } |
634 | this.stem.answerScreenshot = obj.answerScreenshot || ""; | 636 | this.stem.answerScreenshot = obj.answerScreenshot || ""; |
@@ -1121,15 +1123,23 @@ export default { | @@ -1121,15 +1123,23 @@ export default { | ||
1121 | } | 1123 | } |
1122 | const { data, status, info } = await fetchSubjectList({ ...query }); | 1124 | const { data, status, info } = await fetchSubjectList({ ...query }); |
1123 | if (status === 0) { | 1125 | if (status === 0) { |
1126 | + let subjectArr = []; | ||
1124 | this.subjectList = | 1127 | this.subjectList = |
1125 | data.subjectNames?.map((item) => { | 1128 | data.subjectNames?.map((item) => { |
1129 | + let subName = | ||
1130 | + this.role == "ROLE_PERSONAL" ? item.subjectName : item; | ||
1131 | + subjectArr.push(subName); | ||
1126 | return { | 1132 | return { |
1127 | - value: this.role == "ROLE_PERSONAL" ? item.subjectName : item, | ||
1128 | - label: this.role == "ROLE_PERSONAL" ? item.subjectName : item, | 1133 | + value: subName, |
1134 | + label: subName, | ||
1129 | }; | 1135 | }; |
1130 | }) || []; | 1136 | }) || []; |
1131 | if (this.subjectList.length) { | 1137 | if (this.subjectList.length) { |
1132 | - this.form.subjectName = this.subjectList[0].value; | 1138 | + if (subjectArr.includes(this.$route.query.subjectName)) { |
1139 | + this.form.subjectName = this.$route.query.subjectName; | ||
1140 | + } else { | ||
1141 | + this.form.subjectName = this.subjectList[0].value; | ||
1142 | + } | ||
1133 | } | 1143 | } |
1134 | } else { | 1144 | } else { |
1135 | this.$message.error(info); | 1145 | this.$message.error(info); |
src/views/examinationPaper/edit.vue
@@ -23,10 +23,7 @@ | @@ -23,10 +23,7 @@ | ||
23 | <p class="totals">卷面总分:{{ allScore }}分</p> | 23 | <p class="totals">卷面总分:{{ allScore }}分</p> |
24 | </div> | 24 | </div> |
25 | <div class="question-box"> | 25 | <div class="question-box"> |
26 | - <ul | ||
27 | - class="questions-ul questions-ul2" | ||
28 | - v-if="!questionList[0]?.subQuestions" | ||
29 | - > | 26 | + <ul class="questions-ul questions-ul2" v-if="examType == 1"> |
30 | <li class="sub-questions"> | 27 | <li class="sub-questions"> |
31 | <div class="qs-num">题号</div> | 28 | <div class="qs-num">题号</div> |
32 | <div class="qs-type">题型</div> | 29 | <div class="qs-type">题型</div> |
@@ -155,9 +152,9 @@ | @@ -155,9 +152,9 @@ | ||
155 | </div> | 152 | </div> |
156 | </li> | 153 | </li> |
157 | </ul> | 154 | </ul> |
158 | - <template v-if="questionList[0]?.subQuestions"> | 155 | + <template v-if="examType == 2"> |
159 | <template v-for="(question, index) in questionList"> | 156 | <template v-for="(question, index) in questionList"> |
160 | - <p class="question-title"> | 157 | + <p class="question-title" v-if="paperType == 2"> |
161 | <span>{{ setBigNum(index) }}、</span> | 158 | <span>{{ setBigNum(index) }}、</span> |
162 | <el-input | 159 | <el-input |
163 | class="ipt" | 160 | class="ipt" |
@@ -167,7 +164,10 @@ | @@ -167,7 +164,10 @@ | ||
167 | ></el-input> | 164 | ></el-input> |
168 | <span>共 {{ setScore(question) }} 分</span> | 165 | <span>共 {{ setScore(question) }} 分</span> |
169 | </p> | 166 | </p> |
170 | - <div class="questions-ul"> | 167 | + <div |
168 | + class="questions-ul" | ||
169 | + :class="paperType == 1 ? 'questions-ul2' : ''" | ||
170 | + > | ||
171 | <div class="sub-questions"> | 171 | <div class="sub-questions"> |
172 | <div class="qs-num">题号</div> | 172 | <div class="qs-num">题号</div> |
173 | <div class="qs-type">题型</div> | 173 | <div class="qs-type">题型</div> |
@@ -195,7 +195,7 @@ | @@ -195,7 +195,7 @@ | ||
195 | > | 195 | > |
196 | </p> | 196 | </p> |
197 | <div v-else class="sub-questions"> | 197 | <div v-else class="sub-questions"> |
198 | - <div class="qs-num">{{ subQuestions.questionIndex }}</div> | 198 | + <div class="qs-num">{{ setNum(index, indexs) }}</div> |
199 | <div class="qs-type"> | 199 | <div class="qs-type"> |
200 | {{ setSubPro(subQuestions.questionType) }} | 200 | {{ setSubPro(subQuestions.questionType) }} |
201 | </div> | 201 | </div> |
@@ -531,6 +531,7 @@ export default { | @@ -531,6 +531,7 @@ export default { | ||
531 | gradeClassList: [], //学段列表 | 531 | gradeClassList: [], //学段列表 |
532 | uploadUrl: "/file/uploadImgToHtml", | 532 | uploadUrl: "/file/uploadImgToHtml", |
533 | iframeLoading: false, | 533 | iframeLoading: false, |
534 | + examType: 2, | ||
534 | }; | 535 | }; |
535 | }, | 536 | }, |
536 | computed: { | 537 | computed: { |
@@ -580,6 +581,7 @@ export default { | @@ -580,6 +581,7 @@ export default { | ||
580 | this.$store.getters.info.showRole || | 581 | this.$store.getters.info.showRole || |
581 | this.$store.getters.info.permissions[0].role; | 582 | this.$store.getters.info.permissions[0].role; |
582 | this.type = this.$route.query.type || 1; | 583 | this.type = this.$route.query.type || 1; |
584 | + this.examType = this.$route.query.examType || 2; | ||
583 | this.paperType = this.$route.query.paperType || 1; | 585 | this.paperType = this.$route.query.paperType || 1; |
584 | this.form.title = this.$route.query.title || ""; | 586 | this.form.title = this.$route.query.title || ""; |
585 | this._QueryDetail(); | 587 | this._QueryDetail(); |
@@ -594,13 +596,13 @@ export default { | @@ -594,13 +596,13 @@ export default { | ||
594 | this.stem.index = index; | 596 | this.stem.index = index; |
595 | this.stem.indexs = indexs; | 597 | this.stem.indexs = indexs; |
596 | if (type == 1) { | 598 | if (type == 1) { |
597 | - if (obj.screenshot == "") { | 599 | + if (!obj.screenshot || obj.screenshot == "") { |
598 | this.iframeLoading = false; | 600 | this.iframeLoading = false; |
599 | } | 601 | } |
600 | this.stem.screenshot = obj.screenshot || ""; | 602 | this.stem.screenshot = obj.screenshot || ""; |
601 | this.stem.answerScreenshot = ""; | 603 | this.stem.answerScreenshot = ""; |
602 | } else { | 604 | } else { |
603 | - if (obj.answerScreenshot == "") { | 605 | + if (!obj.answerScreenshot || obj.answerScreenshot == "") { |
604 | this.iframeLoading = false; | 606 | this.iframeLoading = false; |
605 | } | 607 | } |
606 | this.stem.answerScreenshot = obj.answerScreenshot || ""; | 608 | this.stem.answerScreenshot = obj.answerScreenshot || ""; |
@@ -724,6 +726,23 @@ export default { | @@ -724,6 +726,23 @@ export default { | ||
724 | 726 | ||
725 | return txt; | 727 | return txt; |
726 | }, | 728 | }, |
729 | + //计算题号 | ||
730 | + setNum(index, indexs, sub) { | ||
731 | + let lengths = 0; //所在大题之前的所有小题数量 | ||
732 | + let subIndex = 0; //所在大题的位置 | ||
733 | + for (let i = 0; i < index; i++) { | ||
734 | + let subArr = this.questionList[i].subQuestions.filter((item) => { | ||
735 | + return !!item.questionType; | ||
736 | + }); | ||
737 | + lengths += subArr.length; | ||
738 | + } | ||
739 | + for (let i = 0; i < indexs; i++) { | ||
740 | + if (!!this.questionList[index].subQuestions[i].questionType) { | ||
741 | + subIndex += 1; | ||
742 | + } | ||
743 | + } | ||
744 | + return lengths + subIndex + 1; | ||
745 | + }, | ||
727 | setScore(question) { | 746 | setScore(question) { |
728 | let score = question.subQuestions.reduce((a, b) => { | 747 | let score = question.subQuestions.reduce((a, b) => { |
729 | return a + (b.score || 0); | 748 | return a + (b.score || 0); |
src/views/examinationPaper/index.vue
@@ -414,6 +414,7 @@ export default { | @@ -414,6 +414,7 @@ export default { | ||
414 | ...query, | 414 | ...query, |
415 | listType: this.query.type, | 415 | listType: this.query.type, |
416 | listShare: this.query.share, | 416 | listShare: this.query.share, |
417 | + subjectName: this.query.subjectName, | ||
417 | }, | 418 | }, |
418 | }; | 419 | }; |
419 | this.$router.push(routerItem); | 420 | this.$router.push(routerItem); |
@@ -887,7 +888,7 @@ export default { | @@ -887,7 +888,7 @@ export default { | ||
887 | 888 | ||
888 | .img-box { | 889 | .img-box { |
889 | position: relative; | 890 | position: relative; |
890 | - color: #409EFF; | 891 | + color: #409eff; |
891 | 892 | ||
892 | .img { | 893 | .img { |
893 | position: absolute; | 894 | position: absolute; |