提交 e32c2cad authored 作者: GOD_ZYX's avatar GOD_ZYX

update

上级 ede512a4
...@@ -62,6 +62,8 @@ export default { ...@@ -62,6 +62,8 @@ export default {
} else if (_course.chapters[i2].id === 'teach_evaluation') { } else if (_course.chapters[i2].id === 'teach_evaluation') {
// window.localStorage.setItem('headerInfo', JSON.stringify(this.headerInfo)) // window.localStorage.setItem('headerInfo', JSON.stringify(this.headerInfo))
this.$router.push({ path: `/survey/${sid}/${cid}` }) this.$router.push({ path: `/survey/${sid}/${cid}` })
} else if (_course.chapters[i2].type === 'exam') {
this.$router.push({ path: `/player/${sid}/${cid}/exam/${_id}` })
} }
return return
} }
......
...@@ -120,7 +120,7 @@ export default class API { ...@@ -120,7 +120,7 @@ export default class API {
message: '已取消,将不再记录任何数据操作,除非重新登录' message: '已取消,将不再记录任何数据操作,除非重新登录'
}) })
}) })
} else if (data.status !== 200 && data.message) { } else if (data.status !== 200 && data.message && !data.code) {
err = new Error(data.message) err = new Error(data.message)
throw err throw err
} else { } else {
......
...@@ -100,6 +100,17 @@ export default { ...@@ -100,6 +100,17 @@ export default {
// } // }
// }) // })
} }
},
watch: {
filesArr: {
immediate: true,
deep: true,
handler (value) {
if (this.formData[this.item.model].length !== value.length) {
this.formData[this.item.model] = value
}
}
}
} }
} }
</script> </script>
......
...@@ -116,6 +116,13 @@ export default class ChapterAction { ...@@ -116,6 +116,13 @@ export default class ChapterAction {
id: 'teach_evaluation' id: 'teach_evaluation'
}] }]
}) })
if (_res.course_examination) {
json.course[json.course.length - 1].chapters.push({
name: '课程考试',
type: 'exam',
id: _res.course_examination
})
}
let courseWork = _res.curriculum || {} let courseWork = _res.curriculum || {}
courseWork['end_date'] = _res.end_date courseWork['end_date'] = _res.end_date
courseWork['essay_date'] = _res.essay_date courseWork['essay_date'] = _res.essay_date
......
...@@ -149,6 +149,17 @@ export default class CourseAction { ...@@ -149,6 +149,17 @@ export default class CourseAction {
sid: sid, sid: sid,
cid: cid cid: cid
}) })
if (cur.course_examination) {
json.tabs1ChapterList.course.push({
title: '课程考试',
isUp: true,
chapters: [],
type: 'exam',
sid: sid,
cid: cid,
examId: cur.course_examination
})
}
/* 课程考核 考核标准文案读取 */ /* 课程考核 考核标准文案读取 */
json.tabs3richTest = cur.course_evaluation json.tabs3richTest = cur.course_evaluation
// callback(json) // 可以不使用callback 因为使用then // callback(json) // 可以不使用callback 因为使用then
......
import { examApi } from '@services' import { examApi } from '@services'
import Base64 from 'Base64'
export default class ExamAction { export default class ExamAction {
/* 获取考卷信息 */ /* 获取考卷信息 */
...@@ -7,6 +8,7 @@ export default class ExamAction { ...@@ -7,6 +8,7 @@ export default class ExamAction {
let exam = {} let exam = {}
exam.id = _res.id exam.id = _res.id
exam.title = _res.title exam.title = _res.title
exam.score = {}
exam.radioList = _res.examination.radioList exam.radioList = _res.examination.radioList
for (let i = 0; i < exam.radioList.length; i++) { for (let i = 0; i < exam.radioList.length; i++) {
exam.radioList[i].user_answer = '' exam.radioList[i].user_answer = ''
...@@ -51,26 +53,32 @@ export default class ExamAction { ...@@ -51,26 +53,32 @@ export default class ExamAction {
/* 获取考卷结果 */ /* 获取考卷结果 */
getExamAnswer (cid, sid, eid) { getExamAnswer (cid, sid, eid) {
return examApi.getExamAnswer(cid, sid, eid).then(_res => { return examApi.getExamAnswer(cid, sid, eid).then(_res => {
if (_res.code) { return _res }
let exam = {} let exam = {}
let tmp = null
exam.id = _res.id exam.id = _res.id
exam.title = _res.title exam.title = _res.title
exam.type = _res.type
exam.score = _res.score
exam.submitted_time = _res.submitted_time
exam.radioList = _res.sheet.radioList exam.radioList = _res.sheet.radioList
for (let i = 0; i < exam.radioList.length; i++) { for (let i = 0; i < exam.radioList.length; i++) {
let tmp = exam.radioList[i] tmp = exam.radioList[i]
if (!tmp.user_answer) tmp.user_answer = '' if (!tmp.user_answer) tmp.user_answer = ''
if (!tmp.right_answer) tmp.right_answer = '' if (!tmp.right_answer) tmp.right_answer = ''
if (!tmp.get_score) tmp.get_score = -1 if (!tmp.get_score) tmp.get_score = -1
} }
exam.checkboxList = _res.sheet.checkboxList exam.checkboxList = _res.sheet.checkboxList
for (let i = 0; i < exam.checkboxList.length; i++) { for (let i = 0; i < exam.checkboxList.length; i++) {
let tmp = exam.checkboxList[i] tmp = exam.checkboxList[i]
if (!tmp.user_answer || !tmp.user_answer.length) tmp.user_answer = [] if (!tmp.user_answer || !tmp.user_answer.length) tmp.user_answer = []
if (!tmp.right_answer || !tmp.right_answer.length) tmp.right_answer = [] if (!tmp.right_answer || !tmp.right_answer.length) tmp.right_answer = []
if (!tmp.get_score) tmp.get_score = -1 if (!tmp.get_score) tmp.get_score = -1
} }
exam.shortAnswerList = _res.sheet.shortAnswerList exam.shortAnswerList = _res.sheet.shortAnswerList
for (let i = 0; i < exam.shortAnswerList.length; i++) { for (let i = 0; i < exam.shortAnswerList.length; i++) {
let tmp = exam.shortAnswerList[i] tmp = exam.shortAnswerList[i]
tmp.user_answer = Base64.decode(tmp.user_answer.replace(' ', '+'), 'utf-8')
if (!tmp.attachments || !tmp.attachments.length) tmp.attachments = [] if (!tmp.attachments || !tmp.attachments.length) tmp.attachments = []
tmp.upload = { tmp.upload = {
type: 'upload-form', type: 'upload-form',
...@@ -78,14 +86,14 @@ export default class ExamAction { ...@@ -78,14 +86,14 @@ export default class ExamAction {
model: 'attachments', model: 'attachments',
action: webConf.apiBaseURL + '/util/upload-file', action: webConf.apiBaseURL + '/util/upload-file',
data: { data: {
special: 'exam', special: 'exam'
},
attrs: {
multiple: true,
headers: { headers: {
'tenant': 'sofia' 'tenant': 'sofia'
} }
}, },
attrs: {
multiple: true
},
html: ` html: `
<div style="color: #72818c; font-size: 14px;"> <div style="color: #72818c; font-size: 14px;">
<p style="margin: 0;">支持doc,docx,ppt,xls,txt,rar,zip,pdf,jpg,pic,png格式的文件,文件小于30M。</p> <p style="margin: 0;">支持doc,docx,ppt,xls,txt,rar,zip,pdf,jpg,pic,png格式的文件,文件小于30M。</p>
......
...@@ -483,6 +483,8 @@ export default { ...@@ -483,6 +483,8 @@ export default {
// } else { // } else {
// this.$router.push({ path: `/survey-phone/${sid}/${cid}` }) // this.$router.push({ path: `/survey-phone/${sid}/${cid}` })
// } // }
} else if (course.type === 'exam') {
this.$router.push({ path: `/player/${sid}/${cid}/exam/${course.examId}` })
} }
} }
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论