接入理论考试(练习)

master
yujialong 3 weeks ago
parent 515fadb15d
commit ac62a2270b
  1. 5
      src/api/index.js
  2. 1
      src/assets/img/exit.svg
  3. 76
      src/components/ueditorPlus/index.vue
  4. 34
      src/const/testPaper.js
  5. 4
      src/pages/product/show/index.vue
  6. 164
      src/pages/station/preview/index.vue
  7. 1079
      src/pages/theoryExam/index.vue
  8. 104
      src/router/routes.js

@ -503,6 +503,11 @@ export default {
teacherModelList: `nakadai/nakadai/model/reference/demo/teacherModelList`, teacherModelList: `nakadai/nakadai/model/reference/demo/teacherModelList`,
saveModel: `nakadai/nakadai/model/reference/demo/save`, saveModel: `nakadai/nakadai/model/reference/demo/save`,
examPaperDetails: `exam/exam/paper/examPaperDetails`,
getExamPaperCache: `exam/exam/paper/getExamPaperCache`,
submitTheExamPaperForPractice: `exam/exam/paper/submitTheExamPaperForPractice`,
examPaperRecordCache: `exam/exam/paper/examPaperRecordCache`,
// 教师评语 // 教师评语
addComment: `evaluation/cevaluation/comment/addComment`, addComment: `evaluation/cevaluation/comment/addComment`,
queryComment: `evaluation/evaluation/ccomment/queryComment`, queryComment: `evaluation/evaluation/ccomment/queryComment`,

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1723618392232" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4281" width="30" height="30" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M511.771963 1023.291077c-63.724308 0-125.558154-12.445538-183.768615-37.100308a469.464615 469.464615 0 0 1-150.134154-101.139692 471.118769 471.118769 0 0 1 59.392-717.351385 37.021538 37.021538 0 0 1 43.008 59.864616 403.692308 403.692308 0 0 0-121.304616 139.027692A391.798154 391.798154 0 0 0 113.435963 551.227077c0 106.338462 41.432615 206.375385 116.657231 281.6a395.736615 395.736615 0 0 0 281.678769 116.736c106.338462 0 206.454154-41.432615 281.757539-116.736a395.421538 395.421538 0 0 0 116.65723-281.6 391.483077 391.483077 0 0 0-45.528615-184.635077 403.298462 403.298462 0 0 0-121.304615-138.870154 36.864 36.864 0 0 1 43.008-59.943384 471.04 471.04 0 0 1 59.392 717.430153 471.04 471.04 0 0 1-333.981539 138.161231z m11.106462-512.236308a36.864 36.864 0 0 1-36.94277-36.864V37.021538a37.021538 37.021538 0 0 1 73.964308 0v437.169231c0 20.48-16.541538 36.864-37.021538 36.864z" fill="#ffffff" p-id="4282"></path></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -0,0 +1,76 @@
<template>
<div>
<script :id="randomId" type="text/plain" style="height: 200px;"></script>
</div>
</template>
<script>
import Setting from '@/setting'
export default {
name: 'UE',
props: {
value: {
default: function () {
return ''
}
}
},
data () {
return {
randomId: 'editor_' + Math.random() * 100000000000000000,
//
instance: null,
ready: false
}
},
watch: {
value: function (val, oldVal) {
if (val != null && this.ready) {
// eslint-disable-next-line no-undef
this.instance = UE.getEditor(this.randomId)
this.instance.setContent(val)
}
}
},
mounted () {
this.initEditor()
},
beforeDestroy () {
if (this.instance !== null && this.instance.destroy) {
this.instance.destroy()
}
},
methods: {
initEditor () {
this.$nextTick(() => {
const host = Setting.isPro || Setting.isZxy ? location.origin : `http://121.37.12.51`
// eslint-disable-next-line no-undef
this.instance = UE.getEditor(this.randomId, {
UEDITOR_HOME_URL: Setting.isTest ? '/examination/static/ueditorPlus/' : '/static/ueditorPlus/',
serverUrl: host + `/exam/exam/upload/configAndUpload`,
plugins: 'gapfilling'
})
this.instance.addListener('ready', () => {
this.ready = true
this.$emit('ready', this.instance)
})
})
},
getUEContent () {
return this.instance.getContent()
},
setText (con) {
// eslint-disable-next-line no-undef
this.instance = UE.getEditor(this.randomId)
this.instance.setContent(con)
}
}
}
</script>
<style lang="scss">
.edui-default {
line-height: normal;
}
</style>

@ -0,0 +1,34 @@
export default {
difficults: [
{
id: 1,
name: '简单'
},
{
id: 2,
name: '普通'
},
{
id: 3,
name: '较难'
},
{
id: 4,
name: '难'
},
],
paperTypes: [
{
id: 0,
name: '练习'
},
{
id: 1,
name: '考核'
},
{
id: 2,
name: '竞赛'
},
],
}

@ -54,7 +54,7 @@
</div> </div>
<button v-if="!overdue" class="btn" @click="toRenew">续费</button> <button v-if="!overdue" class="btn" @click="toRenew">续费</button>
<button v-else-if="!form.goodsRes.logoOfOurSchool" class="btn" @click="toTrail">试用体验</button> <button v-else-if="overdue === -1" class="btn" @click="toTrail">试用体验</button>
<button v-else-if="isCourse || withLink" class="btn entry" @click="toStation">进入{{ isDataforward ? '系统' : '实验' <button v-else-if="isCourse || withLink" class="btn entry" @click="toStation">进入{{ isDataforward ? '系统' : '实验'
}}</button> }}</button>
<button v-else-if="isValueModule" class="btn entry" @click="toSystem">进入系统</button> <button v-else-if="isValueModule" class="btn entry" @click="toSystem">进入系统</button>
@ -235,7 +235,7 @@ export default {
const { isRenew } = await this.$get(this.api.whetherToRenewTheFee, { const { isRenew } = await this.$get(this.api.whetherToRenewTheFee, {
mallId: this.id mallId: this.id
}) })
// 10 // 10-1
this.overdue = isRenew this.overdue = isRenew
}, },
// tab // tab

