提交提示

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

@ -91,7 +91,7 @@ import util from '@/util'
import config from '@/config'
const CANCEL_TOKEN = axios.CancelToken // input
export default {
props: ['workbench1', 'code', 'codeId', 'projectId'],
props: ['judgmentId', 'code', 'codeId', 'projectId'],
data() {
return {
token: util.getCookie('admin-token'),
@ -192,7 +192,7 @@ export default {
axios.post(config.host + this.api.runPythonCode, {
code: this.sourceCode,
bcId: this.workbench1,
bcId: this.judgmentId,
cid: this.courseId,
projectId: this.projectId
}, {
@ -238,7 +238,7 @@ export default {
} else {
const inputTextReg = this.inputTextReg
const inputFuncReg = /input\(['|"]/g
const bcId = this.workbench1
const bcId = this.judgmentId
const cid = this.courseId
const projectId = this.projectId
// input
@ -342,7 +342,7 @@ export default {
getTips() {
this.tipsVisible = true
this.$get(this.api.queryBcJudgmentByBcId, {
bcId: this.workbench1
bcId: this.judgmentId
}).then(res => {
this.answer = res.experimentCode
}).catch(err => {})

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

Loading…
Cancel
Save