|
|
@@ -19,7 +19,15 @@
|
|
|
参加考试
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
- v-if="(isStudentGroup && exam.joined) || (isTeacherGroup)"
|
|
|
+ v-if="(isStudentGroup || isTeacherGroup) && !exam.joined"
|
|
|
+ type="primary"
|
|
|
+ :loading="loading.create"
|
|
|
+ @click="createExamPaper"
|
|
|
+ >
|
|
|
+ 生成自测试卷
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="(isStudentGroup || isTeacherGroup) && exam.joined"
|
|
|
type="primary"
|
|
|
@click="jumpToCoderOnlineExam"
|
|
|
>
|
|
|
@@ -434,6 +442,7 @@ export default {
|
|
|
delete: false,
|
|
|
console: false,
|
|
|
refresh: false,
|
|
|
+ create: false,
|
|
|
},
|
|
|
|
|
|
range: [],
|
|
|
@@ -608,7 +617,7 @@ export default {
|
|
|
jumpToCoderOnlineExam() {
|
|
|
let firstQuestionId = this.exam.problems[0].id;
|
|
|
// let nextURL = "https://coder.seec.seecoder.cn/exam/" + this.exam.id + "?id_token=" + this.$store.state.user.token; //跳转到Coder
|
|
|
- let nextURL = `https://ide-test.seec.seecoder.cn/?examId=${this.exam.id}&questionId=${firstQuestionId}&id_token=${this.$store.state.user.token}`;
|
|
|
+ let nextURL = `https://ide.seec.seecoder.cn/?examId=${this.exam.id}&questionId=${firstQuestionId}&id_token=${this.$store.state.user.token}`;
|
|
|
window.open(nextURL);
|
|
|
},
|
|
|
goToDetect() {
|
|
|
@@ -713,6 +722,24 @@ export default {
|
|
|
this.dialog.join = false;
|
|
|
});
|
|
|
},
|
|
|
+ createExamPaper() { // 生成自测试卷(老师选择考试,否则不能正常自测)
|
|
|
+ this.loading.create = true;
|
|
|
+ this.$apis.joinCoderExam(this.exam.id)
|
|
|
+ .then(_res => {
|
|
|
+ this.$message.success({
|
|
|
+ message: "生成自测试卷成功!",
|
|
|
+ center: true
|
|
|
+ });
|
|
|
+ this.fetchExamDetail();
|
|
|
+ }).catch(_err => {
|
|
|
+ this.$message.error({
|
|
|
+ message: "生成自测试卷出错!",
|
|
|
+ center: true
|
|
|
+ });
|
|
|
+ }).finally(() => {
|
|
|
+ this.loading.create = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
//TODO 下载考试成绩的认证过程,信息安全问题
|
|
|
//下载考试成绩单
|
|
|
download() {
|