理论考试

dev_202412
yujialong 5 months ago
parent 571673fe8a
commit 0f6c7fe6b6
  1. 4
      src/api/index.js
  2. 2
      src/layouts/home/index.vue
  3. 2
      src/pages/ass/list/index.vue
  4. 2
      src/pages/match/details/index.vue
  5. 2
      src/pages/match/list/index.vue
  6. 16
      src/pages/record/theoryReport/index.vue
  7. 16
      src/pages/station/preview/index.vue
  8. 103
      src/pages/theoryExam/index.vue
  9. 2
      src/pages/touristMatch/list/index.vue
  10. 6
      src/router/modules/match.js
  11. 16
      src/router/modules/theoryExam.js

@ -57,6 +57,10 @@ export default {
getSchoolCourseAuthority: `nakadai/nakadai/curriculum/getSchoolCourseAuthority`,
detailsOfGoods: `nakadai/mall/detailsOfGoods`,
requestRenewalNotice: `nakadai/nakadai/curriculum/requestRenewalNotice`,
getTestPaperPracticeCache: `exam/exam/paper/getTestPaperPracticeCache`,
recordTestPaperPracticeCache: `exam/exam/paper/recordTestPaperPracticeCache`,
getRecentTestPaperPracticeCache: `exam/exam/paper/getRecentTestPaperPracticeCache`,
getRecentTestPaperPracticeByCid: `exam/exam/paper/getRecentTestPaperPracticeByCid`,
// 课程笔记
addNote: `nakadai/curriculumNotes/addNote`,

@ -70,7 +70,7 @@ export default {
icon: 'optimize'
}
],
showHeader: this.$route.path !== '/match/theoryExam', //
showHeader: this.$route.path !== '/theoryExam', //
};
},
components: {

@ -389,7 +389,7 @@ export default {
//
if (paperId) {
window.open(this.$router.resolve(`/match/theoryExam?paperId=${paperId}&assessmentId=${this.assessmentId}&classId=${classId}&cid=${this.cid}&mallId=${mallId}&curriculumName=${row.sysName}`).href)
window.open(this.$router.resolve(`/theoryExam?paperId=${paperId}&assessmentId=${this.assessmentId}&classId=${classId}&cid=${this.cid}&mallId=${mallId}&curriculumName=${row.sysName}`).href)
} else {
//
util.cookies.set("token", token)

@ -1798,7 +1798,7 @@ export default {
mallId = mallId || ''
//
if (method === 1) {
window.open(this.$router.resolve(`/match/theoryExam?id=${form.id}&stageId=${stageId}&teamId=${teamId}`).href)
window.open(this.$router.resolve(`/theoryExam?competitionId=${form.id}&stageId=${stageId}&teamId=${teamId}`).href)
} else {
let token = Util.local.get(Setting.tokenKey);
if (systemId == 11) {

@ -1114,7 +1114,7 @@ export default {
mallId = mallId || ''
//
if (method === 1) {
window.open(this.$router.resolve(`/match/theoryExam?id=${form.id}&stageId=${stageId}&teamId=${teamId}`).href)
window.open(this.$router.resolve(`/theoryExam?competitionId=${form.id}&stageId=${stageId}&teamId=${teamId}`).href)
this.choosing = false
} else {
let token = Util.local.get(Setting.tokenKey)

@ -2,6 +2,7 @@
<div class="wrap">
<div class="top">
<breadcrumb :routes.sync="routes" />
<span v-if="fromTheory" class="back" @click="$router.back()">返回实验</span>
</div>
<div class="report" v-loading="loading">
@ -272,6 +273,7 @@ export default {
numToLetter: Util.numToLetter,
arabicToChinese: Util.arabicToChinese,
reportId: this.$route.query.reportId,
fromTheory: this.$route.query.theory, //
matchName: this.$route.query.matchName, //
token: Util.local.get(Setting.tokenKey),
title: "实验报告",
@ -554,6 +556,18 @@ export default {
<style lang="scss" scoped>
.wrap {
padding: 10px;
.top {
display: flex;
justify-content: space-between;
align-items: center;
.back {
font-size: 14px;
color: #007eff;
cursor: pointer;
}
}
}
.text-right {
@ -886,7 +900,7 @@ samp {
}
.right {
width: calc(100% - 389px);
width: calc(100% - 335px);
height: calc(100vh - 162px);
padding: 10px;
background-color: #fff;

@ -810,8 +810,7 @@ export default {
this.curProject = item.projectId
},
//
showProjectDia (isTheory) {
this.isTheory = isTheory
showProjectDia () {
this.projectVisible = true
},
//
@ -827,7 +826,7 @@ export default {
}).catch(res => { })
},
//
entryProject (projectId) {
entryProject (projectId = '', paperId = '') {
this.$confirm('是否要继续上次的实验?', '提示', {
confirmButtonText: '是',
cancelButtonText: '否',
@ -835,16 +834,23 @@ export default {
closeOnClickModal: false
}).then(() => {
this.curProject = projectId
this.curPaper = paperId
this.toSub()
}).catch(() => {
this.showProjectDia()
})
},
//
entry (isTheory) {
async entry (isTheory) {
this.isTheory = isTheory
if (isTheory) {
//
const res = await this.$post(`${this.api.getRecentTestPaperPracticeByCid}?cid=${this.courseId}`)
if (res.recentCacheInfo) {
this.entryProject('', res.recentCacheInfo.paperId)
} else {
this.showProjectDia(1)
}
} else {
//
const systemIds = this.systemIds.split(',')
@ -916,7 +922,7 @@ export default {
async toSub () {
//
if (this.isTheory) {
window.open(this.$router.resolve(`/match/theoryExam?paperId=${this.curPaper}&cid=${this.courseId}&mallId=${this.mallId}&curriculumName=${encodeURIComponent(this.curriculumName)}`).href)
window.open(this.$router.resolve(`/theoryExam?paperId=${this.curPaper}&cid=${this.courseId}&mallId=${this.mallId}&curriculumName=${encodeURIComponent(this.curriculumName)}`).href)
} else {
//
let curProject = this.projects.find(e => e.projectId == this.curProject)

@ -25,8 +25,16 @@
<span>{{ timeSum.seconds }}</span>
</div>
<el-button v-if="per === 0" class="submit" type="danger" @click="reload">重新开始</el-button>
<el-button class="submit" :loading="submiting" :disabled="submited" @click="confirmSubmit">提交</el-button>
<template v-if="submited">
<div class="score">
<span>暂得分</span>
<div class="num">{{ score }}</div>
</div>
<el-button class="btn" @click="toReport">查看成绩报告</el-button>
</template>
<el-button v-if="per === 0" class="btn" type="danger" @click="reload">重新开始</el-button>
<el-button class="btn" :loading="submiting" :disabled="submited" @click="confirmSubmit">提交</el-button>
<img class="exit" src="@/assets/img/exit.svg" alt="" @click="close">
</div>
</div>
@ -175,7 +183,7 @@ export default {
curriculumName: this.$route.query.curriculumName,
assessmentId: this.$route.query.assessmentId, // id
classId: this.$route.query.classId,
id: +this.$route.query.id, // id
competitionId: +this.$route.query.competitionId, // id
stageId: +this.$route.query.stageId,
teamId: this.$route.query.teamId || '',
entryTime: '',
@ -216,6 +224,8 @@ export default {
pdfVisible: false,
pdfSrc: '',
client: null,
score: '',
reportId: '',
};
},
mounted () {
@ -228,7 +238,7 @@ export default {
this.getCompetition()
})
this.per = this.id ? 2 : this.assessmentId ? 1 : 0
this.per = this.competitionId ? 2 : this.assessmentId ? 1 : 0
this.paperId ? this.getPracticePaper() : this.getCompetition(1)
this.initOss()
},
@ -236,7 +246,7 @@ export default {
//
async getCompetition (load) {
if (load) this.loading = true
const { competition } = await this.$post(`${this.api.getCompetition}?competitionId=${this.id}`)
const { competition } = await this.$post(`${this.api.getCompetition}?competitionId=${this.competitionId}`)
const stages = competition.contentList
if (stages) {
const stage = stages.find(e => e.stageId === this.stageId)
@ -268,7 +278,7 @@ export default {
//
const { examSubmitReq: cache } = await this.$post(this.api.getExamPaperCache, {
competitionId: this.id,
competitionId: this.competitionId,
paperId,
stageId
})
@ -297,10 +307,25 @@ export default {
//
const { examPaper } = await this.$get(this.api.examPaperDetails, { id: paperId })
//
const { examSubmitReq: cache } = await this.$post(this.api.getTestPaperPracticeCache, {
cid: this.cid,
paperId: this.paperId,
mallId: this.mallId,
isContinueLastPractice: 1
})
const now = await Util.getNow()
let cacheQues
if (cache) {
this.entryTime = new Date(cache.startTime)
this.timeSumVal = (now - new Date(cache.startTime)) / 1000
cacheQues = cache.examSubmitJudgeList
} else {
this.entryTime = now
}
this.startCount()
this.handlePaper(examPaper)
this.handlePaper(examPaper, cacheQues)
}
} catch (e) {
this.loading = false
@ -361,7 +386,7 @@ export default {
// input
this.$nextTick(() => {
if (!cacheQues && this.id) this.submit(0) //
if (!cacheQues && this.per !== 1) this.submit(0) //
paper.map(e => {
e.examQuestions.map(n => {
if (e.questionType === 'fill_blank') {
@ -402,7 +427,6 @@ export default {
},
//
handleCounter (counterTime, isCount) {
console.log("🚀 ~ handleCounter ~ counterTime, isCount:", counterTime, isCount)
let leave1 = counterTime % (24 * 3600) //
let leave2 = leave1 % 3600 //
let leave3 = leave2 % 60 //
@ -446,7 +470,7 @@ export default {
startCount () {
clearInterval(this.counterTimer)
this.counterTimer = setInterval(() => {
this.id && this.counter(this.countVal--)
this.competitionId && this.counter(this.countVal--)
this.timeSumVal >= 0 && this.handleCounter(this.timeSumVal++)
}, 1000)
},
@ -635,6 +659,19 @@ export default {
answerAnalysisReady (editor) {
this.answerAnalysis && editor.setContent(this.answerAnalysis)
},
//
toReport () {
this.$router.push(`/record/theoryReport?reportId=${this.reportId}&theory=1`)
},
//
clearPracticeCache () {
this.$post(this.api.getTestPaperPracticeCache, {
cid: this.cid,
paperId: this.paperId,
mallId: this.mallId,
isContinueLastPractice: 0
})
},
//
async reload () {
//
@ -642,13 +679,14 @@ export default {
location.reload()
} else {
try {
await this.$confirm('<p style="color: #f56c6c;">点击重新开始,之前操作会清空。</p><p>确定重新开始吗?</p>', '提示', {
await this.$confirm('重新开始会清除答题记录,确定要继续吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
closeOnClickModal: false,
dangerouslyUseHTMLString: true,
})
await this.clearPracticeCache()
location.reload()
} catch (e) { }
}
@ -676,11 +714,11 @@ export default {
},
//
async submit (isSubmit, autoSubmit) {
if ((isSubmit && this.submiting) || (!isSubmit && this.paperId)) return false
if ((isSubmit && this.submiting) || (!isSubmit && this.per === 1)) return false
try {
if (isSubmit) this.submiting = true
const form = _.cloneDeep(this.form)
const { entryTime, curStage } = this
const { entryTime, curStage, per } = this
const ques = []
form.paperOutline.map(e => {
const type = e.questionType
@ -710,7 +748,7 @@ export default {
})
const data = {
competitionId: this.id,
competitionId: this.competitionId,
stageId: curStage.stageId,
teamId: this.teamId,
startTime: Util.formatDate('yyyy-MM-dd hh:mm:ss', entryTime), //
@ -734,18 +772,26 @@ export default {
data.assessmentId = this.assessmentId
data.classId = this.classId
}
//
await this.$post(this.api[this.assessmentId ? 'submitTheExamPaperForAssessment' : this.paperId ? 'submitTheExamPaperForPractice' : isSubmit ? 'submitTheExamPaper' : 'examPaperRecordCache'], data)
//
const res = await this.$post(this.api[isSubmit ? (per === 1 ?
'submitTheExamPaperForAssessment' : !per ? 'submitTheExamPaperForPractice' : 'submitTheExamPaper') :
(!per ? 'recordTestPaperPracticeCache' : 'examPaperRecordCache')], data)
if (isSubmit) {
window.opener && window.opener.location.reload()
clearInterval(this.counterTimer)
this.submiting = false
if (res.reportId) {
this.reportId = res.reportId
this.score = res.score
}
this.submited = true
per !== 2 && clearPracticeCache()
//
if (autoSubmit) {
this.$alert(`${this.per == 2 ? '竞赛' : '考核'}时间已到,系统已自动交卷`, '提示', {
this.$alert(`${per == 2 ? '竞赛' : '考核'}时间已到,系统已自动交卷`, '提示', {
confirmButtonText: '确定',
type: 'warning',
callback: _ => {
@ -754,7 +800,7 @@ export default {
})
} else {
//
if (this.id) {
if (this.competitionId) {
const time = curStage.resultAnnouncementTime
const msg =
time === 0 ? '提交成功!成绩将在比赛结束后公布,请前往参赛信息模块查看' : time > 0 ? `提交成功!成绩将在比赛结束后${time}小时公布,请前往参赛信息模块查看` : '提交成功';
@ -808,8 +854,25 @@ export default {
font-weight: 600;
}
.submit {
width: 106px;
.score {
margin: 0 30px;
display: inline-flex;
align-items: center;
font-size: 15px;
color: #fff;
.num {
padding: 0 8px;
margin-left: 7px;
color: #f00;
line-height: 2.4;
background-color: #fff;
border-radius: 20px;
}
}
.btn {
min-width: 106px;
font-size: 15px;
}

@ -836,7 +836,7 @@ export default {
//
if (method === 1) {
window.open(this.$router.resolve(`/match/theoryExam?id=${form.id}&stageId=${stageId}&teamId=${teamId}`).href)
window.open(this.$router.resolve(`/theoryExam?competitionId=${form.id}&stageId=${stageId}&teamId=${teamId}`).href)
this.choosing = false
} else {
let token = Util.local.get(Setting.tokenKey)

@ -31,11 +31,5 @@ export default {
component: () => import("@/pages/match/noticeDetail"),
meta: { title: "通知公告" }
},
{
name: `${pre}theoryExam`,
path: `theoryExam`,
component: () => import("@/pages/match/theoryExam"),
meta: { title: "理论竞赛" }
}
]
};

@ -0,0 +1,16 @@
import BasicLayout from '@/layouts/home';
const meta = {};
export default {
path: '/theoryExam',
meta,
component: BasicLayout,
children: [
{
path: `/theoryExam`,
component: () => import('@/pages/theoryExam'),
meta: { title: '理论考试' }
},
]
};
Loading…
Cancel
Save