Commit 22095aba9f533ef1f735f447efe7680c6887d922

Authored by 梁保满
1 parent c6f2a550

接口联调

src/api/apis/apis.js
... ... @@ -1675,7 +1675,8 @@ export default {
1675 1675 return service({
1676 1676 url: setUpUrls.scoreTemplate,
1677 1677 method: "POST",
1678   - data
  1678 + data,
  1679 + responseType: 'arraybuffer',
1679 1680 });
1680 1681 },
1681 1682 // 导入即时测报表分数
... ...
src/components/charts/lineChart.vue
... ... @@ -9,7 +9,8 @@ export default {
9 9 id: String,
10 10 params: Array,
11 11 xAxis: Array,
12   - colors: Array
  12 + colors: Array,
  13 + formatterYAxis: true
13 14 },
14 15 watch: {
15 16 params: {
... ... @@ -67,7 +68,7 @@ export default {
67 68 axisLabel: {
68 69 color: "#666",
69 70 formatter: function (name) {
70   - return name + "%"
  71 + return that.formatterYAxis ? `${name} %` : name
71 72 },
72 73 },
73 74 },
... ...
src/components/charts/radarChart.vue
... ... @@ -57,8 +57,8 @@ export default {
57 57 radar: {
58 58 indicator: [...that.params.indicator],
59 59 splitNumber: 5,
60   - center: ['50%', '48%'],
61   - radius: "80%",
  60 + center: ['50%', '65%'],
  61 + radius: "90%",
62 62 shape: "polygon",
63 63 nameGap: 6,
64 64 axisLine: {
... ...
src/components/exportDia.vue
1 1 <template>
2 2 <div>
3   - <el-dialog :close-on-click-modal="false" :visible.sync="diaShow" width="360px">
  3 + <el-dialog :close-on-click-modal="false" :visible.sync="diaShow" width="360px" :show-close="false">
  4 + <i class="el-icon-close" @click="closeDia"></i>
4 5 <div v-show="exportType == 1">
5 6 <div class="down-item">
6 7 <p class="tit">是否将学生表现折线图一起导出</p>
... ... @@ -22,9 +23,12 @@
22 23 <el-table :data="exportStudent" @selection-change="handleSelectionChange" :max-height="300">
23 24 <el-table-column type="selection"></el-table-column>
24 25 <el-table-column prop="studentName" label="姓名" align="center"></el-table-column>
25   - <el-table-column prop="classRank" label="班名" align="center"></el-table-column>
  26 + <el-table-column label="班名" align="center">
  27 + <template slot-scope="scoped">{{
  28 + scoped.row.classRank || scoped.row.rank }}</template>
  29 + </el-table-column>
26 30 <el-table-column prop="correctRate" label="总正确率" align="center"><template slot-scope="scoped">{{
27   - scoped.row.correctRate }}%</template></el-table-column>
  31 + scoped.row.correctRate|| scoped.row.scoringRate }}%</template></el-table-column>
28 32 </el-table>
29 33 </ul>
30 34 <div class="dialog-footer" slot="footer">
... ... @@ -50,11 +54,15 @@ export default {
50 54 }
51 55 },
52 56 watch: {
53   - diaShow: function (nVal) {
54   - if (nVal) {
55   - this.downType = 1
56   - }
  57 + diaShow: {
  58 + handler: function (nVal) {
  59 + if (nVal) {
  60 + this.downType = 1
  61 + }
  62 + },
  63 + immediate: true
57 64 }
  65 +
58 66 },
59 67 methods: {
60 68 changeDownType() {
... ... @@ -82,7 +90,23 @@ export default {
82 90 } else {
83 91 this.$emit('cancel')
84 92 }
  93 + },
  94 + closeDia() {
  95 + this.$emit('cancel')
  96 + this.exportType = 1
85 97 }
86 98 }
87 99 }
88   -</script>
89 100 \ No newline at end of file
  101 +</script>
  102 +<style lang="scss" scoped>
  103 +.el-dialog__wrapper {
  104 + :deep(.el-icon-close) {
  105 + position: absolute;
  106 + right: 2px;
  107 + top: 5px;
  108 + font-size: 18px;
  109 + padding: 5px;
  110 + cursor: pointer;
  111 + }
  112 +}
  113 +</style>
90 114 \ No newline at end of file
... ...
src/views/basic/ask/analysis.vue
... ... @@ -18,7 +18,7 @@
18 18 <!-- 学生答题情况 -->
19 19 <Example v-if="type == 1" :types="types" :tableData="tableData" />
20 20 <!-- 学生问答 -->
21   - <AnswerQustion v-if="type == 2" :types="types" :tableData="tableData" />
  21 + <AnswerQustion v-if="type == 2" :types="types" :tableData="tableData" :subjectNames="subjectNames" />
22 22 <!-- 学生互动表现 -->
23 23 <Interact v-if="type == 3" :types="types" :tableData="tableData" />
24 24 <!-- 签到明细 -->
... ... @@ -55,6 +55,8 @@ export default {
55 55 return {
56 56 role: "",
57 57 loading: false,
  58 + classId: "",
  59 + subjectNames: "",
58 60 id: [],
59 61 type: 1,
60 62 tabList: [],
... ... @@ -74,6 +76,10 @@ export default {
74 76 this.$store.getters.info.showRole ||
75 77 this.$store.getters.info.permissions[0].role;
76 78 this.types = Number(this.$route.query.types)
  79 + const queryData = JSON.parse(this.$route.query.params)
  80 + this.classId = queryData.classId
  81 + console.log(this.$route.query)
  82 + this.subjectNames = this.$route.query.subjectNames.split(',')
77 83 if (this.types == 1) {
78 84 this.tabList = [{ name: "答题表现", value: 1 },
79 85 { name: "学生问答表现", value: 2 },
... ... @@ -88,6 +94,7 @@ export default {
88 94 { name: "学生问答表现", value: 2 },
89 95 { name: "学生互动表现", value: 3 }]
90 96 }
  97 + this.type = this.tabList[0].value
91 98 this.id = JSON.parse(this.$route.query.id)
92 99 this.status = this.$route.query.status ? this.$route.query.status : 0;
93 100 this._QueryData();
... ... @@ -105,7 +112,6 @@ export default {
105 112 this.type = type;
106 113 this.page = 1;
107 114 this._QueryData();
108   - this._QueryDataQuestionRank()
109 115 },
110 116 setDuration(times) {
111 117 let m = parseInt(times / 1000 / 60);
... ... @@ -134,7 +140,7 @@ export default {
134 140 this.$request.pPeriodDetail :
135 141 this.$request.periodDetail;
136 142 let { data, info, status } = await periodDetail({
137   - periodId: this.id[0],
  143 + periodIds: this.id,
138 144 });
139 145 if (status == 0) {
140 146 this.detail = { ...data };
... ... @@ -157,7 +163,8 @@ export default {
157 163 query.size = this.size
158 164 queryData = this.type == 1
159 165 ? this.$request.pPeriodQuestionReport
160   - : this.$request.pPeriodStudentReport
  166 + : this.$request.pPeriodStudentReport;
  167 +
161 168 }
162 169 else if (this.types == 2) {
163 170 queryData = this.type == 1
... ... @@ -172,7 +179,7 @@ export default {
172 179 query.size = this.size
173 180 queryData = this.type == 1
174 181 ? this.$request.periodQuestionReport
175   - : this.$request.periodStudentReport
  182 + : this.$request.periodStudentReport;
176 183 } else if (this.types == 2) {
177 184 queryData = this.type == 1
178 185 ? this.$request.periodQuestionReport
... ... @@ -183,11 +190,13 @@ export default {
183 190 }
184 191 if (this.types == 1) {
185 192 query.type = this.type - 1
  193 + } else if (this.types == 3) {
  194 + query.subjectNames = this.subjectNames
186 195 }
187 196 this.loading = true;
188 197 let { data, info, status } = await queryData({
189   - // periodId: this.id,
190   - periodId: this.id[0],
  198 + periodIds: this.id,
  199 + classId: this.classId,
191 200 ...query,
192 201 });
193 202 this.loading = false;
... ... @@ -206,43 +215,31 @@ export default {
206 215 },
207 216 async _QueryDataQuestionRank() {
208 217 let queryData;
209   - if (this.role == "ROLE_PERSONAL") {
210   - if (this.types == 1) {
  218 + let query = {};
  219 + if (this.types == 1) {
  220 + if (this.role == "ROLE_PERSONAL") {
211 221 queryData = this.$request.pPeriodStudentReport
212   - }
213   - else if (this.types == 2) {
214   - queryData = this.type == 1
215   - ? this.$request.pPeriodStudentReport
216   - : this.type == 2 ? this.$request.phaseAnswerReport : this.$request.phaseInteractiveReport;
217   - } else if (this.types == 3) {
218   - this.type == 2 ? this.$request.pPhaseAnswerReport : this.$request.pPhaseInteractiveReport;
219   - }
220   - } else {
221   - if (this.types == 1) {
  222 + } else {
222 223 queryData = this.$request.periodStudentReport
223   - } else if (this.types == 2) {
224   - queryData = this.type == 1
225   - ? this.$request.periodStudentReport
226   - : this.type == 2 ? this.$request.phaseAnswerReport : this.$request.phaseInteractiveReport;
227   - } else if (this.types == 3) {
228   - queryData = this.type == 2 ? this.$request.cTPhaseAnswerReport : this.$request.cTPhaseInteractiveReport;
229 224 }
230   - }
231   -
232   - let query = {};
233   - if (this.types == 1) {
234 225 query.type = this.type - 1
  226 + } else if (this.types == 2) {
  227 + queryData = this.$request.phaseAnswerReport
  228 + } else if (this.types == 3) {
  229 + queryData = this.$request.cTPhaseAnswerReport
  230 + }
  231 + if (this.types != 1) {
  232 + query.classId = this.classId
235 233 }
236 234 this.loading = true;
237 235 let { data, info, status } = await queryData({
238   - // periodId: this.id,
239   - periodId: this.id[0],
  236 + periodIds: this.id,
240 237 onlyRate: true,
241 238 ...query,
242 239 });
243 240 this.loading = false;
244 241 if (status === 0) {
245   - this.exportStudent = [...data?.list] || []
  242 + this.exportStudent = data?.list && [...data?.list] || []
246 243 } else {
247 244 this.$message.error(info);
248 245 }
... ... @@ -266,8 +263,7 @@ export default {
266 263 query.studentIds = studentIds
267 264 }
268 265 const data = await this.$request.exportPeriodReport({
269   - // periodId: this.id,
270   - periodId: this.id[0],
  266 + periodIds: this.id,
271 267 ...query
272 268 });
273 269 this.exportLoading = false;
... ...
src/views/basic/ask/components/answerQustion.vue
1 1 <template>
2   - <el-table :data="resultData" border style="width: 100%">
3   - <el-table-column prop="studentCode" label="学号" align="center"></el-table-column>
4   - <el-table-column prop="studentName" label="姓名" align="center"></el-table-column>
5   - <template v-if="types == 1">
6   - <el-table-column prop="answerTimes" label="答题次数" align="center"></el-table-column>
7   - <el-table-column prop="consumingDuration" label="答题耗时" align="center"><template slot-scope="scoped">{{
8   - setDuration(scoped.row.consumingDuration)
9   - }}</template></el-table-column>
10   - <el-table-column prop="correctAnswerTimes" label="答对次数" align="center"></el-table-column>
11   - <el-table-column prop="participationRate" label="参与度" sortable align="center"><template slot-scope="scoped">{{
12   - scoped.row.participationRate }}%</template></el-table-column>
13   - <el-table-column prop="correctRate" label="正确率" sortable align="center"><template slot-scope="scoped">{{
14   - scoped.row.correctRate }}%</template></el-table-column>
15   - <el-table-column prop="answerCorrectRate" label="已答正确率" sortable align="center"><template slot-scope="scoped">{{
16   - scoped.row.answerCorrectRate }}%</template></el-table-column>
17   - <el-table-column v-for="(item, index) in optionsList" :key="index" :label="'Q' + (index + 1)"
18   - align="center"><template slot-scope="scoped">
19   - <span :class="scoped.row['isRight' + index] ? '' : 'red'">{{
20   - scoped.row["answer" + index]
21   - }}</span>
22   - </template>
23   - </el-table-column>
24   - </template>
25   - <template v-if="types == 2">
26   - <el-table-column prop="answerTimes" label="累计答题次数" align="center"></el-table-column>
27   - <el-table-column prop="correctAnswerTimes" label="累计答对次数" align="center"></el-table-column>
28   - <el-table-column prop="participationRate" label="总参与度" align="center"><template slot-scope="scoped">{{
29   - scoped.row.participationRate }}%</template></el-table-column>
30   -
31   - <el-table-column prop="participationRateRank" label="总参与度班名" align="center"></el-table-column>
32   - <el-table-column prop="correctRate" label="总正确率" align="center"><template slot-scope="scoped">{{
33   - scoped.row.correctRate }}%</template></el-table-column>
34   - <el-table-column prop="correctRateRank" label="总正确率班名" sortable align="center"></el-table-column>
35   - <el-table-column prop="answerCorrectRate" label="已答正确率" align="center"><template slot-scope="scoped">{{
36   - scoped.row.answerCorrectRate }}%</template></el-table-column>
37   - <el-table-column label="查看折线图" align="center">
38   - <template slot-scope="scoped"><el-button icon="el-icon-right" type="primary" circle></el-button></template>
39   - </el-table-column>
40   - </template>
41   - <template v-if="types == 3">
42   - <el-table-column v-for="(item, index) in phaseOption" :key="index" :label="item" align="center">
43   - <el-table-column align="center" :label="index == 0 ? '总课时数' : '课时数'" :prop="'periodCount' + item">
  2 + <div>
  3 + <el-table :data="resultData" border style="width: 100%">
  4 + <el-table-column prop="studentCode" label="学号" align="center"></el-table-column>
  5 + <el-table-column prop="studentName" label="姓名" align="center"></el-table-column>
  6 + <template v-if="types == 1">
  7 + <el-table-column prop="answerTimes" label="答题次数" align="center"></el-table-column>
  8 + <el-table-column prop="consumingDuration" label="答题耗时" align="center"><template slot-scope="scoped">{{
  9 + setDuration(scoped.row.consumingDuration)
  10 + }}</template></el-table-column>
  11 + <el-table-column prop="correctAnswerTimes" label="答对次数" align="center"></el-table-column>
  12 + <el-table-column prop="participationRate" label="参与度" sortable align="center"><template slot-scope="scoped">{{
  13 + scoped.row.participationRate }}%</template></el-table-column>
  14 + <el-table-column prop="correctRate" label="正确率" sortable align="center"><template slot-scope="scoped">{{
  15 + scoped.row.correctRate }}%</template></el-table-column>
  16 + <el-table-column prop="answerCorrectRate" label="已答正确率" sortable align="center"><template slot-scope="scoped">{{
  17 + scoped.row.answerCorrectRate }}%</template></el-table-column>
  18 + <el-table-column v-for="(item, index) in optionsList" :key="index" :label="'Q' + (index + 1)"
  19 + align="center"><template slot-scope="scoped">
  20 + <span :class="scoped.row['isRight' + index] ? '' : 'red'">{{
  21 + scoped.row["answer" + index]
  22 + }}</span>
  23 + </template>
44 24 </el-table-column>
45   - <el-table-column align="center" :label="index == 0 ? '总出题数' : '出题数'" :prop="'questionNum' + item">
  25 + </template>
  26 + <template v-if="types == 2">
  27 + <el-table-column prop="answerTimes" label="累计答题次数" align="center"></el-table-column>
  28 + <el-table-column prop="correctAnswerTimes" label="累计答对次数" align="center"></el-table-column>
  29 + <el-table-column prop="participationRate" label="总参与度" align="center"><template slot-scope="scoped">{{
  30 + scoped.row.participationRate }}%</template></el-table-column>
  31 +
  32 + <el-table-column prop="participationRateRank" label="总参与度班名" align="center"></el-table-column>
  33 + <el-table-column prop="correctRate" label="总正确率" align="center"><template slot-scope="scoped">{{
  34 + scoped.row.correctRate }}%</template></el-table-column>
  35 + <el-table-column prop="correctRateRank" label="总正确率班名" sortable align="center"></el-table-column>
  36 + <el-table-column prop="answerCorrectRate" label="已答正确率" align="center"><template slot-scope="scoped">{{
  37 + scoped.row.answerCorrectRate }}%</template></el-table-column>
  38 + <el-table-column label="查看折线图" align="center">
  39 + <template slot-scope="scoped">
  40 + <el-button @click="openLineChart(scoped.row)" type="primary" size="mini" circle
  41 + icon="el-icon-arrow-right"></el-button></template>
46 42 </el-table-column>
47   - <el-table-column align="center" :label="index == 0 ? '总参与度' : '参与度'" :prop="'participationRate' + item"><template
48   - slot-scope="scoped">{{ scoped.row["participationRate" + item] }}%</template>
  43 + </template>
  44 + <template v-if="types == 3">
  45 + <el-table-column v-for="(item, index) in phaseOption" :key="index" :label="item" align="center">
  46 + <el-table-column align="center" :label="index == 0 ? '总课时数' : '课时数'" :prop="'periodCount' + item">
  47 + </el-table-column>
  48 + <el-table-column align="center" :label="index == 0 ? '总出题数' : '出题数'" :prop="'questionNum' + item">
  49 + </el-table-column>
  50 + <el-table-column align="center" :label="index == 0 ? '总参与度' : '参与度'"
  51 + :prop="'participationRate' + item"><template slot-scope="scoped">{{ scoped.row["participationRate" + item]
  52 + }}%</template>
  53 + </el-table-column>
  54 + <el-table-column align="center" :label="index == 0 ? '总正确率' : '正确率'" :prop="'correctRate' + item"><template
  55 + slot-scope="scoped">{{ scoped.row["correctRate" + item] }}%</template>
  56 + </el-table-column>
49 57 </el-table-column>
50   - <el-table-column align="center" :label="index == 0 ? '总正确率' : '正确率'" :prop="'correctRate' + item"><template
51   - slot-scope="scoped">{{ scoped.row["correctRate" + item] }}%</template>
  58 + <el-table-column label="查看雷达图" align="center">
  59 + <template slot-scope="scoped">
  60 + <el-button @click="openRandarChart(scoped.row)" type="primary" size="mini" circle
  61 + icon="el-icon-arrow-right"></el-button></template>
52 62 </el-table-column>
53   - </el-table-column>
54   - </template>
55   - </el-table>
  63 + </template>
  64 + </el-table>
  65 + <el-dialog class="chart-dia" :visible.sync="chartDia" :title="chartTitle" width="800">
  66 + <div class="chart-box">
  67 + <LineChart v-if="types == 2" id="askLineChart" :params="chartData" :xAxis="xAxis" />
  68 + <RadarChart v-if="types == 3" id="askRadarChart" :params="chartData" />
  69 + </div>
  70 + </el-dialog>
  71 + </div>
56 72 </template>
57 73 <script>
  74 +import LineChart from "@/components/charts/lineChart"
  75 +import RadarChart from "@/components/charts/radarChart"
58 76 export default {
  77 + components: {
  78 + LineChart,
  79 + RadarChart
  80 + },
59 81 props: {
60 82 tableData: Array,
61 83 types: Number,
  84 + subjectNames: Array,
62 85 },
63 86 data() {
64 87 return {
65 88 optionsList: [],
66 89 phaseOption: [], //问答补充数据
  90 +
  91 + //折线图
  92 + chartDia: false,
  93 + chartTitle: "",
  94 + xAxis: [],
  95 + chartData: [],
67 96 };
68 97 },
69 98 computed: {
... ... @@ -145,6 +174,23 @@ export default {
145 174 return resultData
146 175 }
147 176 },
  177 + created() {RadarChart
  178 + if (this.types == 3) {
  179 + this.chartData = {
  180 + indicator: [
  181 + {
  182 + name: '', max: 100,
  183 + axisLabel: {
  184 + show: true,
  185 + showMaxLabel: true,
  186 + formatter: '{value}%'
  187 + },
  188 + },
  189 + ],
  190 + seriesData: []
  191 + }
  192 + }
  193 + },
148 194 methods: {
149 195 setDuration(times) {
150 196 if (times) {
... ... @@ -166,11 +212,84 @@ export default {
166 212 return aTime;
167 213 }
168 214 },
  215 + //查看折线图
  216 + openLineChart(obj) {
  217 + this.chartTitle = `${obj.studentName}-${this.subjectNames[0]}-多课时作答表现图`
  218 + this.chartDia = true
  219 + let participationRate = []
  220 + let correctRate = []
  221 + let answerCorrectRate = []
  222 + this.xAxis = obj.dataList.map(item => {
  223 + participationRate.push(item.participationRate)
  224 + correctRate.push(item.correctRate)
  225 + answerCorrectRate.push(item.answerCorrectRate)
  226 + return item.name
  227 + })
  228 + this.chartData = [
  229 + {
  230 + name: "参与度",
  231 + value: participationRate
  232 + },
  233 + {
  234 + name: "正确率",
  235 + value: correctRate
  236 + },
  237 + {
  238 + name: "已答正确率",
  239 + value: answerCorrectRate
  240 + },
  241 + ]
  242 +
  243 + },
  244 + openRandarChart(obj) {
  245 + this.chartTitle = obj.studentName + '-多科-多课时作答表现图'
  246 + let subjectList = obj.dataList.map(item => item.subjectName)
  247 + subjectList.map((item, index) => {
  248 + if (index < 1) {
  249 + this.chartData.indicator[index].name = item
  250 + } else {
  251 + this.chartData.indicator.push({ name: item, max: 100 })
  252 + }
  253 + })
  254 + // 为了美观
  255 + if (this.chartData.indicator.length < 3) {
  256 + let num = this.chartData.indicator.length
  257 + for (let i = 0; i < 6; i++) {
  258 + if (i >= num) {
  259 + this.chartData.indicator.push({ name: "", max: 100 })
  260 + }
  261 + }
  262 + }
  263 + this.chartData.seriesData = [
  264 + {
  265 + value: obj.dataList.map(item => item.participationRate),
  266 + name: '参与度'
  267 + },
  268 + {
  269 + value: obj.dataList.map(item => item.correctRate),
  270 + name: '正确率'
  271 + },
  272 + ]
  273 + this.chartDia = true
  274 +
  275 +
  276 + },
169 277 }
170 278 };
171 279 </script>
172   -<style>
  280 +<style lang="scss">
173 281 .red {
174 282 color: #f30;
175 283 }
  284 +
  285 +.chart-dia {
  286 + .chart-box {
  287 + width: 100%;
  288 + height: 300px;
  289 + }
  290 +
  291 + :deep(.el-dialog__body) {
  292 + padding: 0 0 20px 0;
  293 + }
  294 +}
176 295 </style>
... ...
src/views/basic/ask/list.vue
... ... @@ -34,7 +34,7 @@
34 34 <el-table-column label="操作" align="center" width="100">
35 35 <template slot-scope="scoped">
36 36 <template v-if="scoped.row.answerNum == 0">
37   - <el-tooltip v-if="role == 'ROLE_JIAOSHI'" effect="dark" content="设置答案" placement="top">
  37 + <el-tooltip v-if="role != 'ROLE_BANZHUREN'" effect="dark" content="设置答案" placement="top">
38 38 <el-button type="primary" circle size="mini" icon="fa fa-file-text"
39 39 @click="edit(scoped.row)"></el-button>
40 40 </el-tooltip>
... ... @@ -136,18 +136,19 @@ export default {
136 136 query: {
137 137 id: JSON.stringify([obj.id]),
138 138 types: types,
139   - params: this.$route.query.params
  139 + params: this.$route.query.params,
140 140 },
141 141 });
142 142 },
143 143 //去详情
144 144 linkToDetail2() {
145   - if (this.multipleSelection.length == 0) {
  145 + if (this.multipleSelection.length == 0) {
146 146 this.$message.warning("未选择课时,请选择~")
147   - return }
  147 + return
  148 + }
148 149 let subjectArr = []
149 150 const ids = this.multipleSelection.map(item => {
150   - subjectArr.push(item.subject)
  151 + subjectArr.push(item.subjectName)
151 152 return item.id
152 153 })
153 154 subjectArr = [...new Set(subjectArr)]
... ... @@ -156,7 +157,8 @@ export default {
156 157 query: {
157 158 id: JSON.stringify(ids),
158 159 types: this.multipleSelection.length == 1 ? 1 : subjectArr.length == 1 ? 2 : 3,
159   - params: this.$route.query.params
  160 + subjectNames: subjectArr.join(','),
  161 + params: this.$route.query.params,
160 162 },
161 163 });
162 164 },
... ...
src/views/basic/test/analysis.vue
... ... @@ -41,7 +41,7 @@ export default {
41 41 this.$store.getters.info.showRole ||
42 42 this.$store.getters.info.permissions[0].role;
43 43 this.id = this.$route.query.id || "";
44   - this.ids = this.$route.query.ids && this.$route.query.ids.split() || "";
  44 + this.ids = this.$route.query.ids && this.$route.query.ids.split(",") || "";
45 45 this.type = this.$route.query.type
46 46 this.classId = this.$route.query.classId || "";
47 47 this.title = this.$route.query.title || ""
... ...
src/views/basic/test/components/multipleSubTest.vue
... ... @@ -20,7 +20,7 @@
20 20 <el-table-column :prop="'classRank' + item" label="班名" align="center"
21 21 :class-name="index % 2 == 0 ? 'bg' : ''"></el-table-column>
22 22 </el-table-column>
23   - <el-table-column label="查看折线图" align="center">
  23 + <el-table-column label="查看雷达图" align="center">
24 24 <template slot-scope="scoped">
25 25 <el-button @click="openChart(scoped.row)" type="primary" size="mini" circle
26 26 icon="el-icon-arrow-right"></el-button>
... ... @@ -52,8 +52,8 @@ export default {
52 52 props: {
53 53 role: "",
54 54 ids: Array,
55   - classId: String,
56   - subjectName: String,
  55 + classIds: Array,
  56 + subjectNames: Array,
57 57 },
58 58 data() {
59 59 return {
... ... @@ -69,7 +69,6 @@ export default {
69 69 axisLabel: {
70 70 show: true,
71 71 showMaxLabel: true,
72   - formatter: '{value}%'
73 72 },
74 73 },
75 74 ],
... ... @@ -134,7 +133,7 @@ export default {
134 133 },
135 134 });
136 135 },
137   - //查看折线
  136 + //查看雷达
138 137 openChart(obj) {
139 138 this.chartTitle = obj.studentName + '-多科-多课时作答表现图'
140 139 let subjectList = obj.dataList.map(item => item.subjectName)
... ... @@ -156,12 +155,16 @@ export default {
156 155 }
157 156 this.chartData.seriesData = [
158 157 {
159   - value: obj.dataList.map(item => item.participationRate),
160   - name: '参与度'
  158 + value: obj.dataList.map(item => item.highestScore),
  159 + name: '班级最高分'
161 160 },
162 161 {
163   - value: obj.dataList.map(item => item.correctRate),
164   - name: '正确率'
  162 + value: obj.dataList.map(item => item.avgScore),
  163 + name: '班平均分'
  164 + },
  165 + {
  166 + value: obj.dataList.map(item => item.score),
  167 + name: '本人得分'
165 168 },
166 169 ]
167 170 this.chartDia = true
... ... @@ -171,7 +174,7 @@ export default {
171 174 async phaseExamReport() {
172 175 this.loading = true;
173 176 const { data, status, info } = await this.$request.cTPhaseExamReport({
174   - classId: this.classId,
  177 + classIds: this.classId.split(','),
175 178 examIds: this.ids,
176 179 subjectNames: this.subjectList,
177 180 });
... ...
src/views/basic/test/components/multipleTest.vue
... ... @@ -28,7 +28,7 @@
28 28 </div>
29 29 <el-dialog class="chart-dia" :visible.sync="chartDia" :title="chartTitle" width="800">
30 30 <div class="chart-box">
31   - <LineChart id="lineChart" :params="chartData" :xAxis="xAxis" />
  31 + <LineChart id="lineChart" :params="chartData" :xAxis="xAxis" :formatterYAxis="false" />
32 32 </div>
33 33 </el-dialog>
34 34 <ExportDia :exportStudent="exportStudent" :diaShow="diaShow" @cancel="cancel" @exportData="exportData" />
... ... @@ -118,27 +118,27 @@ export default {
118 118 openChart(obj) {
119 119 this.studentName = obj.studentName
120 120 this.chartDia = true
121   - let participationRate = []
122   - let correctRate = []
123   - let answerCorrectRate = []
  121 + let score = []
  122 + let classRank = []
  123 + let avgScore = []
124 124 this.xAxis = obj.examList.map(item => {
125   - participationRate.push(item.participationRate)
126   - correctRate.push(item.correctRate)
127   - answerCorrectRate.push(item.answerCorrectRate)
  125 + score.push(item.score)
  126 + classRank.push(item.classRank)
  127 + avgScore.push(item.avgScore)
128 128 return item.title
129 129 })
130 130 this.chartData = [
131 131 {
132   - name: "参与度",
133   - value: participationRate
  132 + name: "班级排名",
  133 + value: classRank
134 134 },
135 135 {
136   - name: "正确率",
137   - value: correctRate
  136 + name: "班平均分",
  137 + value: avgScore
138 138 },
139 139 {
140   - name: "已答正确率",
141   - value: answerCorrectRate
  140 + name: "个人成绩",
  141 + value: score
142 142 },
143 143 ]
144 144  
... ...
src/views/basic/test/components/scoreSet.vue
1 1 <template>
2   - <div class="set-container">
  2 + <div class="set-container" ref="scoreSet" v-loading="loading">
3 3 <div class="back">
4 4 <div class="back-l" @click="closeScoreSet">
5 5 <i class="fa fa-mail-reply-all"></i>
... ... @@ -8,30 +8,26 @@
8 8 </div>
9 9 <div class="set-content">
10 10 <div class="test-title">
11   - <el-button class="import-btn" type="primary" round @click="diaUp = true">从excel文件导入</el-button>
  11 + <el-button class="import-btn" round @click="diaUp = true">从excel文件导入</el-button>
  12 + <el-button class="save-btn" type="primary" round :loading="loadingSave" @click="_SubmitScore">保存</el-button>
12 13 <p class="p1">{{ title }}</p>
13 14 <p class="p2">卷面总分:{{ examScore }}分</p>
14 15 </div>
15   - <el-table :data="tableData" border style="width: 100%">
  16 + <el-table :data="tableData" border style="width: 100%" :max-height="tableMaxHeight">
16 17 <el-table-column prop="studentCode" label="学号" align="center" fixed></el-table-column>
17 18 <el-table-column prop="studentName" label="学号" align="center" fixed></el-table-column>
18   - <el-table-column label="总得分" align="center" fixed></el-table-column>
19   - <el-table-column label="客观题分" align="center"></el-table-column>
20   - <el-table-column label="主观题分" align="center"></el-table-column>
21   - <el-table-column v-for="(item, index) in questionList" :key="index" :label="'第' + cNum[index] + '大题'"
22   - align="center">
23   - <el-table-column prop="score" v-for="(question, indexs) in item.subQuestions" :label="'Q' + question.id"
24   - align="center">
25   - <template slot-scope="scoped">
26   - <el-input type="number" :min="0"
27   - v-model="scoped.row.questionList[index].subQuestions[indexs].score"></el-input>
28   - </template>
29   - </el-table-column>
  19 + <el-table-column prop="score" label="总得分" align="center" fixed></el-table-column>
  20 + <el-table-column prop="objectiveScore" label="客观题分" align="center"></el-table-column>
  21 + <el-table-column prop="subjectiveScore" label="主观题分" align="center"></el-table-column>
  22 + <!-- <el-table-column v-for="(item, index) in questionList" :key="index" :label="'第' + cNum[index] + '大题'" -->
  23 + <el-table-column v-for="question in questionList" :label="'Q' + question.questionId" align="center">
  24 + <template slot-scope="scoped">
  25 + <el-input type="number" :min="0" :max="question.questionScore"
  26 + @input="setScore($event, question.questionScore, scoped.row.scoreMap, question.questionId)"
  27 + v-model="scoped.row.scoreMap[question.questionId]"></el-input>
  28 + </template>
30 29 </el-table-column>
31 30 </el-table>
32   - <p class="btn-box">
33   - <el-button type="primary" :loading="loadingSave" @click="_SubmitScore">保存</el-button>
34   - </p>
35 31 </div>
36 32  
37 33 <el-dialog :close-on-click-modal="false" :append-to-body="true" title="答卷录分" :visible.sync="diaUp" width="600px"
... ... @@ -61,6 +57,7 @@ export default {
61 57 type: Number,
62 58 default: 0
63 59 },
  60 + diaScoreSet: false
64 61 },
65 62 data() {
66 63 return {
... ... @@ -71,23 +68,31 @@ export default {
71 68 url: "/api_html/teaching/importScore",
72 69 tableData: [],
73 70 questionList: [],
74   - cNum: cNum
  71 + cNum: cNum,
  72 + tableMaxHeight: 300
75 73 }
76 74 },
77 75 watch: {
78   - id: {
  76 + diaScoreSet: {
79 77 handler: function (nVal) {
80 78 if (nVal) {
81 79 this._QueryData()
82 80 }
83 81 },
84   - immediate: true
85 82 }
86 83 },
87 84 methods: {
  85 + setScore(val, max, obj, keys) {
  86 + if (val > max) {
  87 + obj[keys] = max
  88 + }
  89 + },
88 90 closeScoreSet() {
89 91 this.$emit('closeScoreSet')
90 92 },
  93 + setTableHeight() {
  94 + this.tableMaxHeight = this.$refs.scoreSet.offsetHeight - 135;
  95 + },
91 96 async _QueryData() {
92 97 this.loading = true;
93 98 const { data, status, info } = await this.$request.listStudentsAndQuestions({
... ... @@ -95,9 +100,31 @@ export default {
95 100 });
96 101 this.loading = false;
97 102 if (status === 0) {
98   - this.tableData = data.students || []
99   - this.questionList = data?.students ? data?.students[0].questionList : []
100   - console.log(this.questionList)
  103 + let studentList = data.students || []
  104 + this.questionList = data?.questionList || []
  105 + this.tableData = this.questionList.length && studentList.map(item => {
  106 + item.score = 0//总分
  107 + item.subjectiveScore = 0//主观题分数
  108 + item.objectiveScore = 0//客观题分数
  109 + if (!item.scoreMap) item.scoreMap = {};
  110 + this.questionList.map(question => {
  111 + let keys = question.questionId
  112 + if (!item.scoreMap[keys]) {
  113 + item.scoreMap[keys] = ""
  114 + } else {
  115 + let num = Number(item.scoreMap[keys])
  116 + item.scoreMap[keys] = num
  117 + item.score += num
  118 + if (question.questionType == 5) {
  119 + item.subjectiveScore += num
  120 + } else {
  121 + item.objectiveScore += num
  122 + }
  123 + }
  124 + })
  125 + return item
  126 + }) || []
  127 + this.setTableHeight()
101 128 } else {
102 129 this.$message.error(info);
103 130 }
... ... @@ -105,15 +132,15 @@ export default {
105 132 async _SubmitScore() {
106 133 this.loadingSave = true;
107 134 let list = this.tableData.map(item => {
108   - let scores = {}
109   - item.questionList.map(list => {
110   - list.subQuestions.map(question => {
111   - scores[question.id] = question.score
112   - })
113   - })
  135 + let scoreMap = {}
  136 + for (let keys in item.scoreMap) {
  137 + if (item.scoreMap[keys] !== "") {
  138 + scoreMap[keys] = item.scoreMap[keys] + ""
  139 + }
  140 + }
114 141 return {
115 142 studentCode: item.studentCode,
116   - scores
  143 + scores: scoreMap,
117 144 }
118 145 })
119 146 console.log(list)
... ... @@ -123,7 +150,8 @@ export default {
123 150 });
124 151 this.loadingSave = false;
125 152 if (status === 0) {
126   - this.tableData = data.students
  153 + this.$message.success(info)
  154 + this.closeScoreSet()
127 155 } else {
128 156 this.$message.error(info);
129 157 }
... ... @@ -157,11 +185,11 @@ export default {
157 185  
158 186 <style lang="scss" scoped>
159 187 .set-container {
160   - position: absolute;
161   - left: 0;
162   - top: 0;
163   - width: 100%;
164   - height: 100%;
  188 + position: fixed;
  189 + left: 200px;
  190 + top: 50px;
  191 + width: calc(100% - 200px);
  192 + height: calc(100% - 70px);
165 193 background: #fff;
166 194 z-index: 2000;
167 195 overflow-y: auto;
... ... @@ -200,18 +228,24 @@ export default {
200 228 }
201 229  
202 230 .set-content {
203   - padding: 12px 20px;
  231 + padding: 0 20px;
204 232  
205 233 .test-title {
206 234 width: 100%;
207 235 text-align: center;
208 236 position: relative;
209   - margin-bottom: 20px;
  237 + padding: 10px 0;
210 238  
211 239 .import-btn {
212 240 position: absolute;
  241 + right: 100px;
  242 + top: 15px;
  243 + }
  244 +
  245 + .save-btn {
  246 + position: absolute;
213 247 right: 0;
214   - top: 5px;
  248 + top: 15px;
215 249 }
216 250  
217 251 .p1 {
... ...
src/views/basic/test/components/test.vue
1 1 <template>
2   - <div ref="main">
  2 + <div ref="main" class="page-content">
3 3 <div class="tips" v-if="paperModifyLog.modifiedTime && !status">
4 4 <p class="tips-p">
5 5 <i class="fa fa-bell-o"></i>
... ... @@ -12,235 +12,232 @@
12 12 <el-button type="danger" round plain size="mini" @click="paperModifyLog.modifiedTime = ''">暂时不计</el-button>
13 13 </div>
14 14 </div>
15   - <div class="page-content">
16   - <div class="content-header">
17   - <div class="tab-box">
18   - <span v-for="(item, index) in tabList" :key="item" class="tab-item" :class="type == index ? 'active' : ''"
19   - @click="setType(index)">{{ item }}</span>
20   - </div>
21   - <el-button v-if="!status" class="setMinScore" @click="diaMinScore = true" round size="small">设置低分值</el-button>
  15 + <div class="content-header">
  16 + <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>
22 19 </div>
23   - <div id="print-content" v-loading="loading">
24   - <div class="table-box">
25   - <el-table :max-height="tableMaxHeight" v-show="type == 0" :data="tableData" border style="width: 100%">
26   - <el-table-column prop="questionIndex" label="题号" align="center" fixed width="60"></el-table-column>
27   - <el-table-column prop="questionType" label="题型" align="center" fixed width="100"><template
28   - slot-scope="scope">{{
29   - setSubPro(scope.row.questionType)
30   - }}</template></el-table-column>
31   - <el-table-column prop="score" width="100" label="满分值" sortable align="center"></el-table-column>
32   - <el-table-column width="110" prop="highestScore" label="班最高分" sortable align="center"></el-table-column>
33   - <el-table-column width="110" prop="lowestScore" label="班最低分" sortable align="center"></el-table-column>
34   - <el-table-column width="110" prop="avgScore" label="班平均分" sortable align="center"></el-table-column>
35   - <el-table-column prop="classScoringRate" width="120" sortable label="班级得分率" align="center"><template
36   - slot-scope="scoped">{{ scoped.row.classScoringRate }}%</template></el-table-column>
37   - <el-table-column prop="correctAnswer" label="答案" align="center"><template slot-scope="scoped">{{
38   - scoped.row.correctAnswer == 1
39   - ? "✓"
40   - : scoped.row.correctAnswer == 2
41   - ? "✗"
42   - : scoped.row.correctAnswer
43   - }}</template>
44   - </el-table-column>
45   - <el-table-column v-for="(item, index) in optionsList" :key="index" :label="item.title" :prop="'count' + index"
46   - align="center" width="120"><template slot-scope="scope">
47   - <p class="persent">
  20 + <el-button v-if="!status" class="setMinScore" @click="diaMinScore = true" round size="small">设置低分值</el-button>
  21 + </div>
  22 + <div id="print-content" v-loading="loading">
  23 + <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>
  42 + </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">
  45 + <p class="persent">
  46 + {{
  47 + scope.row.questionType == "5"
  48 + ? ""
  49 + : scope.row["option" + index]
  50 + ? `${scope.row["option" + index]}(${scope.row["persent" + index]
  51 + })`
  52 + : ""
  53 + }}
  54 + </p>
  55 + </template>
  56 + </el-table-column>
  57 + </el-table>
  58 + <div id="print-table">
  59 + <table class="hide">
  60 + <thead>
  61 + <tr>
  62 + <th>题号</th>
  63 + <th>题型</th>
  64 + <th>满分值</th>
  65 + <th>班最高分</th>
  66 + <th>班最低分</th>
  67 + <th>班平均分</th>
  68 + <th>班级得分率</th>
  69 + <th>答案</th>
  70 + <th>选项1</th>
  71 + <th>选项2</th>
  72 + <th>选项3</th>
  73 + <th>选项4</th>
  74 + <th>未答</th>
  75 + </tr>
  76 + </thead>
  77 + <tbody>
  78 + <tr v-for="(tr, index) in tableData">
  79 + <td width="60">{{ index + 1 }}</td>
  80 + <td width="100">{{ setSubPro(tr.questionType) }}</td>
  81 + <td width="100">{{ tr.sortable }}</td>
  82 + <td width="110">{{ tr.highestScore }}</td>
  83 + <td width="110">{{ tr.lowestScore }}</td>
  84 + <td width="110">{{ tr.avgScore }}</td>
  85 + <td width="120">{{ tr.classScoringRate }}%</td>
  86 + <td>
48 87 {{
49   - scope.row.questionType == "5"
50   - ? ""
51   - : scope.row["option" + index]
52   - ? `${scope.row["option" + index]}(${scope.row["persent" + index]
53   - })`
54   - : ""
  88 + tr.correctAnswer == 1
  89 + ? "✓"
  90 + : tr.correctAnswer == 2
  91 + ? "✗"
  92 + : tr.correctAnswer
55 93 }}
56   - </p>
57   - </template>
58   - </el-table-column>
59   - </el-table>
60   - <div id="print-table">
61   - <table class="hide">
62   - <thead>
63   - <tr>
64   - <th>题号</th>
65   - <th>题型</th>
66   - <th>满分值</th>
67   - <th>班最高分</th>
68   - <th>班最低分</th>
69   - <th>班平均分</th>
70   - <th>班级得分率</th>
71   - <th>答案</th>
72   - <th>选项1</th>
73   - <th>选项2</th>
74   - <th>选项3</th>
75   - <th>选项4</th>
76   - <th>未答</th>
77   - </tr>
78   - </thead>
79   - <tbody>
80   - <tr v-for="(tr, index) in tableData">
81   - <td width="60">{{ index + 1 }}</td>
82   - <td width="100">{{ setSubPro(tr.questionType) }}</td>
83   - <td width="100">{{ tr.sortable }}</td>
84   - <td width="110">{{ tr.highestScore }}</td>
85   - <td width="110">{{ tr.lowestScore }}</td>
86   - <td width="110">{{ tr.avgScore }}</td>
87   - <td width="120">{{ tr.classScoringRate }}%</td>
88   - <td>
  94 + </td>
  95 + <td v-for="(item, index) in optionsList" :key="index" width="120">
  96 + <p class="persent">
89 97 {{
90   - tr.correctAnswer == 1
91   - ? "✓"
92   - : tr.correctAnswer == 2
93   - ? "✗"
94   - : tr.correctAnswer
  98 + tr.questionType == "5"
  99 + ? ""
  100 + : tr["option" + index]
  101 + ? `${tr["option" + index]}(${tr["persent" + index]})`
  102 + : ""
95 103 }}
96   - </td>
97   - <td v-for="(item, index) in optionsList" :key="index" width="120">
98   - <p class="persent">
99   - {{
100   - tr.questionType == "5"
101   - ? ""
102   - : tr["option" + index]
103   - ? `${tr["option" + index]}(${tr["persent" + index]})`
104   - : ""
105   - }}
106   - </p>
107   - </td>
108   - </tr>
109   - </tbody>
110   - </table>
111   - <div class="hui-box" v-show="type == 0">
112   - <span class="s-txt">汇总</span>
113   - <ul class="hui-ul">
114   - <li class="hui-li">
115   - <span class="hui-s s1">主观题</span>
116   - <span class="hui-s s1">{{ examReport.subjectiveScore }}</span>
117   - <span class="hui-s s2">{{
118   - examReport.subjectiveHighestScore
119   - }}</span>
120   - <span class="hui-s s2">{{
121   - examReport.subjectiveLowestScore
122   - }}</span>
123   - <span class="hui-s s2">{{
124   - examReport.subjectiveAvgScore
125   - }}</span>
126   - <span class="hui-s s3">{{ examReport.subjectiveClassScoringRate }}%</span>
127   - </li>
128   - <li class="hui-li">
129   - <span class="hui-s s1">客观题</span>
130   - <span class="hui-s s1">{{ examReport.objectiveScore }}</span>
131   - <span class="hui-s s2">{{
132   - examReport.objectiveHighestScore
133   - }}</span>
134   - <span class="hui-s s2">{{
135   - examReport.objectiveLowestScore
136   - }}</span>
137   - <span class="hui-s s2">{{ examReport.objectiveAvgScore }}</span>
138   - <span class="hui-s s3">{{ examReport.objectiveClassScoringRate }}%</span>
139   - </li>
140   - <li class="hui-li">
141   - <span class="hui-s s1">整卷</span>
142   - <span class="hui-s s1">{{ examReport.examPaperScore }}</span>
143   - <span class="hui-s s2">{{ examReport.highestScore }}</span>
144   - <span class="hui-s s2">{{ examReport.lowestScore }}</span>
145   - <span class="hui-s s2">{{ examReport.avgScore }}</span>
146   - <span class="hui-s s3">{{ examReport.classScoringRate }}%</span>
147   - </li>
148   - </ul>
149   - </div>
  104 + </p>
  105 + </td>
  106 + </tr>
  107 + </tbody>
  108 + </table>
  109 + <div class="hui-box" v-show="type == 0">
  110 + <span class="s-txt">汇总</span>
  111 + <ul class="hui-ul">
  112 + <li class="hui-li">
  113 + <span class="hui-s s1">主观题</span>
  114 + <span class="hui-s s1">{{ examReport.subjectiveScore }}</span>
  115 + <span class="hui-s s2">{{
  116 + examReport.subjectiveHighestScore
  117 + }}</span>
  118 + <span class="hui-s s2">{{
  119 + examReport.subjectiveLowestScore
  120 + }}</span>
  121 + <span class="hui-s s2">{{
  122 + examReport.subjectiveAvgScore
  123 + }}</span>
  124 + <span class="hui-s s3">{{ examReport.subjectiveClassScoringRate }}%</span>
  125 + </li>
  126 + <li class="hui-li">
  127 + <span class="hui-s s1">客观题</span>
  128 + <span class="hui-s s1">{{ examReport.objectiveScore }}</span>
  129 + <span class="hui-s s2">{{
  130 + examReport.objectiveHighestScore
  131 + }}</span>
  132 + <span class="hui-s s2">{{
  133 + examReport.objectiveLowestScore
  134 + }}</span>
  135 + <span class="hui-s s2">{{ examReport.objectiveAvgScore }}</span>
  136 + <span class="hui-s s3">{{ examReport.objectiveClassScoringRate }}%</span>
  137 + </li>
  138 + <li class="hui-li">
  139 + <span class="hui-s s1">整卷</span>
  140 + <span class="hui-s s1">{{ examReport.examPaperScore }}</span>
  141 + <span class="hui-s s2">{{ examReport.highestScore }}</span>
  142 + <span class="hui-s s2">{{ examReport.lowestScore }}</span>
  143 + <span class="hui-s s2">{{ examReport.avgScore }}</span>
  144 + <span class="hui-s s3">{{ examReport.classScoringRate }}%</span>
  145 + </li>
  146 + </ul>
150 147 </div>
151   - <el-table v-show="type == 1" :max-height="tableMaxHeight" :data="tableData2" border style="width: 100%"
152   - :default-sort="{ prop: 'dadui', order: 'descending' }">
153   - <el-table-column prop="studentCode" label="学号" align="center" fixed></el-table-column>
154   - <el-table-column prop="studentName" label="姓名" fixed align="center"></el-table-column>
155   - <el-table-column prop="examScore" label="总分" sortable align="center"></el-table-column>
156   - <el-table-column prop="scoringRate" label="得分率" sortable align="center"><template slot-scope="scope">{{
157   - scope.row.scoringRate }}%</template></el-table-column>
158   - <el-table-column prop="classRank" label="班名" sortable align="center"></el-table-column>
159   - <el-table-column label="客观题" align="center">
160   - <el-table-column prop="objectiveExamScore" label="得分" align="center"></el-table-column>
161   - <el-table-column prop="objectiveScoringRate" label="得分率" align="center"><template slot-scope="scope">{{
162   - scope.row.objectiveScoringRate }}%</template></el-table-column>
163   - </el-table-column>
164   - <el-table-column label="主观题" align="center">
165   - <el-table-column prop="subjectiveExamScore" label="得分" align="center"></el-table-column>
166   - <el-table-column prop="subjectiveScoringRate" label="得分率" align="center"><template slot-scope="scope">{{
167   - scope.row.subjectiveScoringRate }}%</template></el-table-column>
168   - </el-table-column>
169   - </el-table>
170   - <el-table v-show="type == 2" :max-height="tableMaxHeight" :data="tableData2" border style="width: 100%"
171   - :default-sort="{ prop: '', order: 'descending' }">
172   - <el-table-column prop="studentCode" label="学号" fixed align="center" width="120"></el-table-column>
173   - <el-table-column prop="studentName" label="姓名" fixed align="center"></el-table-column>
174   - <el-table-column prop="examScore" label="总分" sortable align="center"></el-table-column>
175   - <el-table-column label="分数组成" align="center">
176   - <el-table-column prop="objectiveExamScore" label="客观题分" align="center"></el-table-column>
177   - <el-table-column prop="subjectiveExamScore" label="主观题分" align="center"></el-table-column>
178   - </el-table-column>
179   - <el-table-column align="center" v-for="(item, index) in questionList" :key="index" :label="'Q' + item.id"
180   - :prop="'score' + item.id">
181   - </el-table-column>
182   - </el-table>
183   - <el-table :max-height="tableMaxHeight" v-show="type == 3" :data="tableData2" border style="width: 100%"
184   - :default-sort="{ prop: '', order: 'descending' }">
185   - <el-table-column prop="studentCode" label="学号" fixed align="center"></el-table-column>
186   - <el-table-column prop="studentName" label="姓名" fixed align="center"></el-table-column>
187   - <el-table-column prop="className" label="班级" align="center"></el-table-column>
188   - <el-table-column prop="examScore" label="总分" sortable align="center"></el-table-column>
189   - <el-table-column align="center" v-for="(item, index) in questionList" :key="index" :label="'Q' + item.id">
190   - <template slot-scope="scope">
191   - <span v-if="tableData[index]?.questionType == 5">*</span>
192   - <span v-else-if="scope.row['answer' + item.id]" :class="scope.row['isRight' + item.id] ? '' : 'error'">
193   - {{ scope.row["answer" + item.id] }}
194   - </span>
195   - <span v-else :class="scope.row['questionType' + item.id] == 5 ? '' : 'error'">-</span>
196   - </template>
197   - </el-table-column>
198   - </el-table>
199 148 </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>
  157 + <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>
  161 + </el-table-column>
  162 + <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>
  166 + </el-table-column>
  167 + </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>
  173 + <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>
  176 + </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">
  179 + </el-table-column>
  180 + </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">
  188 + <template slot-scope="scope">
  189 + <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'">
  191 + {{ scope.row["answer" + item.id] }}
  192 + </span>
  193 + <span v-else :class="scope.row['questionType' + item.id] == 5 ? '' : 'error'">-</span>
  194 + </template>
  195 + </el-table-column>
  196 + </el-table>
200 197 </div>
201   - <div class="down">
202   - <div>
203   - <el-button @click="openDown" type="primary" plain round icon="fa fa-cloud-download">导出报表</el-button>
204   - <el-button v-if="!this.$store.getters.code" @click="print" type="primary" plain round
205   - icon="el-icon-printer">打印</el-button>
206   - </div>
207   - <div v-if="!status">
208   - <el-button type="primary" round @click="openScoreSet">答卷录分</el-button>
  198 + </div>
  199 + <div class="down">
  200 + <div>
  201 + <el-button @click="openDown" 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>
  204 + </div>
  205 + <div v-if="!status">
  206 + <el-button type="primary" round @click="openScoreSet">答卷录分</el-button>
209 207  
210   - <template v-if="role != 'ROLE_BANZHUREN'">
211   - <el-button @click="edit" type="primary" v-if="examReport.subjectiveScore != examReport.examPaperScore"
212   - round>查看题目</el-button></template>
213   - </div>
  208 + <template v-if="role != 'ROLE_BANZHUREN'">
  209 + <el-button @click="edit" type="primary" v-if="examReport.subjectiveScore != examReport.examPaperScore"
  210 + round>查看题目</el-button></template>
214 211 </div>
215   - <ScoreSet v-show="diaScoreSet" :role="role" :id="id" :title="title" :examScore="score"
216   - @closeScoreSet="closeScoreSet" />
217   - <el-dialog :close-on-click-modal="false" title="低分区间设置" :visible.sync="diaMinScore" width="480px"
218   - @closed="closeDiaMinScore">
219   - <el-form>
220   - <el-form-item label="低分设置模式:">
221   - <el-select v-model="lowRange.type" @change="changeScore">
222   - <el-option label="按分数设置" :value="0"></el-option>
223   - <el-option label="按已考人数比例" :value="1"></el-option>
224   - <el-option label="按分数比例设置(按题目)" :value="2"></el-option>
225   - </el-select>
226   - </el-form-item>
227   - <el-form-item label="低分区间:">
228   - <el-input class="score-ipt" type="number" v-model="lowRange.range[0]" :min="0" :max="100"
229   - @input="lowRange.range[1] > 100 ? (lowRange.range[1] = 100) : ''"
230   - @keydown.native="keydownRange($event)"></el-input>{{ lowRange.type != 0 ? "%" : "分" }}(含)
231   - <el-input class="score-ipt" type="number" v-model="lowRange.range[1]" :min="0" :max="100"
232   - @input="lowRange.range[1] > 100 ? (lowRange.range[1] = 100) : ''"
233   - @keydown.native="keydownRange($event)"></el-input>{{ lowRange.type != 0 ? "%" : "分" }}(含)
234   - </el-form-item>
235   - </el-form>
236   -
237   - <div class="dialog-footer" slot="footer" align="center" v-loading="loadingTange">
238   - <el-button type="danger" @click="_SavelowRange">保存</el-button>
239   - <el-button @click="diaMinScore = false">取 消</el-button>
240   - </div>
241   - </el-dialog>
242   - <ExportDia :exportStudent="exportStudent" :diaShow="diaShow" @cancel="cancel" @exportData="exportData" />
243 212 </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">
  217 + <el-form>
  218 + <el-form-item label="低分设置模式:">
  219 + <el-select v-model="lowRange.type" @change="changeScore">
  220 + <el-option label="按分数设置" :value="0"></el-option>
  221 + <el-option label="按已考人数比例" :value="1"></el-option>
  222 + <el-option label="按分数比例设置(按题目)" :value="2"></el-option>
  223 + </el-select>
  224 + </el-form-item>
  225 + <el-form-item label="低分区间:">
  226 + <el-input class="score-ipt" type="number" v-model="lowRange.range[0]" :min="0" :max="100"
  227 + @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"
  230 + @input="lowRange.range[1] > 100 ? (lowRange.range[1] = 100) : ''"
  231 + @keydown.native="keydownRange($event)"></el-input>{{ lowRange.type != 0 ? "%" : "分" }}(含)
  232 + </el-form-item>
  233 + </el-form>
  234 +
  235 + <div class="dialog-footer" slot="footer" align="center" v-loading="loadingTange">
  236 + <el-button type="danger" @click="_SavelowRange">保存</el-button>
  237 + <el-button @click="diaMinScore = false">取 消</el-button>
  238 + </div>
  239 + </el-dialog>
  240 + <ExportDia :exportStudent="exportStudent" :diaShow="diaShow" @cancel="cancel" @exportData="exportData" />
244 241 </div>
245 242 </template>
246 243 <script>
... ... @@ -335,6 +332,7 @@ export default {
335 332 //关闭设置分数
336 333 closeScoreSet() {
337 334 this.diaScoreSet = false
  335 + this._QueryData();
338 336 },
339 337 setType(type) {
340 338 this.tableMaxHeight = this.$refs.main.offsetHeight;
... ... @@ -621,35 +619,16 @@ div::-webkit-scrollbar-thumb {
621 619 }
622 620 </style>
623 621 <style lang="scss" scoped>
624   -.hide {
625   - display: none;
626   -}
627   -
628   -.page-container {
  622 +.page-content {
  623 + padding: 20px 20px 0;
  624 + height: calc(100% - 60px);
  625 + box-sizing: border-box;
  626 + overflow: auto;
629 627 position: relative;
630   - height: 100%;
631   - padding: 20px;
632   -
633   - .table-box {
634   - min-height: 100%;
635   - }
636   -
637   - &.active {
638   - overflow: hidden;
639   - }
  628 +}
640 629  
641   - .edit-dia {
642   - position: absolute;
643   - left: 0;
644   - top: 0;
645   - right: 0;
646   - bottom: 0;
647   - width: 100%;
648   - height: calc(100vh - 70px);
649   - background: #fff;
650   - overflow-y: auto;
651   - z-index: 10;
652   - }
  630 +.hide {
  631 + display: none;
653 632 }
654 633  
655 634 .persent {
... ... @@ -660,9 +639,7 @@ div::-webkit-scrollbar-thumb {
660 639 color: #f30;
661 640 }
662 641  
663   -.page-content {
664   - padding: 20px 20px 0;
665   -}
  642 +
666 643  
667 644 .tips {
668 645 height: 48px;
... ...
src/views/basic/test/list.vue
... ... @@ -21,7 +21,7 @@
21 21 <el-table-column prop="subjectName" label="科目" align="center"></el-table-column>
22 22 <el-table-column prop="className" label="班级" align="center"></el-table-column>
23 23 <el-table-column prop="title" label="试卷名称" align="center"></el-table-column>
24   - <el-table-column prop="score" label="卷面分" align="center"></el-table-column>
  24 + <el-table-column prop="examPaperScore" label="卷面分" align="center"></el-table-column>
25 25 <el-table-column label="测验人数/班级人数" align="center">
26 26 <template slot-scope="scoped">{{ `${scoped.row.answeredNum}/${scoped.row.classPersonNum}` }}</template>
27 27 </el-table-column>
... ... @@ -43,7 +43,7 @@
43 43 <!-- <el-tooltip v-else effect="dark" content="答卷录分" placement="top">
44 44 <el-button type="primary" circle size="mini" @click="openScoreSet(scoped.row)">分</el-button>
45 45 </el-tooltip> -->
46   - <el-tooltip effect="dark" content="答卷录分" placement="top">
  46 + <el-tooltip v-else effect="dark" content="答卷录分" placement="top">
47 47 <el-button type="primary" circle size="mini" @click="openScoreSet(scoped.row)">分</el-button>
48 48 </el-tooltip>
49 49 </template>
... ... @@ -61,9 +61,11 @@
61 61 <el-table :data="tableData" :max-height="tableMaxHeight" border style="width: 100%">
62 62 <el-table-column prop="subjectName" label="科目" align="center"></el-table-column>
63 63 <el-table-column prop="classList" label="班级" align="center">
64   - <template slot-scope="scoped"><span v-for="(item, index) in scoped.row.classList">{{
65   - `${index == 0 ? '' : '/'}` + item.className
66   - }}</span></template>
  64 + <template slot-scope="scoped">
  65 + <span v-for="(item, index) in scoped.row.classList">{{
  66 + `${index == 0 ? '' : '/'}` + item.className
  67 + }}</span>
  68 + </template>
67 69 </el-table-column>
68 70 <el-table-column prop="title" label="试卷名称" align="center"></el-table-column>
69 71 <el-table-column prop="score" label="卷面分" align="center"></el-table-column>
... ... @@ -175,7 +177,9 @@ export default {
175 177 title: obj.title,
176 178 score: obj.examPaperScore || 0,
177 179 type: 1,
178   - subjectName: obj.subjectName
  180 + subjectName: obj.subjectName,
  181 + classId: this.query.classId[0],
  182 + params: this.$route.query.params
179 183 },
180 184 });
181 185 },
... ... @@ -200,7 +204,9 @@ export default {
200 204 title: this.multipleSelection[0].title,
201 205 score: this.multipleSelection[0].examPaperScore || 0,
202 206 type: 1,
203   - subjectName: subjectArr.join()
  207 + subjectName: subjectArr.join(),
  208 + classId: this.query.classId[0],
  209 + params: this.$route.query.params
204 210 },
205 211 });
206 212 } else {
... ... @@ -211,7 +217,8 @@ export default {
211 217 ids: ids.join(),
212 218 classId: this.query.classId[0],
213 219 type: subjectArr.length == 1 ? 2 : 3,
214   - subjectName: subjectArr.join()
  220 + subjectName: subjectArr.join(),
  221 + params: this.$route.query.params
215 222 },
216 223 });
217 224 }
... ... @@ -221,7 +228,8 @@ export default {
221 228 this.$router.push({
222 229 path: "/testAnalysis",
223 230 query: {
224   - ids: obj.classList.map(item => item.classId).join(),
  231 + ids: obj.ids,
  232 + classId: obj.classList.map(item => item.classId).join(),
225 233 subjectName: obj.subjectName,
226 234 title: obj.title,
227 235 type: 4
... ... @@ -275,7 +283,15 @@ export default {
275 283 let query = {};
276 284 for (let key in this.query) {
277 285 if (this.query[key] != "") {
278   - query[key] = this.query[key];
  286 + if (key == 'classId') {
  287 + if (query.classId?.length == 1) {
  288 + query.classId = this.query[key][0]
  289 + } else {
  290 + query.classIds = [...this.query[key]]
  291 + }
  292 + } else {
  293 + query[key] = this.query[key];
  294 + }
279 295 }
280 296 }
281 297 const examReportList = this.role == "ROLE_PERSONAL" ?
... ...
src/views/examinationPaper/edit.vue
... ... @@ -35,107 +35,112 @@
35 35 <div class="qs-set">知识点</div>
36 36 </div>
37 37 </div>
38   - <div class="questions-ul" :class="form.examType == 1 ? 'questions-ul2' : ''"
39   - v-for="(question, index) in questionList" :key="index">
  38 + <template v-for="(question, index) in questionList">
40 39 <template v-if="form.examType == 2">
41 40 <p class="question-title">
42 41 <span>{{ setBigNum(index) }}、</span>
43 42 <el-input class="ipt" v-model.trim="question.questionTitle" maxlength="30" placeholder="填写大题名称"></el-input>
44 43 <span>共 {{ setScore(question) }} 分</span>
45 44 </p>
46   - <div class="sub-questions">
47   - <div class="qs-num">题号</div>
48   - <div class="qs-type">题型</div>
49   - <div class="qs-score">分数</div>
50   - <div class="qs-partScore">漏选得分</div>
51   - <div class="qs-options qs-options2">选项设置</div>
52   - <div class="qs-set">题干</div>
53   - <div class="qs-set">题目解析</div>
54   - <div class="qs-set">知识点</div>
55   - </div>
  45 +
56 46 </template>
57   - <div v-for="(subQuestions, indexs) in question.subQuestions" :key="indexs">
58   - <p class="set-ans-btn" v-if="subQuestions.qusType &&
59   - subQuestions.subNum &&
60   - subQuestions.subNum > 4
61   - ">
62   - <el-button type="primary" @click="setFormAns(indexs, index)">批量设置答案</el-button>
63   - </p>
64   - <div v-else class="sub-questions">
65   - <div class="qs-num">{{ subQuestions.questionIndex }}</div>
66   - <div class="qs-type">
67   - {{ setSubPro(subQuestions.questionType) }}
68   - </div>
69   - <div class="qs-score">
70   - <el-input-number class="number-ipt" size="medium" :min="1" :max="200" :precision="2" :step="1"
71   - v-model="subQuestions.score" label="单题分值"></el-input-number>
72   - </div>
73   - <div class="qs-partScore">
74   - <p v-if="subQuestions.questionType != 3">--</p>
75   - <el-input-number class="number-ipt" v-else size="medium" :min="0" :precision="2" :max="subQuestions.score"
76   - :step="0.5" v-model="subQuestions.partScore" label="漏选得分"></el-input-number>
77   - </div>
78   - <div class="qs-options qs-options2">
79   - <p v-if="subQuestions.questionType == 5">--</p>
80   - <p v-if="subQuestions.questionType == 4" class="answer-box">
81   - <span class="answer-s" :class="subQuestions.correctAnswer == 1 ? 'active' : ''"
82   - @click="subQuestions.correctAnswer = 1">✓</span>
83   - <span class="answer-s" :class="subQuestions.correctAnswer == 2 ? 'active' : ''"
84   - @click="subQuestions.correctAnswer = 2">✗</span>
85   - </p>
86   - <p v-if="subQuestions.questionType == 3" class="answer-box">
87   - <template v-for="option in subQuestions.answerOptions.split(',')">
88   - <span v-if="option" class="answer-s" :class="subQuestions.correctAnswer.includes(option)
89   - ? 'active'
90   - : ''
91   - " :key="option" @click="changAnswer(subQuestions, option)">{{ option }}</span>
92   - </template>
93   - </p>
94   - <p v-if="subQuestions.questionType == 2" class="answer-box">
95   - <template v-for="option in subQuestions.answerOptions.split(',')">
96   - <span class="answer-s" v-if="option" :class="subQuestions.correctAnswer == option ? 'active' : ''
97   - " :key="option" @click="subQuestions.correctAnswer = option">{{ option }}</span>
98   - </template>
99   - </p>
100   - </div>
101   - <div class="qs-set">
102   - <el-popover placement="right" width="600" trigger="click">
103   - <div class="screenshot-box">
104   - <iframe class="screenshot" v-if="subQuestions.screenshot && subQuestions.screenshot.includes('html')"
105   - :src="subQuestions.screenshot"></iframe>
106   - <img class="screenshot screenshot-img"
107   - v-if="subQuestions.screenshot && !subQuestions.screenshot.includes('html')"
108   - :src="subQuestions.screenshot" alt="">
109   - <p style="textAlign:center"><el-button type="primary" round size="mini" icon="el-icon-upload"
110   - @click="openStem(subQuestions, index, indexs, 1)">重新选择图片</el-button></p>
111   - </div>
112   - <el-button slot="reference" class="icon-tickets" type="primary" circle size="mini"
113   - icon="el-icon-tickets"></el-button>
114   - </el-popover>
  47 + <div class="questions-ul" :class="form.examType == 1 ? 'questions-ul2' : ''">
  48 + <template v-if="form.examType == 2">
  49 + <div class="sub-questions">
  50 + <div class="qs-num">题号</div>
  51 + <div class="qs-type">题型</div>
  52 + <div class="qs-score">分数</div>
  53 + <div class="qs-partScore">漏选得分</div>
  54 + <div class="qs-options qs-options2">选项设置</div>
  55 + <div class="qs-set">题干</div>
  56 + <div class="qs-set">题目解析</div>
  57 + <div class="qs-set">知识点</div>
115 58 </div>
116   - <div class="qs-set">
117   - <el-popover placement="right" width="600" trigger="click">
118   - <div class="screenshot-box">
119   - <iframe class="screenshot"
120   - v-if="subQuestions.answerScreenshot && subQuestions.answerScreenshot.includes('html')"
121   - :src="subQuestions.answerScreenshot"></iframe>
122   - <img class="screenshot screenshot-img"
123   - v-if="subQuestions.answerScreenshot && !subQuestions.answerScreenshot.includes('html')"
124   - :src="subQuestions.answerScreenshot" alt="">
125   - <p style="textAlign:center"><el-button type="primary" round size="mini" icon="el-icon-upload"
126   - @click="openStem(subQuestions, index, indexs, 2)">重新选择图片</el-button></p>
127   - </div>
128   - <el-button slot="reference" class="icon-tickets" type="primary" circle size="mini"
129   - icon="el-icon-tickets"></el-button>
130   - </el-popover>
131   - </div>
132   - <div class="qs-set">
133   - <el-button type="primary" circle size="mini" icon="el-icon-price-tag"
134   - @click="openKnowledge(subQuestions, index, indexs)"></el-button>
  59 + </template>
  60 + <div v-for="(subQuestions, indexs) in question.subQuestions" :key="indexs">
  61 + <p class="set-ans-btn" v-if="subQuestions.qusType &&
  62 + subQuestions.subNum &&
  63 + subQuestions.subNum > 4
  64 + ">
  65 + <el-button type="primary" @click="setFormAns(indexs, index)">批量设置答案</el-button>
  66 + </p>
  67 + <div v-else class="sub-questions">
  68 + <div class="qs-num">{{ subQuestions.questionIndex }}</div>
  69 + <div class="qs-type">
  70 + {{ setSubPro(subQuestions.questionType) }}
  71 + </div>
  72 + <div class="qs-score">
  73 + <el-input-number class="number-ipt" size="medium" :min="1" :max="200" :precision="2" :step="1"
  74 + v-model="subQuestions.score" label="单题分值"></el-input-number>
  75 + </div>
  76 + <div class="qs-partScore">
  77 + <p v-if="subQuestions.questionType != 3">--</p>
  78 + <el-input-number class="number-ipt" v-else size="medium" :min="0" :precision="2"
  79 + :max="subQuestions.score" :step="0.5" v-model="subQuestions.partScore" label="漏选得分"></el-input-number>
  80 + </div>
  81 + <div class="qs-options qs-options2">
  82 + <p v-if="subQuestions.questionType == 5">--</p>
  83 + <p v-if="subQuestions.questionType == 4" class="answer-box">
  84 + <span class="answer-s" :class="subQuestions.correctAnswer == 1 ? 'active' : ''"
  85 + @click="subQuestions.correctAnswer = 1">✓</span>
  86 + <span class="answer-s" :class="subQuestions.correctAnswer == 2 ? 'active' : ''"
  87 + @click="subQuestions.correctAnswer = 2">✗</span>
  88 + </p>
  89 + <p v-if="subQuestions.questionType == 3" class="answer-box">
  90 + <template v-for="option in subQuestions.answerOptions.split(',')">
  91 + <span v-if="option" class="answer-s" :class="subQuestions.correctAnswer.includes(option)
  92 + ? 'active'
  93 + : ''
  94 + " :key="option" @click="changAnswer(subQuestions, option)">{{ option }}</span>
  95 + </template>
  96 + </p>
  97 + <p v-if="subQuestions.questionType == 2" class="answer-box">
  98 + <template v-for="option in subQuestions.answerOptions.split(',')">
  99 + <span class="answer-s" v-if="option" :class="subQuestions.correctAnswer == option ? 'active' : ''
  100 + " :key="option" @click="subQuestions.correctAnswer = option">{{ option }}</span>
  101 + </template>
  102 + </p>
  103 + </div>
  104 + <div class="qs-set">
  105 + <el-popover placement="right" width="600" trigger="click">
  106 + <div class="screenshot-box">
  107 + <iframe class="screenshot"
  108 + v-if="subQuestions.screenshot && subQuestions.screenshot.includes('html')"
  109 + :src="subQuestions.screenshot"></iframe>
  110 + <img class="screenshot screenshot-img"
  111 + v-if="subQuestions.screenshot && !subQuestions.screenshot.includes('html')"
  112 + :src="subQuestions.screenshot" alt="">
  113 + <p style="textAlign:center"><el-button type="primary" round size="mini" icon="el-icon-upload"
  114 + @click="openStem(subQuestions, index, indexs, 1)">重新选择图片</el-button></p>
  115 + </div>
  116 + <el-button slot="reference" class="icon-tickets" type="primary" circle size="mini"
  117 + icon="el-icon-tickets"></el-button>
  118 + </el-popover>
  119 + </div>
  120 + <div class="qs-set">
  121 + <el-popover placement="right" width="600" trigger="click">
  122 + <div class="screenshot-box">
  123 + <iframe class="screenshot"
  124 + v-if="subQuestions.answerScreenshot && subQuestions.answerScreenshot.includes('html')"
  125 + :src="subQuestions.answerScreenshot"></iframe>
  126 + <img class="screenshot screenshot-img"
  127 + v-if="subQuestions.answerScreenshot && !subQuestions.answerScreenshot.includes('html')"
  128 + :src="subQuestions.answerScreenshot" alt="">
  129 + <p style="textAlign:center"><el-button type="primary" round size="mini" icon="el-icon-upload"
  130 + @click="openStem(subQuestions, index, indexs, 2)">重新选择图片</el-button></p>
  131 + </div>
  132 + <el-button slot="reference" class="icon-tickets" type="primary" circle size="mini"
  133 + icon="el-icon-tickets"></el-button>
  134 + </el-popover>
  135 + </div>
  136 + <div class="qs-set">
  137 + <el-button type="primary" circle size="mini" icon="el-icon-price-tag"
  138 + @click="openKnowledge(subQuestions, index, indexs)"></el-button>
  139 + </div>
135 140 </div>
136 141 </div>
137 142 </div>
138   - </div>
  143 + </template>
139 144 </div>
140 145 <div class="btn-box">
141 146 <el-button type="danger" plain round @click="linkBack">取消</el-button>
... ... @@ -340,19 +345,20 @@ export default {
340 345 upSuccess(res, file) {
341 346 if (res && res.status == 0) {
342 347 this.stem.screenshot = res.data.url;
343   - // this.form.questionList[this.stem.index].subQuestions[this.stem.indexs].screenshot = this.stem.screenshot;
344 348 if (this.stem.type == 1) {
345   - if (this.form.examType == 2) {
346   - this.questionList[this.stem.index].subQuestions[this.stem.indexs].screenshot = this.stem.screenshot;
347   - } else {
348   - this.questionList[this.stem.index].screenshot = this.stem.screenshot;
349   - }
  349 + // if (this.form.examType == 2) {
  350 + this.questionList[this.stem.index].subQuestions[this.stem.indexs].screenshot = this.stem.screenshot;
  351 + // } else {
  352 + // this.questionList[this.stem.index].screenshot = this.stem.screenshot;
  353 + // }
  354 +
350 355 } else {
351   - if (this.form.examType == 2) {
352   - this.questionList[this.stem.index].subQuestions[this.stem.indexs].answerScreenshot = this.stem.answerScreenshot;
353   - } else {
354   - this.questionList[this.stem.index].answerScreenshot = this.stem.answerScreenshot;
355   - }
  356 + // if (this.form.examType == 2) {
  357 + this.questionList[this.stem.index].subQuestions[this.stem.indexs].answerScreenshot = this.stem.answerScreenshot;
  358 + // } else {
  359 + // this.questionList[this.stem.index].answerScreenshot = this.stem.answerScreenshot;
  360 + // }
  361 +
356 362 }
357 363  
358 364 this.$message.success("上传成功");
... ... @@ -373,13 +379,13 @@ export default {
373 379 },
374 380 // 选择知识点
375 381 setKnowledge() {
376   - if (this.form.examType == 2) {
377   - this.questionList[this.stem.index].subQuestions[
378   - this.stem.indexs
379   - ].knowledge = this.stem.knowledge.join(",");
380   - } else {
381   - this.questionList[this.stem.index].knowledge = this.stem.knowledge.join(",");
382   - }
  382 + // if (this.form.examType == 2) {
  383 + this.questionList[this.stem.index].subQuestions[
  384 + this.stem.indexs
  385 + ].knowledge = this.stem.knowledge.join(",");
  386 + // } else {
  387 + // this.questionList[this.stem.index].knowledge = this.stem.knowledge.join(",");
  388 + // }
383 389 this.dialogKnowledge = false;
384 390 },
385 391 //end
... ... @@ -533,32 +539,32 @@ export default {
533 539 //初始化要修改的答案
534 540 setFormAns(indexs, index) {
535 541 let answerList = "";
536   - if (this.form.examType == 2) {
537   - this.formAns = { ...this.questionList[index].subQuestions[indexs] };
538   - this.formAns.listIndex = index;
539   - let startIndex = indexs - this.formAns.subNum; //批量设置大难开始位置
540   - this.questionList[index].subQuestions.map((item, subIdx) => {
541   - if (subIdx >= startIndex && subIdx < indexs) {
542   - answerList += this.setAnswer(item.questionType, item.correctAnswer);
543   - if (item.qusType == 3) {
544   - answerList = answerList.slice(0, -1);
545   - }
546   - }
547   - });
548   - } else {
549   - this.formAns = { ...this.questionList[indexs] };
550   - let startIndex = indexs - this.formAns.subNum; //批量设置开始位置
551   - this.formAns.answerList = [];
552   - this.formAns.listIndex = indexs;
553   - this.questionList.map((item, subIdx) => {
554   - if (subIdx >= startIndex && subIdx < indexs) {
555   - answerList += this.setAnswer(item.questionType, item.correctAnswer);
556   - if (item.qusType == 3) {
557   - answerList = answerList.slice(0, -1);
558   - }
  542 + // if (this.form.examType == 2) {
  543 + this.formAns = { ...this.questionList[index].subQuestions[indexs] };
  544 + this.formAns.listIndex = index;
  545 + let startIndex = indexs - this.formAns.subNum; //批量设置大难开始位置
  546 + this.questionList[index].subQuestions.map((item, subIdx) => {
  547 + if (subIdx >= startIndex && subIdx < indexs) {
  548 + answerList += this.setAnswer(item.questionType, item.correctAnswer);
  549 + if (item.qusType == 3) {
  550 + answerList = answerList.slice(0, -1);
559 551 }
560   - });
561   - }
  552 + }
  553 + });
  554 + // } else {
  555 + // this.formAns = { ...this.questionList[indexs] };
  556 + // let startIndex = indexs - this.formAns.subNum; //批量设置开始位置
  557 + // this.formAns.answerList = [];
  558 + // this.formAns.listIndex = indexs;
  559 + // this.questionList.map((item, subIdx) => {
  560 + // if (subIdx >= startIndex && subIdx < indexs) {
  561 + // answerList += this.setAnswer(item.questionType, item.correctAnswer);
  562 + // if (item.qusType == 3) {
  563 + // answerList = answerList.slice(0, -1);
  564 + // }
  565 + // }
  566 + // });
  567 + // }
562 568 this.formAns.answerList = answerList;
563 569 this.diaSetAns = true;
564 570 },
... ... @@ -566,23 +572,23 @@ export default {
566 572 //批量修改答案
567 573 let EndIndex;
568 574 let subNum = this.formAns.subNum - 1;
569   - if (this.form.examType == 2) {
570   - this.questionList[this.formAns.listIndex].subQuestions.some(
571   - (item, index) => {
572   - if (this.formAns.endIndex == item.questionIndex) {
573   - EndIndex = index;
574   - }
575   - return this.formAns.endIndex == item.questionIndex
576   - }
577   - );
578   - } else {
579   - this.questionList.some((item, index) => {
  575 + // if (this.form.examType == 2) {
  576 + this.questionList[this.formAns.listIndex].subQuestions.some(
  577 + (item, index) => {
580 578 if (this.formAns.endIndex == item.questionIndex) {
581 579 EndIndex = index;
582 580 }
583 581 return this.formAns.endIndex == item.questionIndex
584   - });
585   - }
  582 + }
  583 + );
  584 + // } else {
  585 + // this.questionList.some((item, index) => {
  586 + // if (this.formAns.endIndex == item.questionIndex) {
  587 + // EndIndex = index;
  588 + // }
  589 + // return this.formAns.endIndex == item.questionIndex
  590 + // });
  591 + // }
586 592  
587 593 for (let i = 0; i <= subNum; i++) {
588 594 let correctAnswer = "";
... ... @@ -598,30 +604,30 @@ export default {
598 604 ? 2
599 605 : "";
600 606 }
601   - if (this.form.examType == 2) {
602   - this.questionList[this.formAns.listIndex].subQuestions[
603   - EndIndex - i
604   - ].correctAnswer = correctAnswer;
605   - } else {
606   - this.questionList[EndIndex - i].correctAnswer = correctAnswer;
607   - }
  607 + // if (this.form.examType == 2) {
  608 + this.questionList[this.formAns.listIndex].subQuestions[
  609 + EndIndex - i
  610 + ].correctAnswer = correctAnswer;
  611 + // } else {
  612 + // this.questionList[EndIndex - i].correctAnswer = correctAnswer;
  613 + // }
608 614 }
609 615 this.diaSetAns = false;
610 616 },
611 617 async save() {
612 618 for (let i = 0; i < this.questionList.length; i++) {
613   - if (this.form.examType == 2) {
614   - for (let j = 0; j < this.questionList[i].subQuestions.length; j++) {
615   - if (this.questionList[i].subQuestions[j].qusType) {
616   - this.questionList[i].subQuestions.splice(j, 1);
617   - }
618   - }
619   - } else {
620   - if (this.questionList[i].qusType) {
621   - this.questionList.splice(i, 1);
622   - i--;
  619 + // if (this.form.examType == 2) {
  620 + for (let j = 0; j < this.questionList[i].subQuestions.length; j++) {
  621 + if (this.questionList[i].subQuestions[j].qusType) {
  622 + this.questionList[i].subQuestions.splice(j, 1);
623 623 }
624 624 }
  625 + // } else {
  626 + // if (this.questionList[i].qusType) {
  627 + // this.questionList.splice(i, 1);
  628 + // i--;
  629 + // }
  630 + // }
625 631 }
626 632 let questionList = this.questionList.map((item) => {
627 633 item.score = null;
... ... @@ -716,72 +722,11 @@ export default {
716 722 }
717 723 },
718 724 formateQuestion() {
719   - if (this.form.examType == 2) {
720   - this.questionList?.map((item) => {
721   - let types = [{}];
722   - let addndex = 0;
723   - item.subQuestions.map((sub, index) => {
724   - if (!!sub.questionType) {
725   - if (
726   - sub.questionType == types[addndex].qusType &&
727   - sub.questionType != 5
728   - ) {
729   - //同类型批量答案+1
730   - types[addndex].subNum += 1;
731   - if (
732   - types[addndex].answerOptions.length <
733   - sub.answerOptions.length
734   - ) {
735   - types[addndex].answerOptions = sub.answerOptions;
736   - }
737   - types[addndex].answerList += this.setAnswer(
738   - sub.questionType,
739   - sub.correctAnswer
740   - );
741   - if (index == item.subQuestions.length - 1) {
742   - //循环最后类型数量大于等于5,保存批量答案
743   - if (types[addndex].subNum && types[addndex].subNum >= 5) {
744   - types[addndex].endIndex = sub.questionIndex;
745   - types[addndex].index = index;
746   - }
747   - }
748   - } else {
749   - if (types[addndex].subNum && types[addndex].subNum >= 5) {
750   - //不同类型时如果原有类型数量大于等于5,保存批量答案
751   - types[addndex].endIndex =
752   - item.subQuestions[index - 1].questionIndex;
753   - types[addndex].index = index - 1;
754   - addndex += 1;
755   - types[addndex] = {};
756   - }
757   - //不同类型初始化批量答案
758   - types[addndex].qusType = sub.questionType;
759   - types[addndex].subNum = 1;
760   - types[addndex].answerOptions = sub.answerOptions;
761   - types[addndex].answerList = this.setAnswer(
762   - sub.questionType,
763   - sub.correctAnswer
764   - );
765   - }
766   - }
767   - });
768   - for (let i = 0; i < types.length; i++) {
769   - if (types[i].qusType == 3) {
770   - types[i].answerList = types[i].answerList.slice(0, -1);
771   - }
772   - if (types[i].subNum >= 5) {
773   - item.subQuestions.splice(
774   - types[i].index + i + 1,
775   - 0,
776   - deepClone(types[i])
777   - );
778   - }
779   - }
780   - });
781   - } else {
  725 + // if (this.form.examType == 2) {
  726 + this.questionList?.map((item) => {
782 727 let types = [{}];
783 728 let addndex = 0;
784   - this.questionList?.map((sub, index) => {
  729 + item.subQuestions.map((sub, index) => {
785 730 if (!!sub.questionType) {
786 731 if (
787 732 sub.questionType == types[addndex].qusType &&
... ... @@ -790,7 +735,8 @@ export default {
790 735 //同类型批量答案+1
791 736 types[addndex].subNum += 1;
792 737 if (
793   - types[addndex].answerOptions.length < sub.answerOptions.length
  738 + types[addndex].answerOptions.length <
  739 + sub.answerOptions.length
794 740 ) {
795 741 types[addndex].answerOptions = sub.answerOptions;
796 742 }
... ... @@ -798,7 +744,7 @@ export default {
798 744 sub.questionType,
799 745 sub.correctAnswer
800 746 );
801   - if (index == this.questionList.length - 1) {
  747 + if (index == item.subQuestions.length - 1) {
802 748 //循环最后类型数量大于等于5,保存批量答案
803 749 if (types[addndex].subNum && types[addndex].subNum >= 5) {
804 750 types[addndex].endIndex = sub.questionIndex;
... ... @@ -809,7 +755,7 @@ export default {
809 755 if (types[addndex].subNum && types[addndex].subNum >= 5) {
810 756 //不同类型时如果原有类型数量大于等于5,保存批量答案
811 757 types[addndex].endIndex =
812   - this.questionList[index - 1].questionIndex;
  758 + item.subQuestions[index - 1].questionIndex;
813 759 types[addndex].index = index - 1;
814 760 addndex += 1;
815 761 types[addndex] = {};
... ... @@ -830,14 +776,74 @@ export default {
830 776 types[i].answerList = types[i].answerList.slice(0, -1);
831 777 }
832 778 if (types[i].subNum >= 5) {
833   - this.questionList.splice(
  779 + item.subQuestions.splice(
834 780 types[i].index + i + 1,
835 781 0,
836 782 deepClone(types[i])
837 783 );
838 784 }
839 785 }
840   - }
  786 + });
  787 + // } else {
  788 + // let types = [{}];
  789 + // let addndex = 0;
  790 + // this.questionList?.map((sub, index) => {
  791 + // if (!!sub.questionType) {
  792 + // if (
  793 + // sub.questionType == types[addndex].qusType &&
  794 + // sub.questionType != 5
  795 + // ) {
  796 + // //同类型批量答案+1
  797 + // types[addndex].subNum += 1;
  798 + // if (
  799 + // types[addndex].answerOptions.length < sub.answerOptions.length
  800 + // ) {
  801 + // types[addndex].answerOptions = sub.answerOptions;
  802 + // }
  803 + // types[addndex].answerList += this.setAnswer(
  804 + // sub.questionType,
  805 + // sub.correctAnswer
  806 + // );
  807 + // if (index == this.questionList.length - 1) {
  808 + // //循环最后类型数量大于等于5,保存批量答案
  809 + // if (types[addndex].subNum && types[addndex].subNum >= 5) {
  810 + // types[addndex].endIndex = sub.questionIndex;
  811 + // types[addndex].index = index;
  812 + // }
  813 + // }
  814 + // } else {
  815 + // if (types[addndex].subNum && types[addndex].subNum >= 5) {
  816 + // //不同类型时如果原有类型数量大于等于5,保存批量答案
  817 + // types[addndex].endIndex =
  818 + // this.questionList[index - 1].questionIndex;
  819 + // types[addndex].index = index - 1;
  820 + // addndex += 1;
  821 + // types[addndex] = {};
  822 + // }
  823 + // //不同类型初始化批量答案
  824 + // types[addndex].qusType = sub.questionType;
  825 + // types[addndex].subNum = 1;
  826 + // types[addndex].answerOptions = sub.answerOptions;
  827 + // types[addndex].answerList = this.setAnswer(
  828 + // sub.questionType,
  829 + // sub.correctAnswer
  830 + // );
  831 + // }
  832 + // }
  833 + // });
  834 + // for (let i = 0; i < types.length; i++) {
  835 + // if (types[i].qusType == 3) {
  836 + // types[i].answerList = types[i].answerList.slice(0, -1);
  837 + // }
  838 + // if (types[i].subNum >= 5) {
  839 + // this.questionList.splice(
  840 + // types[i].index + i + 1,
  841 + // 0,
  842 + // deepClone(types[i])
  843 + // );
  844 + // }
  845 + // }
  846 + // }
841 847 },
842 848 },
843 849 };
... ...