|
|
@ -91,7 +91,7 @@ import util from '@/util' |
|
|
|
import config from '@/config' |
|
|
|
import config from '@/config' |
|
|
|
const CANCEL_TOKEN = axios.CancelToken // 用于input中中断请求 |
|
|
|
const CANCEL_TOKEN = axios.CancelToken // 用于input中中断请求 |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
props: ['workbench1', 'code', 'codeId', 'projectId'], |
|
|
|
props: ['judgmentId', 'code', 'codeId', 'projectId'], |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
token: util.getCookie('admin-token'), |
|
|
|
token: util.getCookie('admin-token'), |
|
|
@ -192,7 +192,7 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
axios.post(config.host + this.api.runPythonCode, { |
|
|
|
axios.post(config.host + this.api.runPythonCode, { |
|
|
|
code: this.sourceCode, |
|
|
|
code: this.sourceCode, |
|
|
|
bcId: this.workbench1, |
|
|
|
bcId: this.judgmentId, |
|
|
|
cid: this.courseId, |
|
|
|
cid: this.courseId, |
|
|
|
projectId: this.projectId |
|
|
|
projectId: this.projectId |
|
|
|
}, { |
|
|
|
}, { |
|
|
@ -238,7 +238,7 @@ export default { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
const inputTextReg = this.inputTextReg |
|
|
|
const inputTextReg = this.inputTextReg |
|
|
|
const inputFuncReg = /input\(['|"]/g |
|
|
|
const inputFuncReg = /input\(['|"]/g |
|
|
|
const bcId = this.workbench1 |
|
|
|
const bcId = this.judgmentId |
|
|
|
const cid = this.courseId |
|
|
|
const cid = this.courseId |
|
|
|
const projectId = this.projectId |
|
|
|
const projectId = this.projectId |
|
|
|
// 该正则是验证代码里是否有input,如果有,就要另外做处理,而不是直接传给后端执行 |
|
|
|
// 该正则是验证代码里是否有input,如果有,就要另外做处理,而不是直接传给后端执行 |
|
|
@ -342,7 +342,7 @@ export default { |
|
|
|
getTips() { |
|
|
|
getTips() { |
|
|
|
this.tipsVisible = true |
|
|
|
this.tipsVisible = true |
|
|
|
this.$get(this.api.queryBcJudgmentByBcId, { |
|
|
|
this.$get(this.api.queryBcJudgmentByBcId, { |
|
|
|
bcId: this.workbench1 |
|
|
|
bcId: this.judgmentId |
|
|
|
}).then(res => { |
|
|
|
}).then(res => { |
|
|
|
this.answer = res.experimentCode |
|
|
|
this.answer = res.experimentCode |
|
|
|
}).catch(err => {}) |
|
|
|
}).catch(err => {}) |
|
|
|