Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
0d27ba3d6f
@ -93,7 +93,7 @@ export default {
|
|||||||
operation: '',
|
operation: '',
|
||||||
planMode: 5,
|
planMode: 5,
|
||||||
headMode: 5,
|
headMode: 5,
|
||||||
fontSize: 16
|
fontSize: 30
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -36,7 +36,7 @@ class Model {
|
|||||||
};
|
};
|
||||||
this['private'][deviceType.Train] = {
|
this['private'][deviceType.Train] = {
|
||||||
nameFormat: 'targetCode:serviceNumber:tripNumber', // 字体格式
|
nameFormat: 'targetCode:serviceNumber:tripNumber', // 字体格式
|
||||||
nameFontSize: 10 // 字体大小
|
nameFontSize: 30 // 字体大小
|
||||||
};
|
};
|
||||||
this['private'][deviceType.TrainWindow] = {
|
this['private'][deviceType.TrainWindow] = {
|
||||||
trainWindowShow: true
|
trainWindowShow: true
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
<div class="question">
|
<div class="question">
|
||||||
<div class="ql-editor" v-html="appendIndex($escapeHTML(`${option.topic}`), $vnode.key, option)" />
|
<div class="ql-editor" v-html="appendIndex($escapeHTML(`${option.topic}`), $vnode.key, option)" />
|
||||||
<template v-if="checkType(option, 'judge')">
|
<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">
|
<el-radio v-for="(el,i) in option.optionList" :key="i" :label="$str2number(el.id)" style="display: inline">
|
||||||
<span>{{ el.content }}</span>
|
<span>{{ el.content }}</span>
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="checkType(option, 'select')">
|
<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">
|
<el-radio v-for="(el,i) in option.optionList" :key="i" :label="$str2number(el.id)" style="display: block">
|
||||||
<span>{{ $asc2chart(i+65) }}. </span>
|
<span>{{ $asc2chart(i+65) }}. </span>
|
||||||
<div class="ql-editor" style="display: inline; padding: 0" v-html="$escapeHTML(el.content)" />
|
<div class="ql-editor" style="display: inline; padding: 0" v-html="$escapeHTML(el.content)" />
|
||||||
@ -53,11 +53,22 @@ export default {
|
|||||||
return option.type == type;
|
return option.type == type;
|
||||||
},
|
},
|
||||||
appendIndex(str, index, option) {
|
appendIndex(str, index, option) {
|
||||||
console.log(option);
|
let result = '';
|
||||||
let result = `<span style="color: green;margin-left: 10px;">(正确 得分: ${option.score})</span>`;
|
const i = option.optionList.findIndex(ele => ele.correct);
|
||||||
if (option.type === 'select') {
|
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}`;
|
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" />
|
<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>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
<div style="padding-left: 20px;margin-top: 20px;">
|
||||||
|
<span>考试总分: </span>
|
||||||
|
<span style="font-size: 20px">{{ totalScore }}分</span>
|
||||||
|
</div>
|
||||||
</el-main>
|
</el-main>
|
||||||
<el-footer class="quiz__container-footer layer-center" @click="returnTop">
|
<el-footer class="quiz__container-footer layer-center" @click="returnTop">
|
||||||
<el-button-group class="buttons">
|
<el-button-group class="buttons">
|
||||||
@ -25,7 +29,8 @@
|
|||||||
// import { commitExam, getExamInfo, getUserExam, saveExamAnswer } from '@/api/exam.js';
|
// import { commitExam, getExamInfo, getUserExam, saveExamAnswer } from '@/api/exam.js';
|
||||||
// import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
// import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
||||||
import Question from './question';
|
import Question from './question';
|
||||||
import { getTheoryQuestion } from '@/api/competition';
|
// import { getTheoryQuestion } from '@/api/competition';
|
||||||
|
import { getCompetitionDetail } from '@/api/competition';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -47,6 +52,7 @@ export default {
|
|||||||
totalScore: 0,
|
totalScore: 0,
|
||||||
passScore: 10
|
passScore: 10
|
||||||
},
|
},
|
||||||
|
totalScore: 0,
|
||||||
examQuestions: []
|
examQuestions: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -86,13 +92,13 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadInitData() {
|
loadInitData() {
|
||||||
getTheoryQuestion(this.$route.query.raceId).then((resp)=>{
|
getCompetitionDetail(this.$route.query.raceId).then((resp)=>{
|
||||||
if (resp.data) {
|
if (resp.data) {
|
||||||
this.examQuestions = resp.data.questions.map((el, i) => {
|
resp.data.forEach((item, i) => {
|
||||||
el.index = i;
|
this.examQuestions.push({...item.question, ...{answer: String(item.answerOptionId), score: item.score, index: i}});
|
||||||
el.answer = String(el.optionList[0].id);
|
|
||||||
return el;
|
|
||||||
});
|
});
|
||||||
|
this.totalScore = resp.data.reduce((pre, ver) => pre + ver.score, 0);
|
||||||
|
console.log(this.totalScore);
|
||||||
}
|
}
|
||||||
}).catch(error => { this.$message.error(`加载考试详情失败:${error.message}`); });
|
}).catch(error => { this.$message.error(`加载考试详情失败:${error.message}`); });
|
||||||
},
|
},
|
||||||
|
@ -75,8 +75,8 @@ export default {
|
|||||||
const data = {
|
const data = {
|
||||||
raceId: this.info.raceId,
|
raceId: this.info.raceId,
|
||||||
userId: this.info.userId,
|
userId: this.info.userId,
|
||||||
theoryScore: this.info.theoryScore,
|
artificialTheoryScore: Number(this.info.theoryScore),
|
||||||
practiceScore: this.info.practiceScore
|
artificialPracticeScore: Number(this.info.practiceScore)
|
||||||
};
|
};
|
||||||
putRefereeScoring(data).then(res => {
|
putRefereeScoring(data).then(res => {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
|
Loading…
Reference in New Issue
Block a user