@ -52,8 +52,8 @@
<div class="catalog"> <div class="catalog">
<div class="m-b-20"> <div class="m-b-20">
<el-button v-if="!overdue" class="entry" type="primary" size="small" @click="showBuy">续费</el-button> <el-button v-if="!overdue" class="entry" type="primary" size="small" @click="showBuy">续费</el-button>
<el-button v-if="practiceTheoreticalPaper" class="entry" type="primary" @click="entry">进入理论</el-button> <el-button v-if="practiceTheoreticalPaper" class="entry" type="primary" @click="entry(1)">进入理论</el-button>
<el-button v-if="practicePracticeProject" class="entry" type="primary" @click="entry">进入实训</el-button> <el-button v-if="practicePracticeProject" class="entry" type="primary" @click="entry(0)">进入实训</el-button>
</div> </div>
<div class="list"> <div class="list">
<h4 class="title">{{ curriculumName || courseName }}</h4> <h4 class="title">{{ curriculumName || courseName }}</h4>
@ -278,11 +278,20 @@
<el-dialog title="请选择项目" v-loading="loading" :visible.sync="projectVisible" width="828px" custom-class="project-dia" <el-dialog title="请选择项目" v-loading="loading" :visible.sync="projectVisible" width="828px" custom-class="project-dia"
:close-on-click-modal="false"> :close-on-click-modal="false">
<ul class="projects"> <ul class="projects">
<li v-for="(item, i) in projects" :key="i" :class="{ active: curProject == item.projectId }" <template v-if="isTheory">
@click="selectProject(item)"> <li v-for="(item, i) in papers" :key="i" :class="{ active: curPaper == item.paperId }"
<img src="@/assets/img/project.png" alt=""> @click="selectPaper(item)">
<span>{{ i + 1 }}. {{ item.projectName }}</span> <img src="@/assets/img/project.png" alt="">
</li> <span>{{ i + 1 }}. {{ item.paperName }}</span>
</li>
</template>
<template v-else>
<li v-for="(item, i) in projects" :key="i" :class="{ active: curProject == item.projectId }"
@click="selectProject(item)">
<img src="@/assets/img/project.png" alt="">
<span>{{ i + 1 }}. {{ item.projectName }}</span>
</li>
</template>
</ul> </ul>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -358,8 +367,11 @@ export default {
videoSrc: '', videoSrc: '',
desShrink: false, desShrink: false,
projectVisible: false, projectVisible: false,
isTheory: 0,
projects: [], projects: [],
papers: [],
loading: false, loading: false,
curPaper: '',
curProject: '', curProject: '',
overdue: 0, // overdue: 0, //
buyVisible: false, buyVisible: false,
@ -466,7 +478,7 @@ export default {
this.$get(this.api.whetherToRenewTheFee, { this.$get(this.api.whetherToRenewTheFee, {
mallId: this.mallId mallId: this.mallId
}).then(({ isRenew }) => { }).then(({ isRenew }) => {
// 10 // 10-1
this.overdue = isRenew this.overdue = isRenew
this.getChapter() this.getChapter()
this.getProgress() this.getProgress()
@ -698,7 +710,7 @@ export default {
}, },
preview (row, chapterName, showDia = 0) { preview (row, chapterName, showDia = 0) {
// //
if (this.overdue || showDia) { if (this.overdue === 1 || showDia) {
this.curLink = `${chapterName}${row.name}`; // + this.curLink = `${chapterName}${row.name}`; // +
this.playAuth = '' this.playAuth = ''
this.coverUrl = '' this.coverUrl = ''
@ -795,12 +807,17 @@ export default {
fullScreen () { fullScreen () {
this.pdfVisible = true this.pdfVisible = true
}, },
//
selectPaper (item) {
this.curPaper = item.paperId
},
// //
selectProject (item) { selectProject (item) {
this.curProject = item.projectId this.curProject = item.projectId
}, },
// //
showProjectDia () { showProjectDia (isTheory) {
this.isTheory = isTheory
this.projectVisible = true this.projectVisible = true
}, },
// //
@ -810,8 +827,9 @@ export default {
cId: this.courseId, // id cId: this.courseId, // id
mallId: this.mallId, mallId: this.mallId,
permissions: 0 // 0: ,1: permissions: 0 // 0: ,1:
}).then(({ projects }) => { }).then(res => {
this.projects = projects this.projects = res.projects //
this.papers = res.exercisePaperList //
}).catch(res => { }) }).catch(res => { })
}, },
// //
@ -829,41 +847,47 @@ export default {
}) })
}, },
// //
entry () { entry (isTheory) {
// (python) if (isTheory) {
if (this.systemIds.split(',').includes('19')) { // //
this.$post(`${this.api.getSandTableLastCache}?cid=${this.courseId}`).then(res => { this.showProjectDia(1)
// data } else {
if (res.getLastCache) { //
this.entryProject(+res.getLastCache) // (python)
} else { if (this.systemIds.split(',').includes('19')) { //
this.$post(`${this.api.getSandTableLastCache}?cid=${this.courseId}`).then(res => {
// data
if (res.getLastCache) {
this.entryProject(+res.getLastCache)
} else {
this.showProjectDia()
}
}).catch(res => {
this.showProjectDia() this.showProjectDia()
} })
}).catch(res => { } else { // python
this.showProjectDia() // python
}) // const opened = +localStorage.getItem('opened')
} else { // python // if (opened) {
// python // Util.errorMsg('Python', 5000)
// const opened = +localStorage.getItem('opened') // return false
// if (opened) { // } else {
// Util.errorMsg('Python', 5000) // localStorage.setItem('opened', 1)
// return false // }
// } else {
// localStorage.setItem('opened', 1) this.$get(this.api.getTheMostRecentlyRunProject, {
// } cid: this.courseId
}).then(({ data }) => {
this.$get(this.api.getTheMostRecentlyRunProject, { // data
cid: this.courseId if (data && data.length) {
}).then(({ data }) => { this.entryProject(data[0].projectId)
// data } else {
if (data && data.length) { this.showProjectDia()
this.entryProject(data[0].projectId) }
} else { }).catch(res => {
this.showProjectDia() this.showProjectDia()
} })
}).catch(res => { }
this.showProjectDia()
})
} }
}, },
// python // python
@ -895,29 +919,35 @@ export default {
}, },
// //
async toSub () { async toSub () {
let curProject = this.projects.find(e => e.projectId == this.curProject) //
if (!curProject && this.projects.length) { if (this.isTheory) {
curProject = this.projects[0] window.open(this.$router.resolve(`/theoryExam?paperId=${this.curPaper}&cid=${this.courseId}&mallId=${this.mallId}&curriculumName=${this.curriculumName}`).href)
this.curProject = curProject.projectId
}
const { systemId } = curProject
let token = Util.local.get(Setting.tokenKey);
this.third = curProject.type === 2 ? (curProject.systemId === 28 ? 'low' : 'ai') : ''
if (systemId == 11) {
//
sessionStorage.removeItem('projectId')
sessionStorage.removeItem('submited')
location.href = `${Setting.bankPath}/#/index/list?curriculumName=${this.curriculumName}&token=${token}&cid=${this.courseId}&mallId=${this.mallId}&systemId=${this.systemIds}&projectId=${this.curProject}&assessmentId=&classId=&stopTime=&test=true&manager=1`
} else if (systemId == 12) {
//
window.open(`http://${Setting.zcPath}?systemId=${systemId}&courseId=${this.courseId}&projectId=${this.curProject}&token=${token}&userId=${this.userId}&classId=1&mallId=${this.mallId}${Setting.isTest ? '&beta=1' : ''}`);
} else if (systemId == 19) {
//
location.href = `${Setting.sandPath}/#/?curriculumName=${this.curriculumName}&token=${token}&cid=${this.courseId}&mallId=${this.mallId}&systemId=${this.systemIds}&projectId=${this.curProject}&assessmentId=&classId=&stopTime=&manager=1&referrer=${encodeURIComponent(location.href)}`
} else { } else {
// python //
this.toPython(this.curProject) let curProject = this.projects.find(e => e.projectId == this.curProject)
if (!curProject && this.projects.length) {
curProject = this.projects[0]
this.curProject = curProject.projectId
}
const { systemId } = curProject
let token = Util.local.get(Setting.tokenKey);
this.third = curProject.type === 2 ? (curProject.systemId === 28 ? 'low' : 'ai') : ''
if (systemId == 11) {
//
sessionStorage.removeItem('projectId')
sessionStorage.removeItem('submited')
location.href = `${Setting.bankPath}/#/index/list?curriculumName=${this.curriculumName}&token=${token}&cid=${this.courseId}&mallId=${this.mallId}&systemId=${this.systemIds}&projectId=${this.curProject}&assessmentId=&classId=&stopTime=&test=true&manager=1`
} else if (systemId == 12) {
//
window.open(`http://${Setting.zcPath}?systemId=${systemId}&courseId=${this.courseId}&projectId=${this.curProject}&token=${token}&userId=${this.userId}&classId=1&mallId=${this.mallId}${Setting.isTest ? '&beta=1' : ''}`);
} else if (systemId == 19) {
//
location.href = `${Setting.sandPath}/#/?curriculumName=${this.curriculumName}&token=${token}&cid=${this.courseId}&mallId=${this.mallId}&systemId=${this.systemIds}&projectId=${this.curProject}&assessmentId=&classId=&stopTime=&manager=1&referrer=${encodeURIComponent(location.href)}`
} else {
// python
this.toPython(this.curProject)
}
} }
} }
} }

