提交提示

ui
jialong.yu 3 years ago
parent b367a5cb93
commit 8e717662d6
  1. 11
      src/components/TestPanel.vue
  2. 8
      src/components/codemirror.vue
  3. 2
      src/views/Home.vue

@ -376,11 +376,12 @@ export default {
// //
confirmSubmit() { confirmSubmit() {
const pointList = this.$parent.workbench const pointList = this.$parent.workbench
// if(!pointList.find(e => e.codeId)) return this.$message.error('') let msg = '此操作将视为结束考试,是否继续?'
this.$confirm("此操作将视为结束考试, 是否继续?", "提示", { if(pointList.find(e => !e.codeId && e.code)) msg = '有代码没有运行,该代码将不得分,确定提交?'
confirmButtonText: "确定", this.$confirm(msg, '提示', {
cancelButtonText: "取消", confirmButtonText: '确定',
type: "warning", cancelButtonText: '取消',
type: 'warning',
center: true center: true
}).then(() => { }).then(() => {
this.submit() this.submit()

@ -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 => {})

@ -26,7 +26,7 @@
:key="codeKey" :key="codeKey"
:projectId.sync="projectId" :projectId.sync="projectId"
:code.sync="item.code" :code.sync="item.code"
:workbench1="item.judgmentId" :judgmentId="item.judgmentId"
:codeId.sync="item.codeId" :codeId.sync="item.codeId"
:answer.sync="item.answer" :answer.sync="item.answer"
@cache="leavePage" @cache="leavePage"

Loading…
Cancel
Save