From 68cd027a599905cbbf10469248cda8047d917abf Mon Sep 17 00:00:00 2001 From: 18571350067 Date: Wed, 5 Jan 2022 19:49:54 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E4=B8=8B=E7=9A=84?= =?UTF-8?q?=E5=AD=90=E6=A8=A1=E5=9D=97=E8=BF=94=E5=9B=9E=E6=97=B6=E6=8A=A5?= =?UTF-8?q?404?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/course/CoursewareList.vue | 8 ++++++-- src/views/course/CoursewarePreview.vue | 23 +++++++++++----------- src/views/course/question/ExamQuestion.vue | 19 ++++++++++-------- 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/src/views/course/CoursewareList.vue b/src/views/course/CoursewareList.vue index 9127a79..cdf0e1d 100644 --- a/src/views/course/CoursewareList.vue +++ b/src/views/course/CoursewareList.vue @@ -118,7 +118,7 @@ export default { courseQuestion(record) { this.$router.push({ path: '/course/question/ExamQuestion', - query: { coursewareId: record.id, courseId: this.$route.query.id }, + query: { coursewareId: record.id, courseId: this.$route.query.id, types: this.$route.query.type }, }) }, @@ -128,7 +128,11 @@ export default { if (!this.courseId) preview = true this.$router.push({ path: '/course/CoursewarePreview', - query: { coursewareId: record.id, courseId: this.$route.query.id || this.courseId }, + query: { + coursewareId: record.id, + courseId: this.$route.query.id || this.courseId, + types: this.$route.query.type, + }, }) }, }, diff --git a/src/views/course/CoursewarePreview.vue b/src/views/course/CoursewarePreview.vue index c476095..2fbb293 100644 --- a/src/views/course/CoursewarePreview.vue +++ b/src/views/course/CoursewarePreview.vue @@ -99,13 +99,12 @@ export default { props: { coursewareId: { type: Number, - } - }, - watch: { + }, }, + watch: {}, data() { return { - images:[], + images: [], type: 1, isactive: 0, queryParam: { coursewareId: this.$route.query.coursewareId || this.coursewareId }, @@ -134,7 +133,7 @@ export default { } }, created() { - console.log('porp - coursewareId :',this.coursewareId) + console.log('porp - coursewareId :', this.coursewareId) let parameter = {} coursewareDeatil(Object.assign(parameter, this.queryParam)).then((res) => { //课件内容 @@ -142,8 +141,8 @@ export default { if (this.courseware.videoList.length > 0) { //视频截取的封面图 if (this.courseware.image != '' || this.courseware.image) { - this.images = this.courseware.image.split(","); - this.playerOptions.poster = this.images[0]; + this.images = this.courseware.image.split(',') + this.playerOptions.poster = this.images[0] } //课件视频展现 if (this.courseware.type == '1') this.play(this.courseware.videoList[0].path, 0) @@ -164,7 +163,10 @@ export default { methods: { //返回 goback() { - this.$router.push({ path: '/course/CoursewareList', query: { id: this.$route.query.courseId } }) + this.$router.push({ + path: '/course/CoursewareList', + query: { id: this.$route.query.courseId, type: this.$route.query.types }, + }) }, //选择播放的文件/下载的文件 @@ -178,10 +180,9 @@ export default { // 加载视频 this.playerOptions.sources = [] this.playerOptions.sources.push({ type: 'video/mp4', src: path }) - console.log("index",index); - console.log("images",this.images); + console.log('index', index) + console.log('images', this.images) this.playerOptions.poster = this.images[index] - } }, diff --git a/src/views/course/question/ExamQuestion.vue b/src/views/course/question/ExamQuestion.vue index f763069..279bfaf 100644 --- a/src/views/course/question/ExamQuestion.vue +++ b/src/views/course/question/ExamQuestion.vue @@ -26,8 +26,8 @@ export default { selectedRowKeys: [], selectedRows: [], form: { - ids:'', - coursewareId:'' + ids: '', + coursewareId: '', }, loadData: (parameter) => { return requiredList(Object.assign(parameter, this.queryParam)).then((res) => { @@ -47,7 +47,10 @@ export default { methods: { //返回到课件列表 goback() { - this.$router.push({ path: '/course/CoursewareList', query: { id: this.$route.query.courseId } }) + this.$router.push({ + path: '/course/CoursewareList', + query: { id: this.$route.query.courseId, type: this.$route.query.types }, + }) }, onSelectChange(selectedRowKeys, selectedRows) { @@ -59,15 +62,15 @@ export default { //确定 save() { - this.form.ids = this.selectedRowKeys.toString(); - this.form.coursewareId = this.$route.query.coursewareId; + this.form.ids = this.selectedRowKeys.toString() + this.form.coursewareId = this.$route.query.coursewareId console.log('from:{}', this.form) - + addOrUpdate(this.form).then((res) => { if (res.code == 200) { this.$message.info('保存成功') //新增完成后直接返回课程列表 - this.goback(); + this.goback() } }) }, @@ -77,7 +80,7 @@ export default { // 查询所有题目id列表 requiredQuestionId({ coursewareId: this.$route.query.coursewareId }).then((res) => { console.log('+++++++++++++', res) - this.selectedRowKeys = res.data; + this.selectedRowKeys = res.data }) }, }, From 8d3a51a604e6abc5b2df32d68a495c9a49b06447 Mon Sep 17 00:00:00 2001 From: 18571350067 Date: Mon, 10 Jan 2022 21:04:58 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=A2=98=E7=9B=AE=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/course/question/QuestionAdd.vue | 10 +++++----- src/views/course/question/QuestionList.vue | 11 +++++++++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/views/course/question/QuestionAdd.vue b/src/views/course/question/QuestionAdd.vue index fe6533c..6981f19 100644 --- a/src/views/course/question/QuestionAdd.vue +++ b/src/views/course/question/QuestionAdd.vue @@ -40,7 +40,7 @@ - + @@ -95,7 +95,7 @@ - + @@ -113,7 +113,7 @@ - + @@ -128,7 +128,7 @@ - + @@ -151,7 +151,7 @@ - + diff --git a/src/views/course/question/QuestionList.vue b/src/views/course/question/QuestionList.vue index 97df505..9a73af3 100644 --- a/src/views/course/question/QuestionList.vue +++ b/src/views/course/question/QuestionList.vue @@ -50,7 +50,7 @@ -
+
正确答案:    {{ questionDetail.rightAnswers }}
@@ -64,7 +64,7 @@
解析
- {{ questionDetail.asnwerParse }} + {{ questionDetail.answerParse }}
@@ -143,6 +143,13 @@ export default { if (this.questionDetail.questionType == '3') this.questionDetail.questionTypeName = '判断题' if (this.questionDetail.questionType == '4') this.questionDetail.questionTypeName = '简答题' if (this.questionDetail.questionType == '5') this.questionDetail.questionTypeName = '填空题' + + if(this.questionDetail.questionType == 3 && this.questionDetail.rightAnswers == 1) { + this.questionDetail.rightAnswers = '正确' + } else { + this.questionDetail.rightAnswers = '错误' + } + }) } },