From 2904385193d8eff2251ea62cad17906c10e81046 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Tue, 16 Mar 2021 17:00:46 +0800 Subject: [PATCH] . --- src/api/index.js | 1 + src/assets/img/false.png | Bin 0 -> 709 bytes src/assets/img/true.png | Bin 0 -> 722 bytes src/pages/wrongBook/do/index.vue | 62 +++++++++++- src/pages/wrongBook/list/index.vue | 155 +++++++++++++++++++++++++++-- src/store/modules/wrongBook.js | 4 +- 6 files changed, 208 insertions(+), 14 deletions(-) create mode 100644 src/assets/img/false.png create mode 100644 src/assets/img/true.png diff --git a/src/api/index.js b/src/api/index.js index 765454b..032f13c 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -61,6 +61,7 @@ export default { getMineWrong:`/user/wrong/getMineWrong`, getPaperInfo: `/user/wrong/getPaperInfo`, questionInfo: `/user/wrong/questionInfo`, + removes: `/user/wrong/removes`, // 留言板 delComment:`/management/messageBoard/delComment`, diff --git a/src/assets/img/false.png b/src/assets/img/false.png new file mode 100644 index 0000000000000000000000000000000000000000..352a20749999eb9c61128d1aac9c7fc26cc1f118 GIT binary patch literal 709 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1G~i_{3uG+$o^ zEg+kNfw4W4fd!-lh^2s-fq`iO6I?`O0W*RPlAI`d={Qh{wWo_?h=pKph_#=xqrlpE znRbll1frA`Tc-K9%s6V-z|YXZEO3A|;sJw%1;Z_AhbE7osVZv64O;%R2ncy}up|nZ ze9PJUsbsb7w++z;OKRixzMQp6(^ax4T;q)P(q&1DgpL*}7%X*i4apQ}O@98oeQuED zJuQAm0hg%v1q(bcNo^C`uW==Ci-}O%!qQETb{@;!xFhiTuTSwQCm7jo{7%~VrYOQ` zg5iocU%v)^|FNU{#C}bHq2<|NPU!hq5a#pmJg4A%!u2*?LpS$#-f=; z#>QVtYkmE>xrM$jej$Epy0qKA{oL!%J%9VQX!B;14g2&Gz9*h|@Os{i2{JE!ytDYb zWcL0#P z*|yhLZt@}(jy$bJQ@$SjXJILrV|=5g$$N8D(cBC1=H^GQy3Jy6Of%>_Eu-o`bD`~VjxD?H}*{XlMIC11@n4Tol%iH$n&IW$@ zbckDXpVaCw=FF~j*Tos#9=v|WmgR2r4nkzna^{`{x% zm2SyjpC3Ice?Ui($C>MI{ZUnCKW;^tO$n8e4`v@aCsboRWoF!l+?F;5Z|47Mw^cuz ls~Sf;n!B&Q%G_Lfe!o%g`}rKp&&z_6lc%en%Q~loCIH*dDm(xH literal 0 HcmV?d00001 diff --git a/src/assets/img/true.png b/src/assets/img/true.png new file mode 100644 index 0000000000000000000000000000000000000000..abd335a0221138059bcb6ff7be02137bc7735723 GIT binary patch literal 722 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1G~i_{3uG+$o^ zEg+kNfw4W4fd!-lh^2s-fq`iO6I?`O0W*RPlAI`d={Qh{ho_5Uh=pKpsINyzporb~ zUX@1y+Qkk6TNoF*8asPFe5HG2uEH)YgQDx(gr@(^IonvaE0`q^WD$g-!-$8is%0^T&i){XP?q3reiLy z7g=A$h|2TVMPxqFy0PJm*q=4ur;AMunx&Gn_Wg{V75ChNjdw1HxGq%rPVN82`gto> zILS!XG%%X|zghpR=mv+Q+KLGmS+~V#*L``C_JK>nx5K0`%6oaoM%#;?JJ%Kdiqg9n zSUFpZ^PJ*evj;6Xnoa$8{g!;ba<#B`(^Mnf`bv-G>BqYtP5FGmH!>wjQs%(hD@)Xx zSJ_TnVyx)ud+@2|y1tg?{GD$+?=7%i`CDvrp^1LW{x5Pdmr|cbXP;pzm3~{D7mSC1;oyqtScvxzZqt*lF%Q=ytkdq={nU(&m*4f3;7`rO@rujiSmyH?I- z>q;qAZ`D9&>z9#*yJ|FD!>uow+_BcZSdyi)tJ6)wahAl?6%F1>PYy_w)vvi7>}WM_ z-el%o*-t!qt$*%y&u~e8$Y8of@ZX=$bFcBI>xwP;&L&oJBw$hAd;a*S>Jmo1{9j=o z{CHH8@7Ukvu}nPIlOwxd&EY_(MK!r;T|DmgwWo8A~JD&N< zD7?nIYsH + + + + + + + + + + + + + diff --git a/src/pages/wrongBook/list/index.vue b/src/pages/wrongBook/list/index.vue index 7d33b23..9d05047 100644 --- a/src/pages/wrongBook/list/index.vue +++ b/src/pages/wrongBook/list/index.vue @@ -65,9 +65,10 @@ - + @@ -96,17 +97,47 @@

{{i}}.{{quesInfo.options[i]}}

-
+ + +
+ + + +
+
+
+
+
+ +
+
@@ -143,7 +174,8 @@ export default { pageSizeNum: 10, totalNum: 0, detailVisible: false, - quesInfo: {} + quesInfo: {}, + correctVisible: false }; }, computed: { @@ -152,6 +184,7 @@ export default { ]), }, mounted() { + console.log(process.env.NODE_ENV) this.getType() this.getName() }, @@ -202,8 +235,21 @@ export default { }, show(row){ this.detailVisible = true - this.$post(`${this.api.questionInfo}?qid=${row.questionId}`) - .then(res => { + this.$post(`${this.api.questionInfo}?qid=${row.questionId}`).then(res => { + let info = res.data.list + let options = {} + for(let i in info){ + if(i.includes('option') && info[i]){ + options[i.replace('option','')] = info[i] + } + } + info.options = options + this.quesInfo = info + }).catch(err => {}) + }, + correct(row){ + this.correctVisible = true + this.$post(`${this.api.questionInfo}?qid=${row.questionId}`).then(res => { let info = res.data.list let options = {} for(let i in info){ @@ -212,13 +258,56 @@ export default { } } info.options = options + if(info.typeId == 2){ + this.$set(info,'val',[]) + }else if(info.typeId == 5){ + info.questionStem = info.questionStem.replace(/\(\)\(\)\(\)/g,``) + }else{ + this.$set(info,'val','') + } this.quesInfo = info }).catch(err => {}) }, + toCorrect(){ + let right = true + let quesInfo = this.quesInfo + let type = quesInfo.typeId + if(type == 1 || type == 3){ + if(quesInfo.val != quesInfo.answer) right = false + }else if(type == 2){ + let val = quesInfo.val.sort().join('') + if(val != quesInfo.answer) right = false + }else if(type == 5){ + let options = [...document.querySelectorAll(`.ques input`)].map(n => n.value) + let answers = [] + for(let i in quesInfo.options){ + answers.push(quesInfo.options[i]) + } + answers.map((n,i) => { + if(n != options[i]) right = false + }) + } + if(right){ + this.$post(`${this.api.removes}?qid=${quesInfo.id}&userId=${this.userId}&type=${this.type}`).then(res => { + this.$message.success('纠错成功') + this.correctVisible = false + this.getData() + }).catch(err => {}) + }else{ + this.$message.error('回答错误') + this.correctVisible = false + } + }, practice(){ - let qid = this.listData.map(n => n.questionId).join() + if(!this.listData.length) return this.$message.warning('错题列表为空,无法练习') + let qid = [] + this.listData.map(n => { + n.typeName != '简答题' && qid.push(n.questionId) + }) + if(!qid.length) return this.$message.warning('未查询到客观题,无法练习') this.setInfo({ - qid + qid: qid.join(), + type: this.type }) this.$router.push('do') } @@ -230,7 +319,7 @@ export default { /deep/.no-mb.el-form-item{ margin-bottom: 0; } - .ques{ + /deep/.ques{ .key{ font-weight: bold; color: #333; @@ -255,6 +344,23 @@ export default { margin-right: 30px; } } + .input{ + width: 100px; + height: 28px; + padding: 0 5px; + margin: 0 5px 5px; + color: #444; + background-color: #fff; + border: 1px solid #ebebeb; + box-sizing: border-box; + &:focus{ + outline: none; + } + &:disabled{ + background-color: #e8e8e8; + cursor: not-allowed; + } + } .meta{ padding-left: 10px; margin: 20px 0; @@ -273,5 +379,34 @@ export default { margin-top: 10px; } } + .options{ + margin-top: 10px; + font-size: 14px; + color: #8b8b8b; + .option{ + margin: 5px 0; + &.selected{ + font-weight: bold; + color: #555; + } + .el-radio-group{ + display: flex; + flex-direction: column; + .el-radio{ + margin: 3px 0; + } + } + } + .option-check{ + display: block; + margin-right: 6px; + } + /deep/.el-radio__label{ + padding-left: 6px; + } + .upload{ + margin: 20px 0 10px; + } + } } \ No newline at end of file diff --git a/src/store/modules/wrongBook.js b/src/store/modules/wrongBook.js index 2fdfdc8..150d6f6 100644 --- a/src/store/modules/wrongBook.js +++ b/src/store/modules/wrongBook.js @@ -4,7 +4,8 @@ export default { namespaced: true, state: { - qid: '' + qid: '', + type: 1 }, getters: { @@ -12,6 +13,7 @@ export default { mutations: { SET_INFO: (state, info) => { state.qid = info.qid + state.type = info.type }, }, actions: {