接入理论考试(练习)

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. 46
      src/pages/station/preview/index.vue
  7. 1079
      src/pages/theoryExam/index.vue
  8. 6
      src/router/routes.js

@ -503,6 +503,11 @@ export default {
teacherModelList: `nakadai/nakadai/model/reference/demo/teacherModelList`,
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`,
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>
<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>
<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, {
mallId: this.id
})
// 10
// 10-1
this.overdue = isRenew
},
// tab

@ -52,8 +52,8 @@
<div class="catalog">
<div class="m-b-20">
<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="practicePracticeProject" 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(0)">进入实训</el-button>
</div>
<div class="list">
<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"
:close-on-click-modal="false">
<ul class="projects">
<template v-if="isTheory">
<li v-for="(item, i) in papers" :key="i" :class="{ active: curPaper == item.paperId }"
@click="selectPaper(item)">
<img src="@/assets/img/project.png" alt="">
<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>
<span slot="footer" class="dialog-footer">
@ -358,8 +367,11 @@ export default {
videoSrc: '',
desShrink: false,
projectVisible: false,
isTheory: 0,
projects: [],
papers: [],
loading: false,
curPaper: '',
curProject: '',
overdue: 0, //
buyVisible: false,
@ -466,7 +478,7 @@ export default {
this.$get(this.api.whetherToRenewTheFee, {
mallId: this.mallId
}).then(({ isRenew }) => {
// 10
// 10-1
this.overdue = isRenew
this.getChapter()
this.getProgress()
@ -698,7 +710,7 @@ export default {
},
preview (row, chapterName, showDia = 0) {
//
if (this.overdue || showDia) {
if (this.overdue === 1 || showDia) {
this.curLink = `${chapterName}${row.name}`; // +
this.playAuth = ''
this.coverUrl = ''
@ -795,12 +807,17 @@ export default {
fullScreen () {
this.pdfVisible = true
},
//
selectPaper (item) {
this.curPaper = item.paperId
},
//
selectProject (item) {
this.curProject = item.projectId
},
//
showProjectDia () {
showProjectDia (isTheory) {
this.isTheory = isTheory
this.projectVisible = true
},
//
@ -810,8 +827,9 @@ export default {
cId: this.courseId, // id
mallId: this.mallId,
permissions: 0 // 0: ,1:
}).then(({ projects }) => {
this.projects = projects
}).then(res => {
this.projects = res.projects //
this.papers = res.exercisePaperList //
}).catch(res => { })
},
//
@ -829,7 +847,12 @@ export default {
})
},
//
entry () {
entry (isTheory) {
if (isTheory) {
//
this.showProjectDia(1)
} else {
//
// (python)
if (this.systemIds.split(',').includes('19')) { //
this.$post(`${this.api.getSandTableLastCache}?cid=${this.courseId}`).then(res => {
@ -865,6 +888,7 @@ export default {
this.showProjectDia()
})
}
}
},
// python
toPython (projectId) {
@ -895,6 +919,11 @@ export default {
},
//
async toSub () {
//
if (this.isTheory) {
window.open(this.$router.resolve(`/theoryExam?paperId=${this.curPaper}&cid=${this.courseId}&mallId=${this.mallId}&curriculumName=${this.curriculumName}`).href)
} else {
//
let curProject = this.projects.find(e => e.projectId == this.curProject)
if (!curProject && this.projects.length) {
curProject = this.projects[0]
@ -921,6 +950,7 @@ export default {
}
}
}
}
};
</script>

File diff suppressed because it is too large Load Diff

@ -47,6 +47,12 @@ const frameOut = [
path: `/match/preview`,
component: () => import("@/pages/match/preview"),
meta: { title: "赛事预览" }
},
{
name: `theoryExam`,
path: `/theoryExam`,
component: () => import("@/pages/theoryExam"),
meta: { title: "理论考试" }
}
];
/**

Loading…
Cancel
Save