-
-
{{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
+ }
+}