Commit 2e5b8deaa2b764895a190aabe9175d6e75ab8dc9
1 parent
50c1482f
分数设置修改,
Showing
6 changed files
with
129 additions
and
46 deletions
src/views/basic/ask/components/answerQustion.vue
| ... | ... | @@ -35,27 +35,31 @@ |
| 35 | 35 | label="参与度" |
| 36 | 36 | sortable |
| 37 | 37 | align="center" |
| 38 | - ><template slot-scope="scoped" | |
| 39 | - >{{ scoped.row.participationRate }}%</template | |
| 40 | - ></el-table-column | |
| 38 | + ><template slot-scope="scoped">{{ | |
| 39 | + `${scoped.row.participationRate}${ | |
| 40 | + scoped.row.participationRate ? "%" : "" | |
| 41 | + }` | |
| 42 | + }}</template></el-table-column | |
| 41 | 43 | > |
| 42 | 44 | <el-table-column |
| 43 | 45 | prop="correctRate" |
| 44 | 46 | label="正确率" |
| 45 | 47 | sortable |
| 46 | 48 | align="center" |
| 47 | - ><template slot-scope="scoped" | |
| 48 | - >{{ scoped.row.correctRate }}%</template | |
| 49 | - ></el-table-column | |
| 49 | + ><template slot-scope="scoped">{{ | |
| 50 | + `${scoped.row.correctRate}${scoped.row.correctRate ? "%" : ""}` | |
| 51 | + }}</template></el-table-column | |
| 50 | 52 | > |
| 51 | 53 | <el-table-column |
| 52 | 54 | prop="answerCorrectRate" |
| 53 | 55 | label="已答正确率" |
| 54 | 56 | sortable |
| 55 | 57 | align="center" |
| 56 | - ><template slot-scope="scoped" | |
| 57 | - >{{ scoped.row.answerCorrectRate }}%</template | |
| 58 | - ></el-table-column | |
| 58 | + ><template slot-scope="scoped">{{ | |
| 59 | + `${scoped.row.answerCorrectRate}${ | |
| 60 | + scoped.row.answerCorrectRate ? "%" : "" | |
| 61 | + }` | |
| 62 | + }}</template></el-table-column | |
| 59 | 63 | > |
| 60 | 64 | <el-table-column |
| 61 | 65 | v-for="(item, index) in optionsList" |
| ... | ... | @@ -84,9 +88,11 @@ |
| 84 | 88 | prop="participationRate" |
| 85 | 89 | label="总参与度" |
| 86 | 90 | align="center" |
| 87 | - ><template slot-scope="scoped" | |
| 88 | - >{{ scoped.row.participationRate }}%</template | |
| 89 | - ></el-table-column | |
| 91 | + ><template slot-scope="scoped">{{ | |
| 92 | + `${scoped.row.participationRate}${ | |
| 93 | + scoped.row.participationRate ? "%" : "" | |
| 94 | + }` | |
| 95 | + }}</template></el-table-column | |
| 90 | 96 | > |
| 91 | 97 | |
| 92 | 98 | <el-table-column |
| ... | ... | @@ -95,9 +101,9 @@ |
| 95 | 101 | align="center" |
| 96 | 102 | ></el-table-column> |
| 97 | 103 | <el-table-column prop="correctRate" label="总正确率" align="center" |
| 98 | - ><template slot-scope="scoped" | |
| 99 | - >{{ scoped.row.correctRate }}%</template | |
| 100 | - ></el-table-column | |
| 104 | + ><template slot-scope="scoped">{{ | |
| 105 | + `${scoped.row.correctRate}${scoped.row.correctRate ? "%" : ""}` | |
| 106 | + }}</template></el-table-column | |
| 101 | 107 | > |
| 102 | 108 | <el-table-column |
| 103 | 109 | prop="correctRateRank" |
| ... | ... | @@ -109,9 +115,11 @@ |
| 109 | 115 | prop="answerCorrectRate" |
| 110 | 116 | label="已答正确率" |
| 111 | 117 | align="center" |
| 112 | - ><template slot-scope="scoped" | |
| 113 | - >{{ scoped.row.answerCorrectRate }}%</template | |
| 114 | - ></el-table-column | |
| 118 | + ><template slot-scope="scoped">{{ | |
| 119 | + `${scoped.row.answerCorrectRate}${ | |
| 120 | + scoped.row.answerCorrectRate ? "%" : "" | |
| 121 | + }` | |
| 122 | + }}</template></el-table-column | |
| 115 | 123 | > |
| 116 | 124 | <el-table-column label="查看折线图" align="center"> |
| 117 | 125 | <template slot-scope="scoped"> |
| ... | ... | @@ -149,16 +157,27 @@ |
| 149 | 157 | :label="index == 0 ? '总参与度' : '参与度'" |
| 150 | 158 | :prop="'participationRate' + item" |
| 151 | 159 | ><template slot-scope="scoped" |
| 152 | - >{{ scoped.row["participationRate" + item] }}%</template | |
| 153 | - > | |
| 160 | + >{{ | |
| 161 | + `${ | |
| 162 | + scoped.row["participationRate" + item] | |
| 163 | + ? scoped.row["participationRate" + item] + "%" | |
| 164 | + : "" | |
| 165 | + } | |
| 166 | + ` | |
| 167 | + }}{{ | |
| 168 | + }}</template> | |
| 154 | 169 | </el-table-column> |
| 155 | 170 | <el-table-column |
| 156 | 171 | align="center" |
| 157 | 172 | :label="index == 0 ? '总正确率' : '正确率'" |
| 158 | 173 | :prop="'correctRate' + item" |
| 159 | - ><template slot-scope="scoped" | |
| 160 | - >{{ scoped.row["correctRate" + item] }}%</template | |
| 161 | - > | |
| 174 | + ><template slot-scope="scoped">{{ | |
| 175 | + `${ | |
| 176 | + scoped.row["correctRate" + item] | |
| 177 | + ? scoped.row["correctRate" + item] + "%" | |
| 178 | + : "" | |
| 179 | + }` | |
| 180 | + }}</template> | |
| 162 | 181 | </el-table-column> |
| 163 | 182 | </el-table-column> |
| 164 | 183 | <el-table-column label="查看雷达图" align="center"> |
| ... | ... | @@ -188,7 +207,12 @@ |
| 188 | 207 | :xAxis="xAxis" |
| 189 | 208 | :tooltipFormatter="true" |
| 190 | 209 | /> |
| 191 | - <RadarChart v-if="types == 3" id="askRadarChart" :params="chartData" :tooltipFormatter="true"/> | |
| 210 | + <RadarChart | |
| 211 | + v-if="types == 3" | |
| 212 | + id="askRadarChart" | |
| 213 | + :params="chartData" | |
| 214 | + :tooltipFormatter="true" | |
| 215 | + /> | |
| 192 | 216 | </div> |
| 193 | 217 | </el-dialog> |
| 194 | 218 | </div> | ... | ... |
src/views/basic/device/index.vue
src/views/basic/setUp/archived.vue
| ... | ... | @@ -25,12 +25,12 @@ |
| 25 | 25 | <span class="s-txt">确定班级:</span> |
| 26 | 26 | <i class="el-icon-loading" v-show="loadingClass"></i> |
| 27 | 27 | <div class="check-box" v-if="classList.length && !loadingClass"> |
| 28 | - <p class="all-check"> | |
| 28 | + <!-- <p class="all-check"> | |
| 29 | 29 | <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" |
| 30 | 30 | @change="handleCheckAllChange">全选</el-checkbox> |
| 31 | - </p> | |
| 31 | + </p> --> | |
| 32 | 32 | <el-checkbox-group v-model="classIds" @change="handleCheckedChange"> |
| 33 | - <el-checkbox v-for="item in classList" :key="item.id" :label="item.id">{{ | |
| 33 | + <el-checkbox disabled v-for="item in classList" :key="item.id" :label="item.id">{{ | |
| 34 | 34 | item.className |
| 35 | 35 | }}</el-checkbox> |
| 36 | 36 | </el-checkbox-group> | ... | ... |
src/views/basic/setUp/student.vue
| ... | ... | @@ -604,10 +604,14 @@ export default { |
| 604 | 604 | } |
| 605 | 605 | }, |
| 606 | 606 | async removeStu(obj, index, $event) { |
| 607 | + let query = {}; | |
| 608 | + if (obj.classList.length) { | |
| 609 | + query.classId = obj.classList[0].id; | |
| 610 | + } | |
| 607 | 611 | const { data, status, info } = await this.$request.delStudent({ |
| 608 | 612 | type: this.query.classType, |
| 609 | 613 | studentId: obj.id, |
| 610 | - classId: this.query.classId, | |
| 614 | + ...query, | |
| 611 | 615 | }); |
| 612 | 616 | if (status === 0) { |
| 613 | 617 | this.$message.success("删除成功"); | ... | ... |
src/views/basic/test/components/scoreSet.vue
| ... | ... | @@ -43,26 +43,32 @@ |
| 43 | 43 | <el-table-column prop="score" label="总得分" align="center" fixed |
| 44 | 44 | ><template slot-scope="scoped"> |
| 45 | 45 | <el-input |
| 46 | + v-if="isSetScore" | |
| 46 | 47 | type="number" |
| 47 | 48 | :min="0" |
| 48 | 49 | v-model="scoped.row.all" |
| 49 | - ></el-input> </template | |
| 50 | - ></el-table-column> | |
| 50 | + ></el-input> | |
| 51 | + <template v-else>{{ scoped.row.all }}</template> | |
| 52 | + </template></el-table-column | |
| 53 | + > | |
| 51 | 54 | <el-table-column prop="objectiveScore" label="客观题分" align="center" |
| 52 | 55 | ><template slot-scope="scoped"> |
| 53 | - <el-input | |
| 56 | + <!-- <el-input | |
| 54 | 57 | type="number" |
| 55 | 58 | :min="0" |
| 56 | 59 | v-model="scoped.row.object" |
| 57 | - ></el-input> </template | |
| 58 | - ></el-table-column> | |
| 60 | + ></el-input> --> | |
| 61 | + {{ scoped.row.object }} | |
| 62 | + </template></el-table-column | |
| 63 | + > | |
| 59 | 64 | <el-table-column prop="subjectiveScore" label="主观题分" align="center"> |
| 60 | 65 | <template slot-scope="scoped"> |
| 61 | - <el-input | |
| 66 | + <!-- <el-input | |
| 62 | 67 | type="number" |
| 63 | 68 | :min="0" |
| 64 | 69 | v-model="scoped.row.subject" |
| 65 | - ></el-input> | |
| 70 | + ></el-input> --> | |
| 71 | + {{ scoped.row.subject }} | |
| 66 | 72 | </template> |
| 67 | 73 | </el-table-column> |
| 68 | 74 | <!-- <el-table-column v-for="(item, index) in questionList" :key="index" :label="'第' + cNum[index] + '大题'" --> |
| ... | ... | @@ -82,7 +88,8 @@ |
| 82 | 88 | $event, |
| 83 | 89 | question.questionScore, |
| 84 | 90 | scoped.row.scoreMap, |
| 85 | - question.questionId | |
| 91 | + question.questionId, | |
| 92 | + scoped.row | |
| 86 | 93 | ) |
| 87 | 94 | " |
| 88 | 95 | v-model="scoped.row.scoreMap[question.questionId]" |
| ... | ... | @@ -145,22 +152,73 @@ export default { |
| 145 | 152 | questionList: [], |
| 146 | 153 | cNum: cNum, |
| 147 | 154 | tableMaxHeight: 300, |
| 155 | + isSetScore: true, | |
| 148 | 156 | }; |
| 149 | 157 | }, |
| 150 | 158 | watch: { |
| 151 | 159 | diaScoreSet: { |
| 152 | 160 | handler: function (nVal) { |
| 153 | 161 | if (nVal) { |
| 162 | + this.isSetScore = true; | |
| 154 | 163 | this._QueryData(); |
| 155 | 164 | } |
| 156 | 165 | }, |
| 157 | 166 | }, |
| 158 | 167 | }, |
| 159 | 168 | methods: { |
| 160 | - setScore(val, max, obj, questionId) { | |
| 169 | + setScore(val, max, obj, questionId, rowData) { | |
| 161 | 170 | if (max && Number(val) > Number(max)) { |
| 162 | 171 | obj[questionId] = max; |
| 163 | 172 | } |
| 173 | + if (!this.isSetScore) { | |
| 174 | + let { score, object, subject } = this.getScore(rowData); | |
| 175 | + rowData.all = score; | |
| 176 | + rowData.object = object; | |
| 177 | + rowData.subject = subject; | |
| 178 | + } | |
| 179 | + }, | |
| 180 | + //计算总分 | |
| 181 | + setAllScore(obj) { | |
| 182 | + let { score } = this.getScore(obj); | |
| 183 | + return score; | |
| 184 | + }, | |
| 185 | + //计算客观总分 | |
| 186 | + setObjectScore(obj) { | |
| 187 | + let { object } = this.getScore(obj); | |
| 188 | + return object; | |
| 189 | + }, | |
| 190 | + //计算主观总分 | |
| 191 | + setSubjectScore(obj) { | |
| 192 | + let { subject } = this.getScore(obj); | |
| 193 | + return subject; | |
| 194 | + }, | |
| 195 | + getScore(obj) { | |
| 196 | + let score = 0; | |
| 197 | + let subject = 0; | |
| 198 | + let object = 0; | |
| 199 | + this.questionList.map((question) => { | |
| 200 | + let keys = question.questionId; | |
| 201 | + if (!obj.scoreMap[keys]) { | |
| 202 | + if (obj.scoreMap[keys] == 0) { | |
| 203 | + obj.scoreMap[keys] = 0; | |
| 204 | + } else { | |
| 205 | + obj.scoreMap[keys] = ""; | |
| 206 | + } | |
| 207 | + } else { | |
| 208 | + let num = Number(obj.scoreMap[keys]); | |
| 209 | + obj.scoreMap[keys] = num; | |
| 210 | + if (num > 0) { | |
| 211 | + this.isSetScore = false; | |
| 212 | + } | |
| 213 | + score += num; | |
| 214 | + if (question.questionType == 5) { | |
| 215 | + subject += num; | |
| 216 | + } else { | |
| 217 | + object += num; | |
| 218 | + } | |
| 219 | + } | |
| 220 | + }); | |
| 221 | + return { score, subject, object }; | |
| 164 | 222 | }, |
| 165 | 223 | closeScoreSet() { |
| 166 | 224 | this.$emit("closeScoreSet"); |
| ... | ... | @@ -205,12 +263,9 @@ export default { |
| 205 | 263 | } else { |
| 206 | 264 | let num = Number(item.scoreMap[keys]); |
| 207 | 265 | item.scoreMap[keys] = num; |
| 208 | - // item.score += num | |
| 209 | - // if (question.questionType == 5) { | |
| 210 | - // item.subjectiveScore += num | |
| 211 | - // } else { | |
| 212 | - // item.objectiveScore += num | |
| 213 | - // } | |
| 266 | + if (num > 0) { | |
| 267 | + this.isSetScore = false; | |
| 268 | + } | |
| 214 | 269 | } |
| 215 | 270 | }); |
| 216 | 271 | ... | ... |
vue.config.js
| ... | ... | @@ -23,8 +23,8 @@ module.exports = { |
| 23 | 23 | proxy: { |
| 24 | 24 | "/": { |
| 25 | 25 | // target:"http://ezquiz.sunvotecloud.cn", |
| 26 | - // target:"http://121.40.127.171", | |
| 27 | - target:"http://192.168.3.221:8080", | |
| 26 | + // target:"http://192.168.3.221:8080", | |
| 27 | + target:"http://121.40.127.171", | |
| 28 | 28 | changeOrigin: true, |
| 29 | 29 | ws:true, |
| 30 | 30 | }, | ... | ... |