|
|
|
@ -7,7 +7,7 @@ |
|
|
|
|
<p>实训项目</p> |
|
|
|
|
<el-select v-model="projectId" placeholder="请选择" class="select" :disabled="projectPermissions != 0" @change="selectProject"> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in value" |
|
|
|
|
v-for="item in topicList" |
|
|
|
|
:key="item.projectId" |
|
|
|
|
:label="item.projectName" |
|
|
|
|
:value="item.projectId" |
|
|
|
@ -50,7 +50,8 @@ |
|
|
|
|
</div> |
|
|
|
|
<div class="font_css"> |
|
|
|
|
<div class="experimentalGoal"> |
|
|
|
|
<div class="break-all" v-html="experimentalGoal"></div> |
|
|
|
|
<div class="break-all" v-html="projectManage.experimentTarget"> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -63,9 +64,10 @@ |
|
|
|
|
<el-row> |
|
|
|
|
<el-col :span="24"> |
|
|
|
|
<el-card shadow="hover"> |
|
|
|
|
<el-table :data="tableData" :stripe="true" height="405"> |
|
|
|
|
<el-table :data="requires" stripe height="405"> |
|
|
|
|
<el-table-column type="index"></el-table-column> |
|
|
|
|
<el-table-column prop="judgmentPointsName" label="判分标准" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="name" label="判分标准" align="center" width="180"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="right" label="完成结果" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<i |
|
|
|
@ -91,21 +93,19 @@ |
|
|
|
|
<el-main> |
|
|
|
|
<el-tabs v-model="activeName" type="card"> |
|
|
|
|
<el-tab-pane label="案例" name="first"> |
|
|
|
|
<div class="break-all" v-html="caseDescription"></div> |
|
|
|
|
<div class="break-all" v-html="projectManage.experimentDescription"></div> |
|
|
|
|
</el-tab-pane> |
|
|
|
|
<el-tab-pane label="实验要求" name="second"> |
|
|
|
|
<el-collapse v-model="activeNames"> |
|
|
|
|
<el-collapse-item v-for="(loop, index) in points" :key="index"> |
|
|
|
|
<template slot="title"> |
|
|
|
|
<i class="el-icon-s-ticket"></i> |
|
|
|
|
<span style="font-size:16px">{{loop.judgmentPointsName}}</span> |
|
|
|
|
</template> |
|
|
|
|
<div class="break-all" v-html="loop.experimentalRequirements"></div> |
|
|
|
|
<el-collapse v-model="activeNames" accordion> |
|
|
|
|
<div v-for="(item,index) in requires"> |
|
|
|
|
<el-collapse-item :title="item.name" :name="item.id"> |
|
|
|
|
<div class="break-all" v-html="item.experimentalRequirements"></div> |
|
|
|
|
</el-collapse-item> |
|
|
|
|
</div> |
|
|
|
|
</el-collapse> |
|
|
|
|
</el-tab-pane> |
|
|
|
|
<el-tab-pane label="实验提示" name="fifth" v-if="isstartexperimentSuggests"> |
|
|
|
|
<div class="break-all" v-html="experimentSuggests"></div> |
|
|
|
|
<div class="break-all" v-html="projectManage.experimentHint"></div> |
|
|
|
|
</el-tab-pane> |
|
|
|
|
</el-tabs> |
|
|
|
|
</el-main> |
|
|
|
@ -125,6 +125,10 @@ |
|
|
|
|
<script> |
|
|
|
|
import util from '@/libs/util' |
|
|
|
|
import Setting from '@/setting' |
|
|
|
|
// 引入封装好的接口 |
|
|
|
|
import {getProjectBySystemId} from "@/api/http.js"; |
|
|
|
|
import {getProjectDetail} from "@/api/http.js"; |
|
|
|
|
import {submit} from "@/api/http.js"; |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
@ -143,10 +147,10 @@ export default { |
|
|
|
|
millisecond: 0, |
|
|
|
|
countVal: this.defaultVal, //获取初始值 |
|
|
|
|
pauseTime: 0, |
|
|
|
|
day: 0, |
|
|
|
|
seconds: 0, |
|
|
|
|
minutes: 0, |
|
|
|
|
hour: 0, |
|
|
|
|
day: '00', |
|
|
|
|
seconds: '00', |
|
|
|
|
minutes: '00', |
|
|
|
|
hour: '00', |
|
|
|
|
createTime: "", //开始时间 |
|
|
|
|
actEndTime: "", //倒计时结束时间 |
|
|
|
|
projectId: "", //选中后绑定的对象 |
|
|
|
@ -164,7 +168,7 @@ export default { |
|
|
|
|
schoolId: '', |
|
|
|
|
studentId: "", |
|
|
|
|
courseId: "", |
|
|
|
|
projectId: "", |
|
|
|
|
// projectId: "", |
|
|
|
|
assessmentId: "", |
|
|
|
|
projectPermissions: 0, //项目权限(0、练习 1、考核 2、竞赛) |
|
|
|
|
isSubmit: false, |
|
|
|
@ -173,8 +177,11 @@ export default { |
|
|
|
|
stopTime: '', |
|
|
|
|
isSelected: false, |
|
|
|
|
userId: '', |
|
|
|
|
isstartexperimentSuggests: 1 |
|
|
|
|
}; |
|
|
|
|
isstartexperimentSuggests: 1, |
|
|
|
|
topicList:[], |
|
|
|
|
projectManage:{}, |
|
|
|
|
requires:[] |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
countVal: { |
|
|
|
@ -235,108 +242,186 @@ export default { |
|
|
|
|
} |
|
|
|
|
this.assessmentId && this.projectId && this.checkVer() |
|
|
|
|
this.codeId && this.codeIds.push(this.codeId) |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
checkVer() { |
|
|
|
|
let data = { |
|
|
|
|
userId: this.userId, |
|
|
|
|
id: this.assessmentId |
|
|
|
|
//获取项目列表 |
|
|
|
|
getData(){ |
|
|
|
|
let params = { |
|
|
|
|
systemId:'11', |
|
|
|
|
} |
|
|
|
|
this.$get(this.api.qualifications,data).then(res => { |
|
|
|
|
if(res.message == 'false'){ |
|
|
|
|
this.isSubmit = true; |
|
|
|
|
// newmain.$emit("isSubmit", this.isSubmit); |
|
|
|
|
getProjectBySystemId(params).then((data)=>{ |
|
|
|
|
if(data.status == 200){ |
|
|
|
|
this.topicList = data.data.projects |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}).catch((error)=>{ |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//重新开始 |
|
|
|
|
reload() { |
|
|
|
|
this.$post(this.api.DeleteCodes, this.codeIds).then(res => { |
|
|
|
|
this.getClearTime() |
|
|
|
|
this.grade = '00' |
|
|
|
|
this.codeIds = [] |
|
|
|
|
this.isSubmit = false |
|
|
|
|
this.startCountFn() |
|
|
|
|
}); |
|
|
|
|
//选择好题目 |
|
|
|
|
selectProject(){ |
|
|
|
|
let params = { |
|
|
|
|
projectId:this.projectId, |
|
|
|
|
} |
|
|
|
|
getProjectDetail(params).then((data)=>{ |
|
|
|
|
if(data.status == 200){ |
|
|
|
|
this.projectManage = data.data.projectManage; |
|
|
|
|
this.requires = data.data.projectJudgmentVos; |
|
|
|
|
} |
|
|
|
|
}).catch((error)=>{ |
|
|
|
|
}) |
|
|
|
|
//获取当前时间 |
|
|
|
|
let startTime = new Date().getTime(); |
|
|
|
|
sessionStorage.setItem('startTime', startTime) |
|
|
|
|
this.day = '00'; |
|
|
|
|
this.hour = '00'; |
|
|
|
|
this.minutes = '00'; |
|
|
|
|
this.seconds = '00'; |
|
|
|
|
this.getClearTime(); |
|
|
|
|
this.startCountFn(); |
|
|
|
|
}, |
|
|
|
|
//提交 |
|
|
|
|
Submit() { |
|
|
|
|
if(!this.codeIds.length) return this.$message.error('请先完成实验') |
|
|
|
|
// if(!this.codeIds.length) return this.$message.error('请先完成实验') |
|
|
|
|
this.$confirm("此操作将视为结束考试, 是否继续?", "提示", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning", |
|
|
|
|
center: true |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
}).then(() => { |
|
|
|
|
this.actEndTime = new Date().getTime(); |
|
|
|
|
console.log(this.actEndTime) |
|
|
|
|
let ruleReqs = sessionStorage.getItem('ruleReqs') |
|
|
|
|
let startTime = sessionStorage.getItem('startTime') |
|
|
|
|
let ruleReqsList = JSON.parse(ruleReqs); |
|
|
|
|
let lcld = [] |
|
|
|
|
for (var i=0;i<this.requires.length;i++){ |
|
|
|
|
lcld.push(this.requires[i].judgmentId) |
|
|
|
|
} |
|
|
|
|
let params = { |
|
|
|
|
"accountId": 0, |
|
|
|
|
"assessmentId": 0, |
|
|
|
|
"classId": 0, |
|
|
|
|
"endTime": this.actEndTime, |
|
|
|
|
"lcId": lcld, |
|
|
|
|
"projectId": 0, |
|
|
|
|
"ruleReqs": ruleReqsList, |
|
|
|
|
"startTime": +startTime, |
|
|
|
|
"submitTime": this.actEndTime, |
|
|
|
|
"systemId": 11, |
|
|
|
|
"timeSum": 0 |
|
|
|
|
} |
|
|
|
|
submit(params).then((data)=>{ |
|
|
|
|
if(data.status == 200){ |
|
|
|
|
this.topicList = data.data.projects |
|
|
|
|
} |
|
|
|
|
}).catch((error)=>{ |
|
|
|
|
}) |
|
|
|
|
this.getClearTime(); |
|
|
|
|
|
|
|
|
|
//提交代码与判分点进行判断 |
|
|
|
|
this.$post(this.api.Submit, { |
|
|
|
|
// projectPermissions: 0, |
|
|
|
|
createTime: this.startTime, |
|
|
|
|
endTime: this.stopTime, |
|
|
|
|
projectId: this.projectId, |
|
|
|
|
projectPermissions: this.projectPermissions, |
|
|
|
|
// assessmentId: 1, |
|
|
|
|
assessmentId: this.assessmentId ? this.assessmentId : '', |
|
|
|
|
codeIds: this.codeIds, |
|
|
|
|
judgmentPointsIds: this.judgmentPointsIds, |
|
|
|
|
// studentId: 54, |
|
|
|
|
studentId: this.studentId, |
|
|
|
|
record: { |
|
|
|
|
courseId: 1, |
|
|
|
|
// courseId: this.courseId, |
|
|
|
|
projectId: this.projectId, |
|
|
|
|
createTime: this.startTime, |
|
|
|
|
endTime: this.stopTime, |
|
|
|
|
startTime: this.entryTime |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.then(res => { |
|
|
|
|
this.isSubmit = true |
|
|
|
|
// newmain.$emit("isSubmit", this.isSubmit); |
|
|
|
|
this.tableData = res.message |
|
|
|
|
//计算总分 |
|
|
|
|
var s = 0; |
|
|
|
|
this.tableData.forEach(element => { |
|
|
|
|
this.test = element.score; |
|
|
|
|
s += this.test; |
|
|
|
|
this.grade = s; |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
.catch(err => {}); |
|
|
|
|
}) |
|
|
|
|
.catch(() => { |
|
|
|
|
// this.$post(this.api.Submit, { |
|
|
|
|
// // projectPermissions: 0, |
|
|
|
|
// createTime: this.startTime, |
|
|
|
|
// endTime: this.stopTime, |
|
|
|
|
// projectId: this.projectId, |
|
|
|
|
// projectPermissions: this.projectPermissions, |
|
|
|
|
// // assessmentId: 1, |
|
|
|
|
// assessmentId: this.assessmentId ? this.assessmentId : '', |
|
|
|
|
// codeIds: this.codeIds, |
|
|
|
|
// judgmentPointsIds: this.judgmentPointsIds, |
|
|
|
|
// // studentId: 54, |
|
|
|
|
// studentId: this.studentId, |
|
|
|
|
// record: { |
|
|
|
|
// courseId: 1, |
|
|
|
|
// // courseId: this.courseId, |
|
|
|
|
// projectId: this.projectId, |
|
|
|
|
// createTime: this.startTime, |
|
|
|
|
// endTime: this.stopTime, |
|
|
|
|
// startTime: this.entryTime |
|
|
|
|
// } |
|
|
|
|
// }).then(res => { |
|
|
|
|
// this.isSubmit = true |
|
|
|
|
// // newmain.$emit("isSubmit", this.isSubmit); |
|
|
|
|
// this.tableData = res.message |
|
|
|
|
// //计算总分 |
|
|
|
|
// var s = 0; |
|
|
|
|
// this.tableData.forEach(element => { |
|
|
|
|
// this.test = element.score; |
|
|
|
|
// s += this.test; |
|
|
|
|
// this.grade = s; |
|
|
|
|
// }); |
|
|
|
|
// }) |
|
|
|
|
// .catch(err => {}); |
|
|
|
|
}).catch(() => { |
|
|
|
|
this.$message({ |
|
|
|
|
type: "info", |
|
|
|
|
message: "已取消提交" |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 倒计时 |
|
|
|
|
timeFormat(param) { |
|
|
|
|
return param < 10 ? "0" + param : param; |
|
|
|
|
//开始计时 |
|
|
|
|
startCountFn() { |
|
|
|
|
if (!this.isStart) { |
|
|
|
|
this.countVal = this.countVal ? this.countVal : 0; |
|
|
|
|
let timer = setInterval(() => { |
|
|
|
|
this.counterFn(this.countVal++); |
|
|
|
|
}, 1000); |
|
|
|
|
this.globalTimer = timer; |
|
|
|
|
this.isStart = true; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
toggleCase() { |
|
|
|
|
this.caseVisible = !this.caseVisible |
|
|
|
|
counterFn(counterTime) { |
|
|
|
|
let leave1 = counterTime % (24 * 3600 * 1); //计算天数后剩余的毫秒数 |
|
|
|
|
let leave2 = leave1 % (3600 * 1); //计算小时数后剩余的毫秒数 |
|
|
|
|
let leave3 = leave2 % (60 * 1); //计算分钟数后剩余的毫秒数 |
|
|
|
|
let day = Math.floor(counterTime / (24 * 3600 * 1)); //计算相差天数 |
|
|
|
|
let hour = Math.floor(leave1 / (3600 * 1)); //计算相差小时 |
|
|
|
|
let minutes = Math.floor(leave2 / (60 * 1)); //计算相差分钟 |
|
|
|
|
let seconds = Math.round(leave3 / 1); //计算相差秒 |
|
|
|
|
day = day >= 10 ? day : "0" + day; |
|
|
|
|
hour = hour >= 10 ? hour : "0" + hour; |
|
|
|
|
minutes = minutes >= 10 ? minutes : "0" + minutes; |
|
|
|
|
seconds = seconds >= 10 ? seconds : "0" + seconds; |
|
|
|
|
this.day = day; |
|
|
|
|
this.hour = hour; |
|
|
|
|
this.minutes = minutes; |
|
|
|
|
this.seconds = seconds; |
|
|
|
|
}, |
|
|
|
|
//重新开始 |
|
|
|
|
reload() { |
|
|
|
|
this.getClearTime() |
|
|
|
|
}, |
|
|
|
|
// 清除时间 |
|
|
|
|
getClearTime() { |
|
|
|
|
// clearInterval(this.globalTimer); |
|
|
|
|
clearInterval(this.countVal); |
|
|
|
|
this.globalTimer = ""; |
|
|
|
|
// if(this.projectPermissions != 0){ |
|
|
|
|
this.countVal = ""; |
|
|
|
|
this.day = "00"; |
|
|
|
|
this.seconds = "00"; |
|
|
|
|
this.minutes = "00"; |
|
|
|
|
this.hour = "00"; |
|
|
|
|
// }else{ |
|
|
|
|
// this.text = '所用' |
|
|
|
|
// } |
|
|
|
|
}, |
|
|
|
|
checkVer() { |
|
|
|
|
let data = { |
|
|
|
|
userId: this.userId, |
|
|
|
|
id: this.assessmentId |
|
|
|
|
} |
|
|
|
|
this.$get(this.api.qualifications,data).then(res => { |
|
|
|
|
if(res.message == 'false'){ |
|
|
|
|
this.isSubmit = true; |
|
|
|
|
// newmain.$emit("isSubmit", this.isSubmit); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 倒计时 |
|
|
|
|
timeFormat(param) { |
|
|
|
|
return param < 10 ? "0" + param : param; |
|
|
|
|
}, |
|
|
|
|
toggleCase() { |
|
|
|
|
this.caseVisible = !this.caseVisible |
|
|
|
|
}, |
|
|
|
|
handleData(project,type){ |
|
|
|
|
if(!this.isSelected){ |
|
|
|
|
this.value = project; |
|
|
|
@ -428,43 +513,8 @@ export default { |
|
|
|
|
// this.handleData(res.message,2) |
|
|
|
|
// }).catch(res => {}); |
|
|
|
|
}, |
|
|
|
|
selectProject(){ |
|
|
|
|
this.isSelected = true |
|
|
|
|
this.assessmentId = '' |
|
|
|
|
this.judgmentPointsIds = [] |
|
|
|
|
this.codeIds = [] |
|
|
|
|
this.getQueryProject(this.projectId) |
|
|
|
|
this.isSubmit = false |
|
|
|
|
this.countVal = 0 |
|
|
|
|
// newmain.$emit("isSubmit", this.isSubmit) |
|
|
|
|
}, |
|
|
|
|
counterFn(counterTime) { |
|
|
|
|
let leave1 = counterTime % (24 * 3600 * 1); //计算天数后剩余的毫秒数 |
|
|
|
|
let leave2 = leave1 % (3600 * 1); //计算小时数后剩余的毫秒数 |
|
|
|
|
let leave3 = leave2 % (60 * 1); //计算分钟数后剩余的毫秒数 |
|
|
|
|
let day = Math.floor(counterTime / (24 * 3600 * 1)); //计算相差天数 |
|
|
|
|
let hour = Math.floor(leave1 / (3600 * 1)); //计算相差小时 |
|
|
|
|
let minutes = Math.floor(leave2 / (60 * 1)); //计算相差分钟 |
|
|
|
|
let seconds = Math.round(leave3 / 1); //计算相差秒 |
|
|
|
|
day = day >= 10 ? day : "0" + day; |
|
|
|
|
hour = hour >= 10 ? hour : "0" + hour; |
|
|
|
|
minutes = minutes >= 10 ? minutes : "0" + minutes; |
|
|
|
|
seconds = seconds >= 10 ? seconds : "0" + seconds; |
|
|
|
|
this.day = day; |
|
|
|
|
this.hour = hour; |
|
|
|
|
this.minutes = minutes; |
|
|
|
|
this.seconds = seconds; |
|
|
|
|
}, |
|
|
|
|
collapse(){ |
|
|
|
|
|
|
|
|
|
startCountFn() { |
|
|
|
|
if (!this.isStart) { |
|
|
|
|
this.countVal = this.countVal ? this.countVal : 0; |
|
|
|
|
let timer = setInterval(() => { |
|
|
|
|
this.counterFn(this.countVal++); |
|
|
|
|
}, 1000); |
|
|
|
|
this.globalTimer = timer; |
|
|
|
|
this.isStart = true; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
passToParent(data) { |
|
|
|
|
this.$emit("getDataFromChild", data); |
|
|
|
@ -494,6 +544,7 @@ export default { |
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
/deep/.el-container { |
|
|
|
|
height: 80%; |
|
|
|
|
|
|
|
|
|
&.is-vertical { |
|
|
|
|
position: fixed; |
|
|
|
|
top: 200px; |
|
|
|
@ -502,10 +553,13 @@ export default { |
|
|
|
|
width: 85%; |
|
|
|
|
height: 70%; |
|
|
|
|
background-color: #f5f5f5; |
|
|
|
|
z-index: 999; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.el-header { |
|
|
|
|
color: #333; |
|
|
|
|
padding: 0 12px 0 20px; |
|
|
|
|
|
|
|
|
|
.el-button { |
|
|
|
|
background-color: $main-color; |
|
|
|
|
color: #fff; |
|
|
|
@ -513,6 +567,7 @@ export default { |
|
|
|
|
margin: 5px 0px 5px 5px; |
|
|
|
|
font-size: 16px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.submit-btn { |
|
|
|
|
padding-left: 30px; |
|
|
|
|
padding-right: 30px; |
|
|
|
|