File diff suppressed because it is too large Load Diff

@ -9,18 +9,18 @@ requireModule.keys().forEach(fileName => {
modules.push(requireModule(fileName).default) modules.push(requireModule(fileName).default)
}) })
const frameIn = [ const frameIn = [
// 默认路由配置 // 默认路由配置
{ {
path: "/", path: "/",
redirect: "/login" redirect: "/login"
}, },
{ {
path: "/", path: "/",
component: () => BasicLayout, component: () => BasicLayout,
meta: { title: "首页" }, meta: { title: "首页" },
children: [] children: []
}, },
...modules ...modules
]; ];
/** /**
@ -28,53 +28,59 @@ const frameIn = [
*/ */
const frameOut = [ const frameOut = [
// 登录 // 登录
{ {
path: "/login", path: "/login",
name: "login", name: "login",
meta: { meta: {
title: "登录" title: "登录"
},
component: () => import("@/pages/account/login")
}, },
{ component: () => import("@/pages/account/login")
path: "/redirect", },
name: "redirect", {
component: () => import("@/pages/account/redirect") path: "/redirect",
}, name: "redirect",
{ component: () => import("@/pages/account/redirect")
name: `matchPreview`, },
path: `/match/preview`, {
component: () => import("@/pages/match/preview"), name: `matchPreview`,
meta: { title: "赛事预览" } path: `/match/preview`,
} component: () => import("@/pages/match/preview"),
meta: { title: "赛事预览" }
},
{
name: `theoryExam`,
path: `/theoryExam`,
component: () => import("@/pages/theoryExam"),
meta: { title: "理论考试" }
}
]; ];
/** /**
* 错误页面 * 错误页面
*/ */
const errorPage = [ const errorPage = [
{ {
path: '/403', path: '/403',
name: '403', name: '403',
meta: { meta: {
title: '403' title: '403'
}, },
component: () => import('@/pages/exception/error/403') component: () => import('@/pages/exception/error/403')
},
{
path: '*',
name: '404',
meta: {
title: '404'
}, },
{ component: () => import('@/pages/exception/error/404')
path: '*', }
name: '404',
meta: {
title: '404'
},
component: () => import('@/pages/exception/error/404')
}
] ]
// 重新组织后导出 // 重新组织后导出
export default [ export default [
...frameIn, ...frameIn,
...frameOut, ...frameOut,
...errorPage ...errorPage
]; ];
Loading…
Cancel
Save