提交传运行结果等

ui
jialong.yu 3 years ago
parent 82126539d5
commit 85994d8519
  1. 17
      src/components/TestPanel.vue
  2. 3
      src/components/codemirror.vue
  3. 2
      src/config/index.js
  4. 5
      src/views/Home.vue

@ -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 = '' // codeIdcodeId
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 = {

@ -233,6 +233,7 @@ export default {
}).catch(err => {})
},
//
runCode(isWhile) { // isWhiletruewhile
if (!this.isSubmit) {
let code = this.codeVal
@ -298,9 +299,11 @@ export default {
const data = res.code
const photo = data.photoUrl
const result = data.runResult
this.$emit('cache')
this.loadIns.close()
this.picSrc = ''
this.$emit('update:codeId', res.codeId)
this.$emit('update:answer', result)
if(photo){
this.isError = ''
const text = result.replace(photo, '')

@ -7,7 +7,7 @@ if(isHh) {
host = "http://10.196.131.73/";
} else if(isBeta) {
host = "http://39.108.250.202:9000/";
// host = "http://192.168.31.151:9000/";
host = "http://192.168.31.151:9000/";
} else if(isPro) {
host = "http://www.occupationlab.com/";
} else {

@ -28,6 +28,8 @@
:code.sync="item.code"
:workbench1="item.judgmentId"
:codeId.sync="item.codeId"
:answer.sync="item.answer"
@cache="leavePage"
></codemirror>
</el-tab-pane>
</el-tabs>
@ -66,6 +68,7 @@ export default {
},
mounted() {
this.autoLogout()
//
window.onbeforeunload = () => {
this.leavePage()
}
@ -74,7 +77,7 @@ export default {
//
leavePage(){
const list = this.workbench
if(!this.$refs.mainindex.isSubmit && !this.assessmentId && list.length && list.some(e => e.code)){
if(!this.$refs.mainindex.isSubmit && list.length && list.some(e => e.code)){
const cache = {
projectId: this.projectId,
judgmentId: list[Number(this.curTab)].judgmentId

Loading…
Cancel
Save