提交 34170278 authored 作者: 王鹏飞's avatar 王鹏飞

updates

上级 c84edffb
...@@ -70,7 +70,7 @@ export default { ...@@ -70,7 +70,7 @@ export default {
title: '模拟考试', title: '模拟考试',
icon: 'icon-bianzuhong', icon: 'icon-bianzuhong',
children: [ children: [
{ tag: 'menu_exam_index', title: '模拟考试', path: '/exam/mock' }, { tag: 'menu_exam_index', title: '模拟考试', path: '/exam/exam' },
{ tag: 'menu_exam_wq', title: '错题集合', path: '/exam/questions/wrong' }, { tag: 'menu_exam_wq', title: '错题集合', path: '/exam/questions/wrong' },
{ tag: 'menu_exam_cq', title: '收藏试题', path: '/exam/questions/collection' } { tag: 'menu_exam_cq', title: '收藏试题', path: '/exam/questions/collection' }
] ]
...@@ -94,8 +94,8 @@ export default { ...@@ -94,8 +94,8 @@ export default {
title: '模拟考试', title: '模拟考试',
icon: 'icon-bianzuhong', icon: 'icon-bianzuhong',
children: [ children: [
{ tag: 'menu_exam_paper_review', title: '考卷批阅', path: '/teacher/exam/mock' }, { tag: 'menu_exam_paper_review', title: '考卷批阅', path: '/teacher/exam/exam' },
{ tag: 'menu_exam_exercise_review', title: '习题批阅', path: '/teacher/exam/chapter' } { tag: 'menu_exam_exercise_review', title: '习题批阅', path: '/teacher/exam/test' }
] ]
}, },
{ {
......
...@@ -77,7 +77,7 @@ export default { ...@@ -77,7 +77,7 @@ export default {
} }
}, },
toExamPage(data, type) { toExamPage(data, type) {
const path = type === 3 ? '/exam/chapter/result' : '/exam/chapter/exam' const path = type === 3 ? '/exam/test/result' : '/exam/test/exam'
this.$router.push({ this.$router.push({
path: path, path: path,
query: { course_id: this.courseId, chapter_id: data.id, type, exam_id: data.resource_id } query: { course_id: this.courseId, chapter_id: data.id, type, exam_id: data.resource_id }
......
...@@ -125,7 +125,7 @@ export default { ...@@ -125,7 +125,7 @@ export default {
this.$router.push({ name: 'viewerCourseChapter', params: { cid: this.courseId, id: data.id } }) this.$router.push({ name: 'viewerCourseChapter', params: { cid: this.courseId, id: data.id } })
}, },
toExamPage(data, type) { toExamPage(data, type) {
const path = type === 3 ? '/exam/chapter/result' : '/exam/chapter/exam' const path = type === 3 ? '/exam/test/result' : '/exam/test/exam'
this.$router.push({ this.$router.push({
path: path, path: path,
query: { course_id: this.courseId, chapter_id: data.id, type, exam_id: data.resource_id } query: { course_id: this.courseId, chapter_id: data.id, type, exam_id: data.resource_id }
......
...@@ -3,11 +3,11 @@ const routes = [ ...@@ -3,11 +3,11 @@ const routes = [
path: '/', path: '/',
component: () => import('@/components/layout/index.vue'), component: () => import('@/components/layout/index.vue'),
children: [ children: [
{ path: '/exam/mock', component: () => import('./views/Index.vue') }, { path: '/exam/exam', component: () => import('./views/Index.vue') },
{ path: '/exam/mock/result', component: () => import('./views/Result.vue') } { path: '/exam/exam/result', component: () => import('./views/Result.vue') }
] ]
}, },
{ path: '/exam/mock/exam', component: () => import('./views/Exam.vue') } { path: '/exam/exam/exam', component: () => import('./views/Exam.vue') }
] ]
export { routes } export { routes }
...@@ -68,7 +68,7 @@ export default { ...@@ -68,7 +68,7 @@ export default {
}, },
// 返回 // 返回
handleBack() { handleBack() {
this.$router.push('/exam/mock') this.$router.push('/exam/exam')
}, },
// 提交考卷 isCache:0缓存,1提交 // 提交考卷 isCache:0缓存,1提交
submitExam(isCache) { submitExam(isCache) {
...@@ -94,10 +94,11 @@ export default { ...@@ -94,10 +94,11 @@ export default {
confirmButtonText: '确认提交', confirmButtonText: '确认提交',
cancelButtonText: '继续作答', cancelButtonText: '继续作答',
type: 'warning' type: 'warning'
}).then(() => { })
.then(() => {
this.submitApi(id, isCache, answer, refData.duration) this.submitApi(id, isCache, answer, refData.duration)
}).catch(() => {
}) })
.catch(() => {})
} else { } else {
this.submitApi(id, isCache, answer, refData.duration) this.submitApi(id, isCache, answer, refData.duration)
} }
...@@ -115,7 +116,7 @@ export default { ...@@ -115,7 +116,7 @@ export default {
api.setCache(param).then(response => { api.setCache(param).then(response => {
if (isCache) { if (isCache) {
clearInterval(this.cacheAnswerTime) clearInterval(this.cacheAnswerTime)
this.$router.replace({ path: '/exam/mock/result', query: { exam_id: this.examId } }) this.$router.replace({ path: '/exam/exam/result', query: { exam_id: this.examId } })
} }
}) })
} }
......
<template> <template>
<app-container title="模拟考试"> <app-container title="模拟考试">
<template #header-right> <template #header-right>
<el-select v-model="courseId" @change="getExamList" placeholder="请选择课程" clearable style="width:300px"> <el-select v-model="courseId" @change="getExamList" placeholder="请选择课程" clearable style="width: 300px">
<el-option v-for="item in courseList" :key="item.id" :label="item.course_name" :value="item.id"></el-option> <el-option v-for="item in courseList" :key="item.id" :label="item.course_name" :value="item.id"></el-option>
</el-select> </el-select>
</template> </template>
...@@ -52,10 +52,10 @@ export default { ...@@ -52,10 +52,10 @@ export default {
this.open(item) this.open(item)
} else if ([1, 2].includes(item.status)) { } else if ([1, 2].includes(item.status)) {
// 已完成 // 已完成
this.$router.push({ path: '/exam/mock/result', query: { exam_id: item.id } }) this.$router.push({ path: '/exam/exam/result', query: { exam_id: item.id } })
} else { } else {
// 未做 // 未做
this.$router.push({ path: '/exam/mock/exam', query: { exam_id: item.id, is_create: 0 } }) this.$router.push({ path: '/exam/exam/exam', query: { exam_id: item.id, is_create: 0 } })
} }
}, },
open(item) { open(item) {
...@@ -68,11 +68,11 @@ export default { ...@@ -68,11 +68,11 @@ export default {
distinguishCancelAndClose: true distinguishCancelAndClose: true
}) })
.then(() => { .then(() => {
this.$router.push({ path: '/exam/mock/exam', query: { exam_id: item.id, is_create: 0 } }) this.$router.push({ path: '/exam/exam/exam', query: { exam_id: item.id, is_create: 0 } })
}) })
.catch(action => { .catch(action => {
if (action === 'cancel') { if (action === 'cancel') {
this.$router.push({ path: '/exam/mock/exam', query: { exam_id: item.id, is_create: 1 } }) this.$router.push({ path: '/exam/exam/exam', query: { exam_id: item.id, is_create: 1 } })
} }
}) })
} }
......
...@@ -36,9 +36,7 @@ ...@@ -36,9 +36,7 @@
</div> </div>
<template v-if="status !== '2'"> <p class="text">请等待老师评分~</p></template> <template v-if="status !== '2'"> <p class="text">请等待老师评分~</p></template>
<template v-else> <template v-else>
<p class="text" v-if="percent < 0.8"> <p class="text" v-if="percent < 0.8">您离成功还有一段距离,继续努力!</p>
您离成功还有一段距离,继续努力!
</p>
<div class="chart-box"> <div class="chart-box">
<div class="chart-item"> <div class="chart-item">
<div class="chart-title">总分</div> <div class="chart-title">总分</div>
...@@ -109,7 +107,7 @@ export default { ...@@ -109,7 +107,7 @@ export default {
methods: { methods: {
goPage(param) { goPage(param) {
this.$router.push({ this.$router.push({
path: '/exam/mock/exam', path: '/exam/exam/exam',
query: { exam_id: this.examId, id: param } query: { exam_id: this.examId, id: param }
}) })
}, },
......
...@@ -2,9 +2,9 @@ const routes = [ ...@@ -2,9 +2,9 @@ const routes = [
{ {
path: '/', path: '/',
component: () => import('@/components/layout/index.vue'), component: () => import('@/components/layout/index.vue'),
children: [{ path: '/exam/chapter/result', component: () => import('./views/Result.vue') }] children: [{ path: '/exam/test/result', component: () => import('./views/Result.vue') }]
}, },
{ path: '/exam/chapter/exam', component: () => import('./views/Exam.vue') } { path: '/exam/test/exam', component: () => import('./views/Exam.vue') }
] ]
export { routes } export { routes }
...@@ -83,7 +83,7 @@ export default { ...@@ -83,7 +83,7 @@ export default {
this.cacheAnswerTime && clearInterval(this.cacheAnswerTime) // 停止缓存 this.cacheAnswerTime && clearInterval(this.cacheAnswerTime) // 停止缓存
api.setCourseCache(params).then(res => { api.setCourseCache(params).then(res => {
this.$router.replace({ this.$router.replace({
path: '/exam/chapter/result', path: '/exam/test/result',
query: Object.assign({}, this.$route.query, { type: 2 }) query: Object.assign({}, this.$route.query, { type: 2 })
}) })
}) })
......
...@@ -45,9 +45,7 @@ ...@@ -45,9 +45,7 @@
</div> --> </div> -->
<template v-if="status !== '2'"> <p class="text">请等待老师评分~</p></template> <template v-if="status !== '2'"> <p class="text">请等待老师评分~</p></template>
<template v-else> <template v-else>
<p class="text" v-if="percent < 0.8"> <p class="text" v-if="percent < 0.8">您离成功还有一段距离,继续努力!</p>
您离成功还有一段距离,继续努力!
</p>
<div class="chart-box"> <div class="chart-box">
<div class="chart-item"> <div class="chart-item">
<div class="chart-title">总分</div> <div class="chart-title">总分</div>
...@@ -120,7 +118,7 @@ export default { ...@@ -120,7 +118,7 @@ export default {
const urlParam = this.$route.query const urlParam = this.$route.query
urlParam.id = param urlParam.id = param
urlParam.type = 2 urlParam.type = 2
this.$router.push({ path: '/exam/chapter/exam', query: urlParam }) this.$router.push({ path: '/exam/test/exam', query: urlParam })
}, },
getExamPapers() { getExamPapers() {
const param = { const param = {
......
...@@ -2,9 +2,9 @@ const routes = [ ...@@ -2,9 +2,9 @@ const routes = [
{ {
path: '/', path: '/',
component: () => import('@/components/layout/index.vue'), component: () => import('@/components/layout/index.vue'),
children: [{ path: '/teacher/exam/chapter', component: () => import('./views/Index.vue') }] children: [{ path: '/teacher/exam/test', component: () => import('./views/Index.vue') }]
}, },
{ path: '/teacher/exam/chapter/review', component: () => import('./views/Review.vue') } { path: '/teacher/exam/test/review', component: () => import('./views/Review.vue') }
] ]
export { routes } export { routes }
...@@ -75,7 +75,7 @@ export default { ...@@ -75,7 +75,7 @@ export default {
}, },
studentReview(data) { studentReview(data) {
this.$router.push({ this.$router.push({
path: '/teacher/exam/chapter/review', path: '/teacher/exam/test/review',
query: { sheet_id: data.sheet_id, stu_id: data.id } query: { sheet_id: data.sheet_id, stu_id: data.id }
}) })
}, },
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
v-model="item.user_score" v-model="item.user_score"
placeholder="请输入分数" placeholder="请输入分数"
size="mini" size="mini"
style="width:80px" style="width: 80px"
@input="handleScoreInput(item)" @input="handleScoreInput(item)"
></el-input> ></el-input>
</div> </div>
...@@ -138,7 +138,7 @@ export default { ...@@ -138,7 +138,7 @@ export default {
}, },
// 返回 // 返回
handleBack() { handleBack() {
this.$router.push('/teacher/exam/chapter') this.$router.push('/teacher/exam/test')
}, },
// 提交批阅 // 提交批阅
submitComment(item, data) { submitComment(item, data) {
......
...@@ -2,9 +2,9 @@ const routes = [ ...@@ -2,9 +2,9 @@ const routes = [
{ {
path: '/', path: '/',
component: () => import('@/components/layout/index.vue'), component: () => import('@/components/layout/index.vue'),
children: [{ path: '/teacher/exam/mock', component: () => import('./views/Index.vue') }] children: [{ path: '/teacher/exam/exam', component: () => import('./views/Index.vue') }]
}, },
{ path: '/teacher/exam/mock/review', component: () => import('./views/Review.vue') } { path: '/teacher/exam/exam/review', component: () => import('./views/Review.vue') }
] ]
export { routes } export { routes }
...@@ -52,7 +52,7 @@ export default { ...@@ -52,7 +52,7 @@ export default {
}, },
studentReview(data) { studentReview(data) {
this.$router.push({ this.$router.push({
path: '/teacher/exam/mock/review', path: '/teacher/exam/exam/review',
query: { sheet_id: data.sheet_id, stu_id: data.id } query: { sheet_id: data.sheet_id, stu_id: data.id }
}) })
} }
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
v-model="item.user_score" v-model="item.user_score"
placeholder="请输入分数" placeholder="请输入分数"
size="mini" size="mini"
style="width:80px" style="width: 80px"
@input="handleScoreInput(item)" @input="handleScoreInput(item)"
></el-input> ></el-input>
</div> </div>
...@@ -137,7 +137,7 @@ export default { ...@@ -137,7 +137,7 @@ export default {
}, },
// 返回 // 返回
handleBack() { handleBack() {
this.$router.push('/teacher/exam/mock') this.$router.push('/teacher/exam/exam')
}, },
// 提交批阅 // 提交批阅
submitComment(item, data) { submitComment(item, data) {
......
import store from '@/store' import store from '@/store'
export default async function(to, from, next) { export default async function (to, from, next) {
const { user_id: userId, student_id: studentId } = to.query const { user_id: userId, student_id: studentId } = to.query
if (userId && studentId) { if (userId && studentId) {
store.commit('setGuestUser', { user_id: userId, student_id: studentId }) store.commit('setGuestUser', { user_id: userId, student_id: studentId })
...@@ -15,8 +15,8 @@ export default async function(to, from, next) { ...@@ -15,8 +15,8 @@ export default async function(to, from, next) {
return return
} }
const isLogin = store.state.user.id || (await store.dispatch('checkLogin')) const isLogin = store.state.isLogin || (await store.dispatch('checkLogin'))
if (!isLogin) { if (to.meta.requiredLogin && !isLogin) {
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}` window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}`
return return
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论