调整考试结果页面接口对接
This commit is contained in:
parent
243a5763bc
commit
29f027077d
@ -93,7 +93,7 @@ export default {
|
||||
operation: '',
|
||||
planMode: 5,
|
||||
headMode: 5,
|
||||
fontSize: 16
|
||||
fontSize: 30
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
@ -36,7 +36,7 @@ class Model {
|
||||
};
|
||||
this['private'][deviceType.Train] = {
|
||||
nameFormat: 'targetCode:serviceNumber:tripNumber', // 字体格式
|
||||
nameFontSize: 10 // 字体大小
|
||||
nameFontSize: 30 // 字体大小
|
||||
};
|
||||
this['private'][deviceType.TrainWindow] = {
|
||||
trainWindowShow: true
|
||||
|
@ -2,11 +2,11 @@ export function getBaseUrl() {
|
||||
let BASE_API;
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// BASE_API = 'https://joylink.club/jlcloud';
|
||||
BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
||||
BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
||||
// BASE_API = 'http://b29z135112.zicp.vip';
|
||||
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
|
||||
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛
|
||||
|
@ -2,14 +2,14 @@
|
||||
<div class="question">
|
||||
<div class="ql-editor" v-html="appendIndex($escapeHTML(`${option.topic}`), $vnode.key, option)" />
|
||||
<template v-if="checkType(option, 'judge')">
|
||||
<el-radio-group v-model="answer" disabled @change="onChnage">
|
||||
<el-radio-group v-model="answer" disabled :class="{'select-box': option.rightAnswer != option.answer}" @change="onChnage">
|
||||
<el-radio v-for="(el,i) in option.optionList" :key="i" :label="$str2number(el.id)" style="display: inline">
|
||||
<span>{{ el.content }}</span>
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
<template v-else-if="checkType(option, 'select')">
|
||||
<el-radio-group v-model="answer" disabled class="select-box" @change="onChnage">
|
||||
<el-radio-group v-model="answer" disabled :class="{'select-box': option.rightAnswer != option.answer}" @change="onChnage">
|
||||
<el-radio v-for="(el,i) in option.optionList" :key="i" :label="$str2number(el.id)" style="display: block">
|
||||
<span>{{ $asc2chart(i+65) }}. </span>
|
||||
<div class="ql-editor" style="display: inline; padding: 0" v-html="$escapeHTML(el.content)" />
|
||||
@ -53,11 +53,22 @@ export default {
|
||||
return option.type == type;
|
||||
},
|
||||
appendIndex(str, index, option) {
|
||||
console.log(option);
|
||||
let result = `<span style="color: green;margin-left: 10px;">(正确 得分: ${option.score})</span>`;
|
||||
let result = '';
|
||||
const i = option.optionList.findIndex(ele => ele.correct);
|
||||
if (option.type === 'select') {
|
||||
result = `<span style="color: red;margin-left: 10px;">(错误 正确答案: D)</span>`;
|
||||
if (option.answer == option.optionList[i].id) {
|
||||
result = `<span style="color: green;margin-left: 10px;">(正确 得分: ${option.score})</span>`;
|
||||
} else {
|
||||
result = `<span style="color: red;margin-left: 10px;">(错误 正确答案: ${this.$asc2chart(i + 65)})</span>`;
|
||||
}
|
||||
} else if (option.type === 'judge') {
|
||||
if (option.answer == option.optionList[i].id) {
|
||||
result = `<span style="color: green;margin-left: 10px;">(正确 得分: ${option.score})</span>`;
|
||||
} else {
|
||||
result = `<span style="color: red;margin-left: 10px;">(错误 正确答案: ${option.optionList[i].content})</span>`;
|
||||
}
|
||||
}
|
||||
this.$set(option, 'rightAnswer', option.optionList[i].id);
|
||||
// 判断是否选择正确 来显示不同内容
|
||||
return `${index + 1}. ${str} ${result}`;
|
||||
},
|
||||
|
@ -11,6 +11,10 @@
|
||||
<question v-for="(item,j) in el.children" :id="'anchor__lst-'+item.type+'-'+item.index" :key="j" v-model="item.answer" class="context" :option="item" />
|
||||
</template>
|
||||
</div>
|
||||
<div style="padding-left: 20px;margin-top: 20px;">
|
||||
<span>考试总分: </span>
|
||||
<span style="font-size: 20px">{{ totalScore }}分</span>
|
||||
</div>
|
||||
</el-main>
|
||||
<el-footer class="quiz__container-footer layer-center" @click="returnTop">
|
||||
<el-button-group class="buttons">
|
||||
@ -25,7 +29,8 @@
|
||||
// import { commitExam, getExamInfo, getUserExam, saveExamAnswer } from '@/api/exam.js';
|
||||
// import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
||||
import Question from './question';
|
||||
import { getTheoryQuestion } from '@/api/competition';
|
||||
// import { getTheoryQuestion } from '@/api/competition';
|
||||
import { getCompetitionDetail } from '@/api/competition';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -47,6 +52,7 @@ export default {
|
||||
totalScore: 0,
|
||||
passScore: 10
|
||||
},
|
||||
totalScore: 0,
|
||||
examQuestions: []
|
||||
};
|
||||
},
|
||||
@ -86,13 +92,13 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
getTheoryQuestion(this.$route.query.raceId).then((resp)=>{
|
||||
getCompetitionDetail(this.$route.query.raceId).then((resp)=>{
|
||||
if (resp.data) {
|
||||
this.examQuestions = resp.data.questions.map((el, i) => {
|
||||
el.index = i;
|
||||
el.answer = String(el.optionList[0].id);
|
||||
return el;
|
||||
resp.data.forEach((item, i) => {
|
||||
this.examQuestions.push({...item.question, ...{answer: String(item.answerOptionId), score: item.score, index: i}});
|
||||
});
|
||||
this.totalScore = resp.data.reduce((pre, ver) => pre + ver.score, 0);
|
||||
console.log(this.totalScore);
|
||||
}
|
||||
}).catch(error => { this.$message.error(`加载考试详情失败:${error.message}`); });
|
||||
},
|
||||
|
@ -75,8 +75,8 @@ export default {
|
||||
const data = {
|
||||
raceId: this.info.raceId,
|
||||
userId: this.info.userId,
|
||||
theoryScore: this.info.theoryScore,
|
||||
practiceScore: this.info.practiceScore
|
||||
artificialTheoryScore: Number(this.info.theoryScore),
|
||||
artificialPracticeScore: Number(this.info.practiceScore)
|
||||
};
|
||||
putRefereeScoring(data).then(res => {
|
||||
this.doClose();
|
||||
|
Loading…
Reference in New Issue
Block a user