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

chore: update

上级 5100075e
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
"axios": "^0.27.2", "axios": "^0.27.2",
"blueimp-md5": "^2.19.0", "blueimp-md5": "^2.19.0",
"dayjs": "^1.11.4", "dayjs": "^1.11.4",
"element-plus": "^2.2.10", "element-plus": "^2.2.11",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"pinia": "^2.0.17", "pinia": "^2.0.17",
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
"swiper": "^8.3.2", "swiper": "^8.3.2",
"video.js": "^7.20.1", "video.js": "^7.20.1",
"vue": "^3.2.37", "vue": "^3.2.37",
"vue-router": "^4.1.2" "vue-router": "^4.1.3"
}, },
"devDependencies": { "devDependencies": {
"@rushstack/eslint-patch": "^1.1.0", "@rushstack/eslint-patch": "^1.1.0",
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
"sass": "^1.54.0", "sass": "^1.54.0",
"typescript": "~4.7.4", "typescript": "~4.7.4",
"unplugin-auto-import": "^0.10.1", "unplugin-auto-import": "^0.10.1",
"vite": "^3.0.3", "vite": "^3.0.4",
"vue-tsc": "^0.39.0" "vue-tsc": "^0.39.0"
} }
}, },
...@@ -1457,9 +1457,9 @@ ...@@ -1457,9 +1457,9 @@
"dev": true "dev": true
}, },
"node_modules/element-plus": { "node_modules/element-plus": {
"version": "2.2.10", "version": "2.2.11",
"resolved": "https://registry.npmjs.org/element-plus/-/element-plus-2.2.10.tgz", "resolved": "https://registry.npmjs.org/element-plus/-/element-plus-2.2.11.tgz",
"integrity": "sha512-hJ+LlbRN3POu4Idl1LXB+SHSWdi+wwmdsoDXdQT2ynGuwzZsMYiusOooYXyEsPlrizeLibdnNGNDx4TIjXQvUg==", "integrity": "sha512-JjOvz5DLBc4Jp9OHKXNcK/Cys4NX5/vxpZ+gYmH2V+pLkwJnyIOrNZ3QxfdyG6yE4+NkpoA6koEgUB7T+0Z5vQ==",
"dependencies": { "dependencies": {
"@ctrl/tinycolor": "^3.4.1", "@ctrl/tinycolor": "^3.4.1",
"@element-plus/icons-vue": "^2.0.6", "@element-plus/icons-vue": "^2.0.6",
...@@ -1475,7 +1475,7 @@ ...@@ -1475,7 +1475,7 @@
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"lodash-unified": "^1.0.2", "lodash-unified": "^1.0.2",
"memoize-one": "^6.0.0", "memoize-one": "^6.0.0",
"normalize-wheel-es": "^1.1.2" "normalize-wheel-es": "^1.2.0"
}, },
"peerDependencies": { "peerDependencies": {
"vue": "^3.2.0" "vue": "^3.2.0"
...@@ -3277,9 +3277,9 @@ ...@@ -3277,9 +3277,9 @@
} }
}, },
"node_modules/normalize-wheel-es": { "node_modules/normalize-wheel-es": {
"version": "1.1.2", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/normalize-wheel-es/-/normalize-wheel-es-1.1.2.tgz", "resolved": "https://registry.npmjs.org/normalize-wheel-es/-/normalize-wheel-es-1.2.0.tgz",
"integrity": "sha512-scX83plWJXYH1J4+BhAuIHadROzxX0UBF3+HuZNY2Ks8BciE7tSTQ+5JhTsvzjaO0/EJdm4JBGrfObKxFf3Png==" "integrity": "sha512-Wj7+EJQ8mSuXr2iWfnujrimU35R2W4FAErEyTmJoJ7ucwTn2hOUSsRehMb5RSYkxXGTM7Y9QpvPmp++w5ftoJw=="
}, },
"node_modules/nth-check": { "node_modules/nth-check": {
"version": "2.1.1", "version": "2.1.1",
...@@ -4557,9 +4557,9 @@ ...@@ -4557,9 +4557,9 @@
} }
}, },
"node_modules/vite": { "node_modules/vite": {
"version": "3.0.3", "version": "3.0.4",
"resolved": "https://registry.npmjs.org/vite/-/vite-3.0.3.tgz", "resolved": "https://registry.npmjs.org/vite/-/vite-3.0.4.tgz",
"integrity": "sha512-sDIpIcl3mv1NUaSzZwiXGEy1ZoWwwC2vkxUHY6yiDacR6zf//ZFuBJrozO62gedpE43pmxnLATNR5IYUdAEkMQ==", "integrity": "sha512-NU304nqnBeOx2MkQnskBQxVsa0pRAH5FphokTGmyy8M3oxbvw7qAXts2GORxs+h/2vKsD+osMhZ7An6yK6F1dA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"esbuild": "^0.14.47", "esbuild": "^0.14.47",
...@@ -4672,9 +4672,9 @@ ...@@ -4672,9 +4672,9 @@
} }
}, },
"node_modules/vue-router": { "node_modules/vue-router": {
"version": "4.1.2", "version": "4.1.3",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.1.2.tgz", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.1.3.tgz",
"integrity": "sha512-5BP1qXFncVRwgV/XnqzsKApdMjQPqWIpoUBdL1ynz8HyLxIX/UDAx7Ql2BjmA5CXT/p61JfZvkpiFWFpaqcfag==", "integrity": "sha512-XvK81bcYglKiayT7/vYAg/f36ExPC4t90R/HIpzrZ5x+17BOWptXLCrEPufGgZeuq68ww4ekSIMBZY1qdUdfjA==",
"dependencies": { "dependencies": {
"@vue/devtools-api": "^6.1.4" "@vue/devtools-api": "^6.1.4"
}, },
...@@ -5884,9 +5884,9 @@ ...@@ -5884,9 +5884,9 @@
"dev": true "dev": true
}, },
"element-plus": { "element-plus": {
"version": "2.2.10", "version": "2.2.11",
"resolved": "https://registry.npmjs.org/element-plus/-/element-plus-2.2.10.tgz", "resolved": "https://registry.npmjs.org/element-plus/-/element-plus-2.2.11.tgz",
"integrity": "sha512-hJ+LlbRN3POu4Idl1LXB+SHSWdi+wwmdsoDXdQT2ynGuwzZsMYiusOooYXyEsPlrizeLibdnNGNDx4TIjXQvUg==", "integrity": "sha512-JjOvz5DLBc4Jp9OHKXNcK/Cys4NX5/vxpZ+gYmH2V+pLkwJnyIOrNZ3QxfdyG6yE4+NkpoA6koEgUB7T+0Z5vQ==",
"requires": { "requires": {
"@ctrl/tinycolor": "^3.4.1", "@ctrl/tinycolor": "^3.4.1",
"@element-plus/icons-vue": "^2.0.6", "@element-plus/icons-vue": "^2.0.6",
...@@ -5902,7 +5902,7 @@ ...@@ -5902,7 +5902,7 @@
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"lodash-unified": "^1.0.2", "lodash-unified": "^1.0.2",
"memoize-one": "^6.0.0", "memoize-one": "^6.0.0",
"normalize-wheel-es": "^1.1.2" "normalize-wheel-es": "^1.2.0"
}, },
"dependencies": { "dependencies": {
"@types/web-bluetooth": { "@types/web-bluetooth": {
...@@ -7181,9 +7181,9 @@ ...@@ -7181,9 +7181,9 @@
"dev": true "dev": true
}, },
"normalize-wheel-es": { "normalize-wheel-es": {
"version": "1.1.2", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/normalize-wheel-es/-/normalize-wheel-es-1.1.2.tgz", "resolved": "https://registry.npmjs.org/normalize-wheel-es/-/normalize-wheel-es-1.2.0.tgz",
"integrity": "sha512-scX83plWJXYH1J4+BhAuIHadROzxX0UBF3+HuZNY2Ks8BciE7tSTQ+5JhTsvzjaO0/EJdm4JBGrfObKxFf3Png==" "integrity": "sha512-Wj7+EJQ8mSuXr2iWfnujrimU35R2W4FAErEyTmJoJ7ucwTn2hOUSsRehMb5RSYkxXGTM7Y9QpvPmp++w5ftoJw=="
}, },
"nth-check": { "nth-check": {
"version": "2.1.1", "version": "2.1.1",
...@@ -8112,9 +8112,9 @@ ...@@ -8112,9 +8112,9 @@
} }
}, },
"vite": { "vite": {
"version": "3.0.3", "version": "3.0.4",
"resolved": "https://registry.npmjs.org/vite/-/vite-3.0.3.tgz", "resolved": "https://registry.npmjs.org/vite/-/vite-3.0.4.tgz",
"integrity": "sha512-sDIpIcl3mv1NUaSzZwiXGEy1ZoWwwC2vkxUHY6yiDacR6zf//ZFuBJrozO62gedpE43pmxnLATNR5IYUdAEkMQ==", "integrity": "sha512-NU304nqnBeOx2MkQnskBQxVsa0pRAH5FphokTGmyy8M3oxbvw7qAXts2GORxs+h/2vKsD+osMhZ7An6yK6F1dA==",
"dev": true, "dev": true,
"requires": { "requires": {
"esbuild": "^0.14.47", "esbuild": "^0.14.47",
...@@ -8180,9 +8180,9 @@ ...@@ -8180,9 +8180,9 @@
} }
}, },
"vue-router": { "vue-router": {
"version": "4.1.2", "version": "4.1.3",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.1.2.tgz", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.1.3.tgz",
"integrity": "sha512-5BP1qXFncVRwgV/XnqzsKApdMjQPqWIpoUBdL1ynz8HyLxIX/UDAx7Ql2BjmA5CXT/p61JfZvkpiFWFpaqcfag==", "integrity": "sha512-XvK81bcYglKiayT7/vYAg/f36ExPC4t90R/HIpzrZ5x+17BOWptXLCrEPufGgZeuq68ww4ekSIMBZY1qdUdfjA==",
"requires": { "requires": {
"@vue/devtools-api": "^6.1.4" "@vue/devtools-api": "^6.1.4"
} }
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
"axios": "^0.27.2", "axios": "^0.27.2",
"blueimp-md5": "^2.19.0", "blueimp-md5": "^2.19.0",
"dayjs": "^1.11.4", "dayjs": "^1.11.4",
"element-plus": "^2.2.10", "element-plus": "^2.2.11",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"pinia": "^2.0.17", "pinia": "^2.0.17",
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
"swiper": "^8.3.2", "swiper": "^8.3.2",
"video.js": "^7.20.1", "video.js": "^7.20.1",
"vue": "^3.2.37", "vue": "^3.2.37",
"vue-router": "^4.1.2" "vue-router": "^4.1.3"
}, },
"devDependencies": { "devDependencies": {
"@rushstack/eslint-patch": "^1.1.0", "@rushstack/eslint-patch": "^1.1.0",
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
"sass": "^1.54.0", "sass": "^1.54.0",
"typescript": "~4.7.4", "typescript": "~4.7.4",
"unplugin-auto-import": "^0.10.1", "unplugin-auto-import": "^0.10.1",
"vite": "^3.0.3", "vite": "^3.0.4",
"vue-tsc": "^0.39.0" "vue-tsc": "^0.39.0"
} }
} }
...@@ -12,7 +12,7 @@ interface Props { ...@@ -12,7 +12,7 @@ interface Props {
title?: string title?: string
submitButtonText?: string submitButtonText?: string
} }
const props = withDefaults(defineProps<Props>(), { title: '考试', submitButtonText: '交卷' }) const props = withDefaults(defineProps<Props>(), { title: '考试/测验', submitButtonText: '交卷' })
const emit = defineEmits<{ const emit = defineEmits<{
(e: 'update'): void (e: 'update'): void
...@@ -156,6 +156,7 @@ function genSubmitQuestion(questionList: PaperQuestionType[]) { ...@@ -156,6 +156,7 @@ function genSubmitQuestion(questionList: PaperQuestionType[]) {
height: calc(100vh - 105px); height: calc(100vh - 105px);
min-height: 600px; min-height: 600px;
background-color: #fff; background-color: #fff;
border-radius: 6px;
overflow: hidden; overflow: hidden;
} }
.course-exam-card-hd { .course-exam-card-hd {
......
...@@ -27,16 +27,20 @@ const questionNum = computed(() => { ...@@ -27,16 +27,20 @@ const questionNum = computed(() => {
] ]
} }
}) })
function genClass(data: any, index: number) { function genClass(data: PaperQuestionType, index: number) {
let hasUserAnswer = !!data.user_answer
if (data.children && data.children.length) {
!data.children.filter(item => !item.user_answer).length && (hasUserAnswer = true)
}
if (props.status === 3) { if (props.status === 3) {
return { return {
'is-success': data.user_answer_status, // 答对 'is-success': data.user_answer_status, // 答对
'is-error': !data.user_answer_status, // 答错 'is-error': !data.user_answer_status, // 答错
'is-info': !data.user_answer // 未答 'is-info': !hasUserAnswer // 未答
} }
} else { } else {
return { return {
'is-info': !!data.user_answer, // 已做 'is-info': hasUserAnswer, // 已做
'is-success': index === questionIndex // 当前 'is-success': index === questionIndex // 当前
} }
} }
......
...@@ -37,11 +37,17 @@ function toggleCollection(resource: CourseResourceType, section: CourseSectionTy ...@@ -37,11 +37,17 @@ function toggleCollection(resource: CourseResourceType, section: CourseSectionTy
source_id: resource.resource_id, source_id: resource.resource_id,
type: typeMap[resource.resource_type], type: typeMap[resource.resource_type],
status: resource.collection_count > 0 ? 0 : 1 status: resource.collection_count > 0 ? 0 : 1
}).then(res => { }).then(() => {
resource.collection_count = resource.collection_count > 0 ? 0 : 1 resource.collection_count = resource.collection_count > 0 ? 0 : 1
console.log(res)
}) })
} }
// 跳转链接
function targetUrl(resource: CourseResourceType, section: CourseSectionType, chapter: CourseChapterType) {
if (resource.resource_type === 3 || resource.resource_type === 9) {
return `/course/exam?course_id=${courseId}&semester_id=${semesterId}&paper_id=${resource.resource_id}&type=2`
}
return `/course/player?course_id=${courseId}&chapter_id=${chapter.id}&section_id=${section.id}&resource_id=${resource.resource_id}&semester_id=${semesterId}`
}
</script> </script>
<template> <template>
<el-collapse class="course-chapters"> <el-collapse class="course-chapters">
...@@ -52,10 +58,7 @@ function toggleCollection(resource: CourseResourceType, section: CourseSectionTy ...@@ -52,10 +58,7 @@ function toggleCollection(resource: CourseResourceType, section: CourseSectionTy
<template #title><i class="icon-chapter"></i>{{ section.name }}</template> <template #title><i class="icon-chapter"></i>{{ section.name }}</template>
<ul> <ul>
<li class="course-resource-item" v-for="resource in section.resources" :key="resource.id"> <li class="course-resource-item" v-for="resource in section.resources" :key="resource.id">
<router-link <router-link :to="targetUrl(resource, section, item)" target="_blank">
:to="`/course/player?course_id=${courseId}&chapter_id=${item.id}&section_id=${section.id}&resource_id=${resource.resource_id}&semester_id=${semesterId}`"
target="_blank"
>
<ResourceIcon :resourceType="resource.resource_type" /> <ResourceIcon :resourceType="resource.resource_type" />
{{ resource.name }} {{ resource.name }}
</router-link> </router-link>
......
...@@ -12,7 +12,8 @@ export const routes: Array<RouteRecordRaw> = [ ...@@ -12,7 +12,8 @@ export const routes: Array<RouteRecordRaw> = [
children: [{ path: 'view', component: () => import('./views/CourseView.vue'), props: true }] children: [{ path: 'view', component: () => import('./views/CourseView.vue'), props: true }]
}, },
{ path: 'player', component: () => import('./views/CoursePlayer.vue'), props: true }, { path: 'player', component: () => import('./views/CoursePlayer.vue'), props: true },
{ path: 'exam', component: () => import('./views/CourseExam.vue'), props: true } { path: 'exam', component: () => import('./views/CourseExam.vue'), props: true },
{ path: 'exam/result', component: () => import('./views/CourseExamResult.vue'), props: true }
] ]
} }
] ]
<script setup lang="ts">
import type { PaperQuestionType } from '@/types'
import { getPaper } from '../api'
const route = useRoute()
const courseId = $ref(route.query.course_id as string)
const semesterId = $ref(route.query.semester_id as string)
const paperId = $ref(route.query.paper_id as string)
const type = $ref(parseInt(route.query.type as string))
const detail = reactive({ status: 1 })
let questionList = $ref<PaperQuestionType[]>([])
provide('questionList', $$(questionList))
let loading = $ref<boolean>(false)
// 获取试卷详情
function fetchInfo() {
loading = true
getPaper({ course_id: courseId, semester_id: semesterId, paper_id: paperId, type }).then(res => {
const { question, status, score_details } = res.data
Object.assign(detail, res.data)
questionList = status === 3 ? score_details : question
loading = false
})
}
onMounted(() => {
fetchInfo()
})
</script>
<template>
<div class="course-exam-result" v-loading="loading">
<div class="course-exam-card"></div>
<div class="course-exam-card">
<el-button size="large">全部解析</el-button>
</div>
</div>
</template>
<style lang="scss" scoped>
.course-exam-result {
display: flex;
height: 100%;
}
.course-exam-card {
flex: 1;
height: 100%;
background-color: #fff;
border-radius: 6px;
}
</style>
...@@ -65,7 +65,7 @@ function toggleCollection(data: CollectionType) { ...@@ -65,7 +65,7 @@ function toggleCollection(data: CollectionType) {
} }
// 是否可以下载 // 是否可以下载
function canDownload(type: number) { function canDownload(type: number) {
return [1, 3, 4, 5].includes(type) return [1, 3, 4].includes(type)
} }
// 下载资源 // 下载资源
function downloadFile(data: CollectionType) { function downloadFile(data: CollectionType) {
......
...@@ -147,6 +147,7 @@ export interface PaperQuestionType { ...@@ -147,6 +147,7 @@ export interface PaperQuestionType {
children?: PaperQuestionType[] children?: PaperQuestionType[]
user_answer: string user_answer: string
reviews?: string reviews?: string
user_answer_status?: boolean
} }
export interface PaperQuestionOptionType { export interface PaperQuestionOptionType {
checked_option: string checked_option: string
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论