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

update

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