From 0c0cad7e3063e7859cd266446f2ef1998bb2a0de Mon Sep 17 00:00:00 2001 From: lmj <3407000732@qq.com> Date: Fri, 23 Dec 2022 16:43:48 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=80=83=E8=AF=95?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/exam/ExamList.vue | 46 +++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/src/views/exam/ExamList.vue b/src/views/exam/ExamList.vue index ad63dc95..7a38af7d 100644 --- a/src/views/exam/ExamList.vue +++ b/src/views/exam/ExamList.vue @@ -63,21 +63,26 @@ @@ -112,18 +117,19 @@ --> - + - + + - + - @@ -157,7 +163,7 @@ - + --> - + 测试模式 练习模式 @@ -680,6 +686,7 @@ export default { }, data() { return { + swichpublished:false, toScoreTow, qnum:0,//这里默认是30吧 examDateTime:[], @@ -762,6 +769,24 @@ export default { this.loadData() }, methods: { + open(row,num) { + this.$confirm('确定要下架改考试么?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.enableddata(row,num); + this.$message({ + type: 'success', + message: '下架成功!' + }); + }).catch(() => { + this.$message({ + type: 'info', + message: '已取消下架' + }); + }); + }, exportsList(){ if(this.answerData.data.length == 0){ return this.$message.warning('暂无导出数据!') @@ -993,6 +1018,7 @@ export default { } }, editData(row) { + this.swichpublished = row.published; if(this.questDirOptions.length==0){ this.findPapers();//获取试卷列表 } From 9aa7d6bcf73e2ee7906f0affa450c1d112d36591 Mon Sep 17 00:00:00 2001 From: daihh Date: Fri, 23 Dec 2022 16:53:23 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=80=83=E8=AF=95=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=AF=B9=E5=9B=BE=E7=89=87=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/exam/Test.vue | 67 +++++++++++++++++++++++++++++------------ 1 file changed, 48 insertions(+), 19 deletions(-) diff --git a/src/views/exam/Test.vue b/src/views/exam/Test.vue index 389309ad..05a38004 100644 --- a/src/views/exam/Test.vue +++ b/src/views/exam/Test.vue @@ -11,8 +11,7 @@
  • 考试时长: {{ testPaper.testDuration }}分钟
  • 及格线: {{ testPaper.passLine }}
  • -
  • 开始时间: - {{ testPaper.entranceTime }}
  • +
  • 开始时间:{{ testPaper.entranceTime }}
  • 尝试次数: {{ testPaper.times }}
  • 结束时间: {{ testPaper.deadlineTime }}
@@ -72,7 +71,10 @@
判断题
-
{{ i + 1 }}、{{ question.title }} ({{question.defaultScore}}分)
+
+
{{ i + 1 }}、{{ question.title }} ({{question.defaultScore}}分)
+
+
正确 @@ -86,12 +88,14 @@
单选题
-
{{ i + 1 + judge.length }}、{{ question.title }}({{question.defaultScore}}分)
+
+
{{ i + 1 + judge.length }}、{{ question.title }}({{question.defaultScore}}分)
+
+
- - {{ numberToLetter(j+1) }}、{{ option.content }} - + {{ numberToLetter(j+1) }}、{{ option.content }} +
@@ -100,12 +104,14 @@
多选题
- {{ i + 1 + judge.length + single.length }}、{{ question.title }}({{question.defaultScore}}分) +
{{ i + 1 + judge.length + single.length }}、{{ question.title }}({{question.defaultScore}}分)
+
- {{ numberToLetter(j + 1) }}、{{ option.content }} + {{ numberToLetter(j + 1) }}、{{ option.content }} +
@@ -122,11 +128,14 @@ 关闭
-
+
判断题
-
{{ i + 1 }}、{{ question.title }} ({{question.defaultScore}}分)
+
+
{{ i + 1 }}、{{ question.title }} ({{question.defaultScore}}分)
+
+
正确 @@ -143,10 +152,15 @@
单选题
-
{{ i + 1 + judge.length }}、{{ question.title }}({{question.defaultScore}}分)
+
+
{{ i + 1 + judge.length }}、{{ question.title }}({{question.defaultScore}}分)
+
+
- {{ numberToLetter(j+1) }}、{{ option.content }} + + {{ numberToLetter(j+1) }}、{{ option.content }} +

正确答案:{{item.isAnswer?numberToLetter(a+1):''}}

@@ -157,13 +171,14 @@
多选题
- {{ i + 1 + judge.length + single.length }}、{{ question.title }}({{question.defaultScore}}分) +
{{ i + 1 + judge.length + single.length }}、{{ question.title }}({{question.defaultScore}}分)
+
- {{ numberToLetter(j + 1) }}、{{ option.content }} + {{ numberToLetter(j + 1) }}、{{ option.content }} +
@@ -178,11 +193,15 @@
-
{{didx +1}}.【{{getTypeName(ditem.type)}}】{{ditem.title}}
+
+
{{didx +1}}.【{{getTypeName(ditem.type)}}】{{ditem.title}}
+
+
{{numberToLetter(optIdx+1)}}, {{opt.content}}
+
@@ -239,6 +258,7 @@ export default { data() { return { loading:0, + imageBaseUrl:process.env.VUE_APP_FILE_BASE_URL, toScoreTow, examId:'',//考试的id taskId:'',//考试任务的id @@ -305,7 +325,7 @@ export default { if(this.$route.query.refType){ this.refType = this.$route.query.refType; } - + if(this.examId) { this.loadData() }else{ @@ -966,7 +986,7 @@ export default { } .test-info { // text-align: center; - width: 500px; + width: 600px; margin: 0 auto; background: #eee; border-radius: 16px; @@ -986,6 +1006,15 @@ export default { margin: 0 20px; } } + +.qimg{ + padding-left: 30px; + width:100%; + .qimg-fit{ + width:100%; + object-fit:scale-down + } +} .question-type { font-weight: 500; font-size: 20px; From 72cdf09084f11251fcbedd0fe6756739c62d9ed7 Mon Sep 17 00:00:00 2001 From: daihh Date: Fri, 23 Dec 2022 20:09:18 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=86=85=E8=80=83?= =?UTF-8?q?=E8=AF=95=E5=BC=95=E7=94=A8=E6=97=B6=E7=9A=84=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Course/exam.vue | 80 ++++++++++++++++++++++++++-------- 1 file changed, 62 insertions(+), 18 deletions(-) diff --git a/src/components/Course/exam.vue b/src/components/Course/exam.vue index 0b982dd4..dc1f10b4 100644 --- a/src/components/Course/exam.vue +++ b/src/components/Course/exam.vue @@ -56,13 +56,17 @@
{{timerValue}} 分钟
-
【{{getTypeName(curItem.type)}}】{{curItem.content}}
+
+
【{{getTypeName(curItem.type)}}】{{curItem.content}}
+
+
{{toLetter(optIdx+1)}}.{{opt.content}}
+
@@ -80,16 +84,22 @@
-
{{didx +1}}.【{{getTypeName(ditem.type)}}】{{ditem.content}}
+
+
{{didx +1}}.【{{getTypeName(ditem.type)}}】{{ditem.content}}
+
+
-
-
-
{{toLetter(optIdx+1)}}, {{opt.content}}
-
-
- - × +
+
+
+
{{toLetter(optIdx+1)}}, {{opt.content}}
+
+
+ + × +
+
@@ -147,6 +157,7 @@ export default { data() { return { viewTest:[], + imageBaseUrl:process.env.VUE_APP_FILE_BASE_URL, correctJudgment:correctJudgment, toLetter:numberToLetter, formatSeconds:formatSeconds, @@ -275,21 +286,42 @@ export default { userAnswer:'', optShow:true, content:item.title, + images:item.images, options:[] } - item.optionList.forEach(opt=>{ - q.options.push({ - id:opt.id, - content:opt.content, - answer:opt.isAnswer, - checked:false - }) - }); + if(item.type==3){ + q.options.push({ + id:item.id+'1', + images:'', + content:"正确", + answer:item.answer=='true'? true:false, + checked:false + }); + q.options.push({ + id:item.id+'2', + images:'', + content:"错误", + answer:item.answer=='true'? false:true, + checked:false + }) + }else{ + item.optionList.forEach(opt=>{ + q.options.push({ + id:opt.id, + images:opt.images, + content:opt.content, + answer:opt.isAnswer, + checked:false + }) + }); + } + if(q.type==102){ q.userAnswer=[]; } qitems.push(q); }); + console.log(qitems,'qitems') return qitems; }, startTest(){ @@ -379,7 +411,7 @@ export default { present(){ //提交前处理 let $this=this; let score=this.countTest(); - + console.log('score='+score); if(this.noAnswers.length>0){ this.$confirm('还有未答试题,您确定要提交吗?', '提示', { confirmButtonText: '确定', @@ -400,6 +432,7 @@ export default { let totalScore=0; this.paper.items.forEach(item => { item.score=parseInt(item.score); + //console.log(item.score,'item.score'); totalScore+=item.score;//加到总分中 if(item.type != 102){ item.userAnswer=''; @@ -417,6 +450,7 @@ export default { }); } }); + //console.log(totalScore,'totalScore'); let scoreNum = 0;//用户得分 let noAnswers=[];//是否都已答 this.paper.items.forEach((item,idx) => { @@ -623,4 +657,14 @@ export default { margin-bottom: 10px; } } +.qimg{ + padding-left: 30px; + width:100%; + text-align: left; + .qimg-fit{ + width:100%; + + object-fit:scale-down + } +}