|
|
|
@ -137,6 +137,7 @@ import util from '@/util' |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
systemId: util.getCookie('systemId'), |
|
|
|
|
classId: util.getCookie('classId'), |
|
|
|
|
className: util.getCookie('className') ? decodeURI(util.getCookie('className')) : '', |
|
|
|
|
courseId: util.getCookie('courseId'), |
|
|
|
@ -190,7 +191,7 @@ export default { |
|
|
|
|
// 获取项目列表 |
|
|
|
|
getList(){ |
|
|
|
|
let data = { |
|
|
|
|
systemId: 1, |
|
|
|
|
systemId: this.systemId, |
|
|
|
|
cId: this.courseId, // 课程id |
|
|
|
|
permissions: this.projectPermissions // 练习/考核 |
|
|
|
|
} |
|
|
|
@ -221,6 +222,7 @@ export default { |
|
|
|
|
points.map(e => { |
|
|
|
|
e.code = '' // 后端返回的字段没有code,要手动加上以存储运行的代码 |
|
|
|
|
e.codeId = '' // 代码通过接口传给后端运行后,接口会返回一个codeId,提交的时候需要传这个codeId |
|
|
|
|
e.answer = '' // 代码运行结果 |
|
|
|
|
}) |
|
|
|
|
this.points = points |
|
|
|
|
this.taskList = points // 实验任务 |
|
|
|
@ -267,7 +269,7 @@ export default { |
|
|
|
|
const item = points.find(e => e.judgmentId === judgmentId) |
|
|
|
|
if (item) item.code = code |
|
|
|
|
this.$emit('tell', projectId, points) |
|
|
|
|
this.$emit('recoveryCode', points.findIndex(e => e.judgmentId === judgmentId) + '') |
|
|
|
|
this.$emit('recoveryCode', points.findIndex(e => e.judgmentId === judgmentId) + '') // 切换为缓存的判分点,tab索引值要为字符串 |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
} else { |
|
|
|
|
const item = this.points.find(e => e.judgmentId === judgmentId) |
|
|
|
@ -290,9 +292,8 @@ export default { |
|
|
|
|
this.isSubmit = false |
|
|
|
|
this.countVal = 0 |
|
|
|
|
this.grade = '00' |
|
|
|
|
// 切换实训项目-标签页回到第一个位置 |
|
|
|
|
this.$emit('recoveryCode') |
|
|
|
|
newmain.$emit('isSubmit', this.isSubmit) |
|
|
|
|
this.$emit('recoveryCode') // 切换实训项目后回到第一个判分点 |
|
|
|
|
newmain.$emit('isSubmit', this.isSubmit) // 选择项目后把提交状态重置为未提交 |
|
|
|
|
}, |
|
|
|
|
//重新开始 |
|
|
|
|
reload() { |
|
|
|
@ -330,11 +331,11 @@ export default { |
|
|
|
|
// 判分点参数 |
|
|
|
|
const attributesReqList = [] |
|
|
|
|
pointList.map(e => { |
|
|
|
|
e.codeId && attributesReqList.push({ |
|
|
|
|
attributesReqList.push({ |
|
|
|
|
codeId: e.codeId, |
|
|
|
|
bcId: e.judgmentId, |
|
|
|
|
score: e.score, |
|
|
|
|
isSubmit: 0 |
|
|
|
|
isSubmit: e.codeId ? 1 : 0, |
|
|
|
|
answer: e.answer |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
const data = { |
|
|
|
|