@@ -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
+ }
+}
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();//获取试卷列表
}
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;