Commit 03cd547e3b4a4852294d543159d5cae550182e92
1 parent
0586b4d7
单体型以及其他类型试卷修改答案逻辑
Showing
8 changed files
with
497 additions
and
157 deletions
src/api/urls/apis.js
src/views/basic/test/analysis.vue
| ... | ... | @@ -2,29 +2,62 @@ |
| 2 | 2 | <div ref="main" class="page-container"> |
| 3 | 3 | <back-box> |
| 4 | 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 | 14 | </template> |
| 8 | 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 | 47 | </div> |
| 15 | 48 | </template> |
| 16 | 49 | |
| 17 | 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 | 55 | export default { |
| 23 | 56 | components: { |
| 24 | 57 | Test, |
| 25 | 58 | MultipleTest, |
| 26 | 59 | MultipleSubTest, |
| 27 | - Contrast | |
| 60 | + Contrast, | |
| 28 | 61 | }, |
| 29 | 62 | data() { |
| 30 | 63 | return { |
| ... | ... | @@ -33,9 +66,10 @@ export default { |
| 33 | 66 | ids: [], |
| 34 | 67 | type: 0, |
| 35 | 68 | classId: "", |
| 36 | - subjectName: '', | |
| 37 | - title: '', | |
| 38 | - score: 0 | |
| 69 | + subjectName: "", | |
| 70 | + title: "", | |
| 71 | + score: 0, | |
| 72 | + examType: 2, | |
| 39 | 73 | }; |
| 40 | 74 | }, |
| 41 | 75 | created() { |
| ... | ... | @@ -43,16 +77,16 @@ export default { |
| 43 | 77 | this.$store.getters.info.showRole || |
| 44 | 78 | this.$store.getters.info.permissions[0].role; |
| 45 | 79 | this.id = this.$route.query.id || ""; |
| 80 | + this.examType = this.$route.query.examType || 2; | |
| 46 | 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 | 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 | 91 | </script> |
| 58 | 92 | <style lang="scss" scoped> |
| ... | ... | @@ -67,8 +101,6 @@ export default { |
| 67 | 101 | &.active { |
| 68 | 102 | overflow: hidden; |
| 69 | 103 | } |
| 70 | - | |
| 71 | - | |
| 72 | 104 | } |
| 73 | 105 | |
| 74 | 106 | .error { |
| ... | ... | @@ -79,7 +111,6 @@ export default { |
| 79 | 111 | padding: 20px 20px 0; |
| 80 | 112 | } |
| 81 | 113 | |
| 82 | - | |
| 83 | 114 | .down { |
| 84 | 115 | padding-top: 20px; |
| 85 | 116 | width: 100%; | ... | ... |
src/views/basic/test/components/test.vue
| ... | ... | @@ -8,47 +8,128 @@ |
| 8 | 8 | }}修改了答案,是否重新记分? |
| 9 | 9 | </p> |
| 10 | 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 | 22 | </div> |
| 14 | 23 | </div> |
| 15 | 24 | <div class="content-header"> |
| 16 | 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 | 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 | 43 | </div> |
| 22 | 44 | <div id="print-content" v-loading="loading"> |
| 23 | 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 | 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 | 125 | <p class="persent"> |
| 46 | 126 | {{ |
| 47 | 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 | 135 | </p> |
| ... | ... | @@ -86,18 +167,22 @@ |
| 86 | 167 | <td> |
| 87 | 168 | {{ |
| 88 | 169 | tr.correctAnswer == 1 |
| 89 | - ? "✓" | |
| 90 | - : tr.correctAnswer == 2 | |
| 170 | + ? "✓" | |
| 171 | + : tr.correctAnswer == 2 | |
| 91 | 172 | ? "✗" |
| 92 | 173 | : tr.correctAnswer |
| 93 | 174 | }} |
| 94 | 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 | 181 | <p class="persent"> |
| 97 | 182 | {{ |
| 98 | 183 | tr.questionType == "5" |
| 99 | - ? "" | |
| 100 | - : tr["option" + index] | |
| 184 | + ? "" | |
| 185 | + : tr["option" + index] | |
| 101 | 186 | ? `${tr["option" + index]}(${tr["persent" + index]})` |
| 102 | 187 | : "" |
| 103 | 188 | }} |
| ... | ... | @@ -121,7 +206,9 @@ |
| 121 | 206 | <span class="hui-s s2">{{ |
| 122 | 207 | examReport.subjectiveAvgScore |
| 123 | 208 | }}</span> |
| 124 | - <span class="hui-s s3">{{ examReport.subjectiveClassScoringRate }}%</span> | |
| 209 | + <span class="hui-s s3" | |
| 210 | + >{{ examReport.subjectiveClassScoringRate }}%</span | |
| 211 | + > | |
| 125 | 212 | </li> |
| 126 | 213 | <li class="hui-li"> |
| 127 | 214 | <span class="hui-s s1">客观题</span> |
| ... | ... | @@ -133,7 +220,9 @@ |
| 133 | 220 | examReport.objectiveLowestScore |
| 134 | 221 | }}</span> |
| 135 | 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 | 226 | </li> |
| 138 | 227 | <li class="hui-li"> |
| 139 | 228 | <span class="hui-s s1">整卷</span> |
| ... | ... | @@ -146,51 +235,176 @@ |
| 146 | 235 | </ul> |
| 147 | 236 | </div> |
| 148 | 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 | 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 | 293 | </el-table-column> |
| 162 | 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 | 308 | </el-table-column> |
| 167 | 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 | 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 | 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 | 356 | </el-table-column> |
| 180 | 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 | 395 | <template slot-scope="scope"> |
| 189 | 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 | 401 | {{ scope.row["answer" + item.id] }} |
| 192 | 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 | 408 | </template> |
| 195 | 409 | </el-table-column> |
| 196 | 410 | </el-table> |
| ... | ... | @@ -198,22 +412,56 @@ |
| 198 | 412 | </div> |
| 199 | 413 | <div class="down"> |
| 200 | 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 | 432 | </div> |
| 205 | 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 | 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 | 447 | </div> |
| 212 | 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 | 465 | <el-form> |
| 218 | 466 | <el-form-item label="低分设置模式:"> |
| 219 | 467 | <el-select v-model="lowRange.type" @change="changeScore"> |
| ... | ... | @@ -223,16 +471,35 @@ |
| 223 | 471 | </el-select> |
| 224 | 472 | </el-form-item> |
| 225 | 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 | 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 | 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 | 494 | </el-form-item> |
| 233 | 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 | 503 | <el-button type="danger" @click="_SavelowRange">保存</el-button> |
| 237 | 504 | <el-button @click="diaMinScore = false">取 消</el-button> |
| 238 | 505 | </div> |
| ... | ... | @@ -240,7 +507,7 @@ |
| 240 | 507 | </div> |
| 241 | 508 | </template> |
| 242 | 509 | <script> |
| 243 | -import ScoreSet from "./scoreSet.vue" | |
| 510 | +import ScoreSet from "./scoreSet.vue"; | |
| 244 | 511 | import { downloadFile, tablePrint } from "@/utils"; |
| 245 | 512 | export default { |
| 246 | 513 | components: { |
| ... | ... | @@ -252,20 +519,22 @@ export default { |
| 252 | 519 | title: String, |
| 253 | 520 | classId: String, |
| 254 | 521 | subjectName: String, |
| 522 | + examType: String, | |
| 255 | 523 | score: { |
| 256 | 524 | type: Number, |
| 257 | - default: 0 | |
| 525 | + default: 0, | |
| 258 | 526 | }, |
| 259 | 527 | }, |
| 260 | 528 | data() { |
| 261 | 529 | return { |
| 262 | - status: 0,// 1:已归档试卷 | |
| 530 | + status: 0, // 1:已归档试卷 | |
| 263 | 531 | tableMaxHeight: 600, |
| 264 | 532 | loading: false, |
| 265 | 533 | exportLoading: false, |
| 266 | 534 | tabList: ["试题分析", "成绩排名", "小题分报表", "作答明细表"], |
| 267 | 535 | type: 0, |
| 268 | - paperModifyLog: { //修改信息 | |
| 536 | + paperModifyLog: { | |
| 537 | + //修改信息 | |
| 269 | 538 | realName: "", |
| 270 | 539 | modifiedTime: "", |
| 271 | 540 | }, |
| ... | ... | @@ -309,7 +578,7 @@ export default { |
| 309 | 578 | |
| 310 | 579 | //导出相关 |
| 311 | 580 | diaShow: false, |
| 312 | - exportStudent: [] | |
| 581 | + exportStudent: [], | |
| 313 | 582 | }; |
| 314 | 583 | }, |
| 315 | 584 | created() { |
| ... | ... | @@ -330,7 +599,7 @@ export default { |
| 330 | 599 | }, |
| 331 | 600 | //关闭设置分数 |
| 332 | 601 | closeScoreSet() { |
| 333 | - this.diaScoreSet = false | |
| 602 | + this.diaScoreSet = false; | |
| 334 | 603 | this._QueryData(); |
| 335 | 604 | }, |
| 336 | 605 | setType(type) { |
| ... | ... | @@ -362,6 +631,7 @@ export default { |
| 362 | 631 | paperId: this.id, |
| 363 | 632 | title: this.title, |
| 364 | 633 | type: 2, |
| 634 | + examType: this.examType, | |
| 365 | 635 | }, |
| 366 | 636 | }); |
| 367 | 637 | }, |
| ... | ... | @@ -386,9 +656,12 @@ export default { |
| 386 | 656 | }, |
| 387 | 657 | // 保存低分设置 |
| 388 | 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 | 663 | this.$message.warning("请补全低分设置!"); |
| 391 | - return | |
| 664 | + return; | |
| 392 | 665 | } |
| 393 | 666 | this.loadingTange = true; |
| 394 | 667 | let { data, status, info } = await this.$request.setLowRange({ |
| ... | ... | @@ -413,9 +686,10 @@ export default { |
| 413 | 686 | async examDetail() { |
| 414 | 687 | //详情 |
| 415 | 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 | 694 | let { data, info, status } = await examDetail({ |
| 421 | 695 | examId: this.id, |
| ... | ... | @@ -444,7 +718,7 @@ export default { |
| 444 | 718 | }); |
| 445 | 719 | this.loading = false; |
| 446 | 720 | if (status === 0) { |
| 447 | - this.$store.commit("setRefreshTestList", true) | |
| 721 | + this.$store.commit("setRefreshTestList", true); | |
| 448 | 722 | this.$message.success(info); |
| 449 | 723 | this._QueryData(); |
| 450 | 724 | this.paperModifyLog.modifiedTime = ""; |
| ... | ... | @@ -456,9 +730,10 @@ export default { |
| 456 | 730 | async examStudentReport() { |
| 457 | 731 | //成绩排名-小题分-作答明细 |
| 458 | 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 | 737 | let { data, info, status } = await examStudentReport({ |
| 463 | 738 | examId: this.id, |
| 464 | 739 | }); |
| ... | ... | @@ -491,7 +766,7 @@ export default { |
| 491 | 766 | this.questionList = optionsList.sort((a, b) => { |
| 492 | 767 | return a.id - b.id; |
| 493 | 768 | }); |
| 494 | - this.exportStudent = [...this.tableData2] | |
| 769 | + this.exportStudent = [...this.tableData2]; | |
| 495 | 770 | } else { |
| 496 | 771 | this.$message.error(info); |
| 497 | 772 | } |
| ... | ... | @@ -499,9 +774,10 @@ export default { |
| 499 | 774 | async examQuestionReport() { |
| 500 | 775 | //试题分析 |
| 501 | 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 | 782 | let { data, info, status } = await examQuestionReport({ |
| 507 | 783 | examId: this.id, |
| ... | ... | @@ -537,8 +813,8 @@ export default { |
| 537 | 813 | ? defaultArr[index]?.option == 1 |
| 538 | 814 | ? "✓" |
| 539 | 815 | : defaultArr[index]?.option == 2 |
| 540 | - ? "✗" | |
| 541 | - : defaultArr[index]?.option | |
| 816 | + ? "✗" | |
| 817 | + : defaultArr[index]?.option | |
| 542 | 818 | : ""; |
| 543 | 819 | items["title"] = "选项" + (index + 1); |
| 544 | 820 | } else { |
| ... | ... | @@ -567,9 +843,10 @@ export default { |
| 567 | 843 | async exportData() { |
| 568 | 844 | if (this.exportLoading == true) return; |
| 569 | 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 | 851 | const data = await exportExamReport({ |
| 575 | 852 | examId: this.id, |
| ... | ... | @@ -624,8 +901,6 @@ div::-webkit-scrollbar-thumb { |
| 624 | 901 | color: #f30; |
| 625 | 902 | } |
| 626 | 903 | |
| 627 | - | |
| 628 | - | |
| 629 | 904 | .tips { |
| 630 | 905 | height: 48px; |
| 631 | 906 | box-sizing: border-box; | ... | ... |
src/views/basic/test/list.vue
| ... | ... | @@ -299,6 +299,7 @@ export default { |
| 299 | 299 | subjectName: obj.subjectName, |
| 300 | 300 | classId: this.query.classId[0], |
| 301 | 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 | 405 | paperId: item.id, |
| 405 | 406 | title: item.title, |
| 406 | 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 | 1260 | this.stem.indexs = indexs; |
| 1261 | 1261 | this.stem.type = type; |
| 1262 | 1262 | if (type == 1) { |
| 1263 | - if (obj.screenshot == "") { | |
| 1263 | + if (!obj.screenshot || obj.screenshot == "") { | |
| 1264 | 1264 | this.iframeLoading = false; |
| 1265 | 1265 | } |
| 1266 | 1266 | this.stem.screenshot = obj.screenshot || ""; |
| 1267 | 1267 | this.stem.answerScreenshot = ""; |
| 1268 | 1268 | } else { |
| 1269 | - if (obj.answerScreenshot == "") { | |
| 1269 | + if (!obj.answerScreenshot || obj.answerScreenshot == "") { | |
| 1270 | 1270 | this.iframeLoading = false; |
| 1271 | 1271 | } |
| 1272 | 1272 | this.stem.answerScreenshot = obj.answerScreenshot || ""; |
| ... | ... | @@ -2044,10 +2044,12 @@ export default { |
| 2044 | 2044 | let subjectArr = []; |
| 2045 | 2045 | this.subjectList = |
| 2046 | 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 | 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 | 2055 | if (this.subjectList.length) { | ... | ... |
src/views/examinationPaper/addQs.vue
| ... | ... | @@ -448,7 +448,7 @@ |
| 448 | 448 | </div> |
| 449 | 449 | </el-dialog> |
| 450 | 450 | </div> |
| 451 | - <div v-show="step == 2"> | |
| 451 | + <div v-if="step == 2"> | |
| 452 | 452 | <div class="answer-title"> |
| 453 | 453 | <p class="name">{{ form.title }}</p> |
| 454 | 454 | </div> |
| ... | ... | @@ -547,6 +547,7 @@ export default { |
| 547 | 547 | listShare: 0, |
| 548 | 548 | uploadUrl: "/file/uploadImgToHtml", |
| 549 | 549 | iframeLoading: false, |
| 550 | + subjectName: "", | |
| 550 | 551 | }; |
| 551 | 552 | }, |
| 552 | 553 | computed: { |
| ... | ... | @@ -588,6 +589,7 @@ export default { |
| 588 | 589 | this.listShare = this.$route.query.listShare |
| 589 | 590 | ? this.$route.query.listShare |
| 590 | 591 | : 0; |
| 592 | + this.subjectName = this.$route.query.subjectName || ""; | |
| 591 | 593 | this.type = this.$route.query.type ? this.$route.query.type : 1; |
| 592 | 594 | this.role = |
| 593 | 595 | this.$store.getters.info.showRole || |
| ... | ... | @@ -622,13 +624,13 @@ export default { |
| 622 | 624 | this.stem.indexs = indexs; |
| 623 | 625 | this.stem.type = type; |
| 624 | 626 | if (type == 1) { |
| 625 | - if (obj.screenshot == "") { | |
| 627 | + if (!obj.screenshot || obj.screenshot == "") { | |
| 626 | 628 | this.iframeLoading = false; |
| 627 | 629 | } |
| 628 | 630 | this.stem.screenshot = obj.screenshot || ""; |
| 629 | 631 | this.stem.answerScreenshot = ""; |
| 630 | 632 | } else { |
| 631 | - if (obj.answerScreenshot == "") { | |
| 633 | + if (!obj.answerScreenshot || obj.answerScreenshot == "") { | |
| 632 | 634 | this.iframeLoading = false; |
| 633 | 635 | } |
| 634 | 636 | this.stem.answerScreenshot = obj.answerScreenshot || ""; |
| ... | ... | @@ -1121,15 +1123,23 @@ export default { |
| 1121 | 1123 | } |
| 1122 | 1124 | const { data, status, info } = await fetchSubjectList({ ...query }); |
| 1123 | 1125 | if (status === 0) { |
| 1126 | + let subjectArr = []; | |
| 1124 | 1127 | this.subjectList = |
| 1125 | 1128 | data.subjectNames?.map((item) => { |
| 1129 | + let subName = | |
| 1130 | + this.role == "ROLE_PERSONAL" ? item.subjectName : item; | |
| 1131 | + subjectArr.push(subName); | |
| 1126 | 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 | 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 | 1144 | } else { |
| 1135 | 1145 | this.$message.error(info); | ... | ... |
src/views/examinationPaper/edit.vue
| ... | ... | @@ -23,10 +23,7 @@ |
| 23 | 23 | <p class="totals">卷面总分:{{ allScore }}分</p> |
| 24 | 24 | </div> |
| 25 | 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 | 27 | <li class="sub-questions"> |
| 31 | 28 | <div class="qs-num">题号</div> |
| 32 | 29 | <div class="qs-type">题型</div> |
| ... | ... | @@ -155,9 +152,9 @@ |
| 155 | 152 | </div> |
| 156 | 153 | </li> |
| 157 | 154 | </ul> |
| 158 | - <template v-if="questionList[0]?.subQuestions"> | |
| 155 | + <template v-if="examType == 2"> | |
| 159 | 156 | <template v-for="(question, index) in questionList"> |
| 160 | - <p class="question-title"> | |
| 157 | + <p class="question-title" v-if="paperType == 2"> | |
| 161 | 158 | <span>{{ setBigNum(index) }}、</span> |
| 162 | 159 | <el-input |
| 163 | 160 | class="ipt" |
| ... | ... | @@ -167,7 +164,10 @@ |
| 167 | 164 | ></el-input> |
| 168 | 165 | <span>共 {{ setScore(question) }} 分</span> |
| 169 | 166 | </p> |
| 170 | - <div class="questions-ul"> | |
| 167 | + <div | |
| 168 | + class="questions-ul" | |
| 169 | + :class="paperType == 1 ? 'questions-ul2' : ''" | |
| 170 | + > | |
| 171 | 171 | <div class="sub-questions"> |
| 172 | 172 | <div class="qs-num">题号</div> |
| 173 | 173 | <div class="qs-type">题型</div> |
| ... | ... | @@ -195,7 +195,7 @@ |
| 195 | 195 | > |
| 196 | 196 | </p> |
| 197 | 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 | 199 | <div class="qs-type"> |
| 200 | 200 | {{ setSubPro(subQuestions.questionType) }} |
| 201 | 201 | </div> |
| ... | ... | @@ -531,6 +531,7 @@ export default { |
| 531 | 531 | gradeClassList: [], //学段列表 |
| 532 | 532 | uploadUrl: "/file/uploadImgToHtml", |
| 533 | 533 | iframeLoading: false, |
| 534 | + examType: 2, | |
| 534 | 535 | }; |
| 535 | 536 | }, |
| 536 | 537 | computed: { |
| ... | ... | @@ -580,6 +581,7 @@ export default { |
| 580 | 581 | this.$store.getters.info.showRole || |
| 581 | 582 | this.$store.getters.info.permissions[0].role; |
| 582 | 583 | this.type = this.$route.query.type || 1; |
| 584 | + this.examType = this.$route.query.examType || 2; | |
| 583 | 585 | this.paperType = this.$route.query.paperType || 1; |
| 584 | 586 | this.form.title = this.$route.query.title || ""; |
| 585 | 587 | this._QueryDetail(); |
| ... | ... | @@ -594,13 +596,13 @@ export default { |
| 594 | 596 | this.stem.index = index; |
| 595 | 597 | this.stem.indexs = indexs; |
| 596 | 598 | if (type == 1) { |
| 597 | - if (obj.screenshot == "") { | |
| 599 | + if (!obj.screenshot || obj.screenshot == "") { | |
| 598 | 600 | this.iframeLoading = false; |
| 599 | 601 | } |
| 600 | 602 | this.stem.screenshot = obj.screenshot || ""; |
| 601 | 603 | this.stem.answerScreenshot = ""; |
| 602 | 604 | } else { |
| 603 | - if (obj.answerScreenshot == "") { | |
| 605 | + if (!obj.answerScreenshot || obj.answerScreenshot == "") { | |
| 604 | 606 | this.iframeLoading = false; |
| 605 | 607 | } |
| 606 | 608 | this.stem.answerScreenshot = obj.answerScreenshot || ""; |
| ... | ... | @@ -724,6 +726,23 @@ export default { |
| 724 | 726 | |
| 725 | 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 | 746 | setScore(question) { |
| 728 | 747 | let score = question.subQuestions.reduce((a, b) => { |
| 729 | 748 | return a + (b.score || 0); | ... | ... |
src/views/examinationPaper/index.vue
| ... | ... | @@ -414,6 +414,7 @@ export default { |
| 414 | 414 | ...query, |
| 415 | 415 | listType: this.query.type, |
| 416 | 416 | listShare: this.query.share, |
| 417 | + subjectName: this.query.subjectName, | |
| 417 | 418 | }, |
| 418 | 419 | }; |
| 419 | 420 | this.$router.push(routerItem); |
| ... | ... | @@ -887,7 +888,7 @@ export default { |
| 887 | 888 | |
| 888 | 889 | .img-box { |
| 889 | 890 | position: relative; |
| 890 | - color: #409EFF; | |
| 891 | + color: #409eff; | |
| 891 | 892 | |
| 892 | 893 | .img { |
| 893 | 894 | position: absolute; | ... | ... |