dev_2022-05-11
yujialong 3 years ago
parent 34fa042e63
commit 5448660f5f
  1. 2
      src/api/index.js
  2. 37
      src/components/TestPanel.vue
  3. 2
      src/config/index.js

@ -5,6 +5,8 @@ export default {
runPythonCode: 'python/python/runPythonCode',
queryBcJudgmentByBcId: 'judgment/bcJudgmentPoint/queryBcJudgmentByBcId',
queryTestProject: 'occupationlab/projectManage/getProjectBySystemId',
editExperimentalData: 'occupationlab/experimentalReport/editExperimentalData',
queryBcJudgmentPointByBcId: 'judgment/bcJudgmentPoint/queryBcJudgmentPointByBcId',
saveCache: 'python/python/saveCache',
getLastCache: 'python/python/getLastCache',
delCache: 'python/python/delCache',

@ -274,7 +274,6 @@ export default {
const classId = this.classId
// reportIdclassIdclassId
if (list.find(e => e.assessmentId == assessmentId && e.reportId && e.classId == classId)) {
console.log(33)
done = true
this.isSubmit = true
newmain.$emit('isSubmit', this.isSubmit)
@ -511,8 +510,44 @@ export default {
score += e.score //
})
this.grade = util.handleZero(score) // 0
this.editReport(res.reportId)
}).catch(err => {})
},
//
editReport(reportId) {
const data = []
const ans = []
const promises = []
this.taskList.map(e => {
promises.push(new Promise((resolve, reject) => {
data.push({
judgmentId: e.judgmentId,
judgmentName: e.name,
answer: e.code,
score: e.examScore,
})
//
this.$get(this.api.queryBcJudgmentPointByBcId, {
bcId: e.judgmentId
}).then(({ judgmentPoint }) => {
ans.push(judgmentPoint)
resolve()
}).catch(err => {
reject()
})
}))
})
Promise.all(promises).then(_ => {
data.map(e => {
const item = ans.find(n => n.bcId === e.judgmentId)
e.referenceAnswer = item.experimentCode
})
this.$post(this.api.editExperimentalData, {
reportId,
data: JSON.stringify(data)
}).then(res => {}).catch(err => {})
})
},
//
togglePannel() {
this.pannelVisible = !this.pannelVisible

@ -5,7 +5,7 @@ const isBeta = process.env.NODE_ENV === 'development' || location.host.includes(
let host = location.origin + ':9000/'
// 39.108.250.202 | 192.168.31.151
if (process.env.NODE_ENV === 'development') host = 'http://39.108.250.202:9000/'
if (process.env.NODE_ENV === 'development') host = 'http://192.168.31.151:9000/'
const systemId = util.getCookie('systemId')
/**
* python8个系统的id和名称

Loading…
Cancel
Save