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

updates

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