|
|
@ -175,7 +175,7 @@ export default { |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted() { |
|
|
|
this.projectPermissions = this.projectId ? 1 : 0 // 考核/练习 |
|
|
|
this.projectPermissions = this.projectId ? 1 : 0 // 1:考核,0:练习 |
|
|
|
if(this.projectId){ // 考核(考核才会从外面带进来projectId,练习是默认显示第一个项目) |
|
|
|
if(this.projectId){ // 考核(考核才会从外面带进来projectId,练习是默认显示第一个项目) |
|
|
|
this.getAssList() |
|
|
|
this.getAssList() |
|
|
|
}else{ // 练习 |
|
|
|
}else{ // 练习 |
|
|
@ -269,7 +269,9 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
if (!done) { |
|
|
|
if (!done) { |
|
|
|
this.getList() |
|
|
|
this.getList().then(() => { |
|
|
|
|
|
|
|
this.getCache() |
|
|
|
|
|
|
|
}).catch(res => {}) |
|
|
|
// 查询考核状态定时器 |
|
|
|
// 查询考核状态定时器 |
|
|
|
this.statusTimer = setInterval(_ => { |
|
|
|
this.statusTimer = setInterval(_ => { |
|
|
|
this.getStatus() |
|
|
|
this.getStatus() |
|
|
@ -281,10 +283,13 @@ export default { |
|
|
|
getCache(pId, jId) { |
|
|
|
getCache(pId, jId) { |
|
|
|
const projectId = pId || this.projectId |
|
|
|
const projectId = pId || this.projectId |
|
|
|
const judgmentId = jId || this.judgmentId |
|
|
|
const judgmentId = jId || this.judgmentId |
|
|
|
|
|
|
|
const cid = this.courseId |
|
|
|
|
|
|
|
const assessmentId = this.assessmentId |
|
|
|
this.$post(this.api.getLastCache, { |
|
|
|
this.$post(this.api.getLastCache, { |
|
|
|
|
|
|
|
assessmentId: assessmentId ? Number(assessmentId) : '', |
|
|
|
bcId: judgmentId, // 如果传进来了判分点id,说明本地有缓存,则直接取本地缓存的判分点id,否则,取第一个项目的第一个判分点id |
|
|
|
bcId: judgmentId, // 如果传进来了判分点id,说明本地有缓存,则直接取本地缓存的判分点id,否则,取第一个项目的第一个判分点id |
|
|
|
projectId, // 项目id,同上 |
|
|
|
projectId, // 项目id,同上 |
|
|
|
cid: this.courseId // 课程id |
|
|
|
cid // 课程id |
|
|
|
}).then(res => { |
|
|
|
}).then(res => { |
|
|
|
const code = res.getLastCache |
|
|
|
const code = res.getLastCache |
|
|
|
// 如果有缓存代码,再提示用户是否要继续上次的实验 |
|
|
|
// 如果有缓存代码,再提示用户是否要继续上次的实验 |
|
|
@ -314,13 +319,20 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
}).catch(() => { |
|
|
|
localStorage.removeItem('codeCache') |
|
|
|
localStorage.removeItem('codeCache') |
|
|
|
|
|
|
|
this.$post(`${this.api.delCache}`, { |
|
|
|
|
|
|
|
assessmentId, |
|
|
|
|
|
|
|
bcId: judgmentId, |
|
|
|
|
|
|
|
projectId, |
|
|
|
|
|
|
|
cid |
|
|
|
|
|
|
|
}).then(res => {}).catch(() => {}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 定时查询考核状态(只有考核才需要定时查,查到考核如果结束后,直接提交考核) |
|
|
|
// 定时查询考核状态(只有考核才需要定时查,查到考核如果结束后,直接提交考核) |
|
|
|
getStatus() { |
|
|
|
getStatus() { |
|
|
|
this.$get(this.api.getDetailById, { |
|
|
|
// 未提交才需要查询状态 |
|
|
|
|
|
|
|
this.isSubmit || this.$get(this.api.getDetailById, { |
|
|
|
id: this.assessmentId |
|
|
|
id: this.assessmentId |
|
|
|
}).then(res => { |
|
|
|
}).then(res => { |
|
|
|
const done = res.data ? res.data.status === 2 : false // 状态(0、待开始 1、进行中 2、已结束) |
|
|
|
const done = res.data ? res.data.status === 2 : false // 状态(0、待开始 1、进行中 2、已结束) |
|
|
@ -376,6 +388,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 提交 |
|
|
|
// 提交 |
|
|
|
submit() { |
|
|
|
submit() { |
|
|
|
|
|
|
|
if (this.isSubmit) return false |
|
|
|
const pointList = this.$parent.workbench |
|
|
|
const pointList = this.$parent.workbench |
|
|
|
const date = new Date() |
|
|
|
const date = new Date() |
|
|
|
const entryTime = this.entryTime |
|
|
|
const entryTime = this.entryTime |
|
|
@ -414,6 +427,7 @@ export default { |
|
|
|
localStorage.removeItem('codeCache') |
|
|
|
localStorage.removeItem('codeCache') |
|
|
|
this.isSubmit = true |
|
|
|
this.isSubmit = true |
|
|
|
newmain.$emit('isSubmit', this.isSubmit) |
|
|
|
newmain.$emit('isSubmit', this.isSubmit) |
|
|
|
|
|
|
|
clearInterval(this.statusTimer) |
|
|
|
let list = res.retInfo |
|
|
|
let list = res.retInfo |
|
|
|
let taskList = this.taskList |
|
|
|
let taskList = this.taskList |
|
|
|
var score = 0 |
|
|
|
var score = 0 |
|
|
|