|
@@ -1,8 +1,9 @@
|
|
|
<template>
|
|
|
<el-container>
|
|
|
<el-header>
|
|
|
- <div>
|
|
|
- <!-- <img :src="" alt=""> -->
|
|
|
+ <div style="display: flex; justify-content: center; align-items: center;">
|
|
|
+ <img :src="userInfo.schPicture" alt="" style="width: 40px; height: 40px; margin-right: 10px;">
|
|
|
+ <span>{{ userInfo.schoolName }}</span>
|
|
|
</div>
|
|
|
<!-- <div> -->
|
|
|
<el-dropdown class="base-user-center" size="small">
|
|
@@ -99,33 +100,31 @@
|
|
|
<div class="short-code">
|
|
|
提取码:
|
|
|
<span style="color: #24b880;">{{ evaluationClient.shortCode }}</span>
|
|
|
- <!-- <el-button size="mini" :type="evaluationClient.activate ? 'success' : 'danger'" @click="evaluationClient.activate = 1"
|
|
|
- :icon="evaluationClient.activate ? 'el-icon-jihuo1' : 'el-icon-jihuo'"
|
|
|
- :title="evaluationClient.activate ? '已激活' : '激活'" circle></el-button> -->
|
|
|
</div>
|
|
|
</vuescroll>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="学生作答" name="student" class="answer-content">
|
|
|
<div v-show="!isInputOpen" style="height: 100%;">
|
|
|
<vuescroll>
|
|
|
- <!-- 学生作答
|
|
|
- 活动列表
|
|
|
- 活动信息(激活按钮、信息框、学生作答框)
|
|
|
- 信息框中展示基本信息、试卷下载情况等
|
|
|
- 学生作答框展示哪些电脑在作答,是否作答完成,设置评测考试时间等
|
|
|
- 在进入学生作答页面时,判断 激活字段 是否存在,不存在需要用户输入开卷码,才能展示相关信息(勾选一次作答的班级(多选),考试时长,)
|
|
|
- 学生端需教师点击开始考试后,才能进行作答 -->
|
|
|
- <div style="border-bottom: 1px dashed #ccc; padding: 15px 10px;">
|
|
|
- <div>
|
|
|
+ <div style="border-bottom: 1px dashed #ccc; padding: 15px 10px; position: relative;">
|
|
|
+ <div style="position: absolute; right: 0; top: 0;">
|
|
|
+ <el-button size="mini" @click="isRoundList = true">查看已考轮次</el-button>
|
|
|
+ </div>
|
|
|
+ <!-- <div>
|
|
|
<div>参考人数:{{ 92 }}</div>
|
|
|
<div></div>
|
|
|
<div></div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
<div>
|
|
|
<div style="margin-right: 40px; margin-bottom: 20px;">设置作答班级:
|
|
|
<el-tooltip class="item" effect="light" placement="bottom-start">
|
|
|
<el-select v-model="setAnswerInfo.groupId" :disabled="!!setAnswerInfo.activate" size="small" clearable multiple collapse-tags placeholder="请选择">
|
|
|
- <el-option v-for="(item, index) in evaluationClient.grouplist" :key="index" :label="item.name" :value="item.id"></el-option>
|
|
|
+ <el-option v-for="(item, index) in evaluationClient.grouplist" :key="index" :label="item.name" :value="item.id">
|
|
|
+ <span>
|
|
|
+ {{ item.name }}
|
|
|
+ <el-tag v-if="item.isUesed" type="warning" size="mini" style="margin-left: 5px;">已考试</el-tag>
|
|
|
+ </span>
|
|
|
+ </el-option>
|
|
|
</el-select>
|
|
|
<template slot="content">
|
|
|
<div v-if="!selectGroup.length">未选择班级</div>
|
|
@@ -152,11 +151,11 @@
|
|
|
</el-radio>
|
|
|
</el-radio-group>
|
|
|
</div>
|
|
|
- <div style="margin-right: 40px; margin-bottom: 20px;">设置作答时间:
|
|
|
- <el-date-picker v-show="setAnswerInfo.countdownType === 1" v-model="setAnswerInfo.startTime" :disabled="!!setAnswerInfo.activate" type="datetime" placeholder="开考时间"></el-date-picker>
|
|
|
- <el-date-picker v-show="setAnswerInfo.countdownType != 1" v-model="setAnswerInfo.answerTime" :disabled="!!setAnswerInfo.activate" size="small" type="datetimerange" start-placeholder="开考时间" end-placeholder="截至时间"></el-date-picker>
|
|
|
+ <div style="margin-right: 40px; margin-bottom: 20px;">设置考试时间:
|
|
|
+ <el-date-picker v-show="setAnswerInfo.countdownType === 1" v-model="setAnswerInfo.startTime" :disabled="!!setAnswerInfo.activate" :picker-options="pickerOptions" type="datetime" placeholder="开考时间"></el-date-picker>
|
|
|
+ <el-date-picker v-show="setAnswerInfo.countdownType != 1" v-model="setAnswerInfo.answerTime" :disabled="!!setAnswerInfo.activate" :picker-options="pickerOptions" size="small" type="datetimerange" start-placeholder="开考时间" end-placeholder="截至时间"></el-date-picker>
|
|
|
</div>
|
|
|
- <div v-show="setAnswerInfo.countdownType" style="margin-right: 40px; margin-bottom: 20px;">考试时长:
|
|
|
+ <div v-show="setAnswerInfo.countdownType" style="margin-right: 40px; margin-bottom: 20px;">作答时长:
|
|
|
<el-input-number v-model="setAnswerInfo.hour" :disabled="!!setAnswerInfo.activate" :min="0" type="number" controls-position="right" placeholder="请输入内容" size="small" style="width: 100px;"></el-input-number>
|
|
|
<span style="margin: 0 15px 0 10px;">时</span>
|
|
|
<el-input-number v-model="setAnswerInfo.minute" :disabled="!!setAnswerInfo.activate" :min="0" :max="59" type="number" controls-position="right" placeholder="请输入内容" size="small" style="width: 100px;"></el-input-number>
|
|
@@ -166,10 +165,9 @@
|
|
|
<el-button size="mini" :type="setAnswerInfo.activate ? 'info' : 'primary'" @click="startExam()" v-show="evaluationClient.progress === 'going'">{{ setAnswerInfo.activate ? '停止考试' : '开始考试'}}</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div></div>
|
|
|
- <div></div>
|
|
|
</div>
|
|
|
- <div style="display: flex; flex-wrap: wrap; margin-top: 20px;">
|
|
|
+ <div v-if="!studentListShow.length" style="margin-top: 10%; font-size: 25px; text-align: center;">暂未开始考试</div>
|
|
|
+ <div style="display: flex; flex-wrap: wrap; margin-top: 20px;" v-else>
|
|
|
<div v-for="(item, index) in studentListShow" :key="index" class="student-info" :style="{'border-color': item.isAnswer === 1 ? '#4393e4' : item.isAnswer === 2 ? '#53a929' : '#909399'}">
|
|
|
<p class="name-info" :style="{'background-color': item.isAnswer === 1 ? '#4393e4' : item.isAnswer === 2 ? '#53a929' : '#909399'}">
|
|
|
<i class="el-icon-s-custom" style="margin-right: 5px;"></i>
|
|
@@ -193,7 +191,7 @@
|
|
|
</div>
|
|
|
</vuescroll>
|
|
|
</div>
|
|
|
- <div v-show="isInputOpen">请输入开卷码,验证查看权限</div>
|
|
|
+ <div v-show="isInputOpen" style="font-size: 25px; text-align: center; margin-top: 20%;">请输入开卷码,验证查看权限</div>
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</template>
|
|
@@ -221,6 +219,21 @@
|
|
|
<el-button @click="isStartExam = false">取消</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog title="已考试的轮次信息" width="30%" :visible.sync="isRoundList">
|
|
|
+ <div v-for="(item, index) in roundList" :key="index" style="border-bottom: 1px dashed #ccc; padding: 5px 10px;">
|
|
|
+ <p>
|
|
|
+ <i class="el-icon-time"></i>
|
|
|
+ 考试时间:{{ item.startTime }} - {{ item.endTime }}</p>
|
|
|
+ <p>考试班级:
|
|
|
+ <span v-for="(group, gIndex) in item.groupList" :key="gIndex">{{ group.name }}</span>
|
|
|
+ </p>
|
|
|
+ <p style="display: flex;">
|
|
|
+ <span style="margin-right: 30px;">时间类型:{{ !item.countdownType ? '无' : item.countdownType === 1 ? '统一作答时长' : '学生个人作答时长' }}</span>
|
|
|
+ <span v-show="item.countdownType">作答时长:{{ item.duration }}</span>
|
|
|
+ </p>
|
|
|
+ <el-button @click="getExamRoundInfo(item.id, true)" style="float: right;">查看详情</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
<div class="open-evaluation" v-if="showErrorMsgs">
|
|
|
<div class="info-box error-info" v-for="(item, index) in openErrorMsgs" :key="index">
|
|
|
<p>
|
|
@@ -251,6 +264,7 @@ import TestPaper from './TestPaper.vue'
|
|
|
export default {
|
|
|
components: { TestPaper },
|
|
|
data() {
|
|
|
+ const that = this
|
|
|
return {
|
|
|
isLoading: undefined,
|
|
|
examList: [],
|
|
@@ -266,6 +280,7 @@ export default {
|
|
|
isStartExam: false, //开始考试
|
|
|
studentListShow: [],
|
|
|
setAnswerInfo: {
|
|
|
+ id: '',
|
|
|
groupId: [],
|
|
|
startTime: '',
|
|
|
answerTime: [],
|
|
@@ -285,16 +300,29 @@ export default {
|
|
|
paperList: [],
|
|
|
paperInfo: undefined,
|
|
|
isShowPaper: false,
|
|
|
+ roundList: [], //开考的轮次信息
|
|
|
+ isRoundList: false,
|
|
|
+ pickerOptions: {
|
|
|
+ disabledDate(date) {
|
|
|
+ return date.getTime() < that.evaluationClient.stime || date.getTime() > that.evaluationClient.etime
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+ this.isLoading = Loading.service({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ })
|
|
|
this.deviceId = localStorage.getItem('deviceId')
|
|
|
this.userInfo = jwtDecode(localStorage.getItem('auth_token'))
|
|
|
let schoolInfo = JSON.parse(localStorage.getItem('schoolInfo'))
|
|
|
this.userInfo.schoolName = schoolInfo.name
|
|
|
- this.userInfo.picture = schoolInfo.picture
|
|
|
+ this.userInfo.schPicture = schoolInfo.picture
|
|
|
this.getActivityList()
|
|
|
if(!this.deviceId) this.viewNetworkInfo()
|
|
|
+ this.isLoading.close()
|
|
|
},
|
|
|
mounted() {
|
|
|
},
|
|
@@ -319,7 +347,7 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
if(!this.evaluationClient.openCode) this.isInputOpen = true
|
|
|
- // else this.getExamRoundInfo()
|
|
|
+ else this.getRoundList()
|
|
|
}
|
|
|
},
|
|
|
getNowTime() {
|
|
@@ -669,6 +697,10 @@ export default {
|
|
|
item.startTime = this.$tools.getDate(item.stime, 'year')
|
|
|
item.endTime = this.$tools.getDate(item.etime, 'year')
|
|
|
item.progress = this.timeStatus(item.stime, item.etime)
|
|
|
+ item.grouplist = item.grouplist.map(group => {
|
|
|
+ group.isUesed = false
|
|
|
+ return group
|
|
|
+ })
|
|
|
return item
|
|
|
})
|
|
|
this.onSelectAct(0)
|
|
@@ -726,7 +758,7 @@ export default {
|
|
|
}
|
|
|
this.studentListShow = []
|
|
|
this.curIndex = index
|
|
|
- this.evaluationClient = this.examList[index]
|
|
|
+ // this.evaluationClient = this.examList[index]
|
|
|
let params = {
|
|
|
deviceId: this.deviceId,
|
|
|
shortCode: this.examList[index].shortCode,
|
|
@@ -775,7 +807,7 @@ export default {
|
|
|
if(openCode && this.openCode === openCode) {
|
|
|
this.evaluationClient.openCode = openCode
|
|
|
this.examList[this.curIndex].openCode = openCode
|
|
|
- // this.getExamRoundInfo()
|
|
|
+ this.getRoundList()
|
|
|
this.openCode = ''
|
|
|
this.isInputOpen = false
|
|
|
this.$message({
|
|
@@ -793,7 +825,7 @@ export default {
|
|
|
if(res.code === 200) {
|
|
|
this.evaluationClient.openCode = this.openCode
|
|
|
this.examList[this.curIndex].openCode = this.openCode
|
|
|
- // this.getExamRoundInfo()
|
|
|
+ this.getRoundList()
|
|
|
sessionStorage.setItem(this.evaluationClient.id, this.openCode)
|
|
|
this.openCode = ''
|
|
|
} else if(res.code === 1) {
|
|
@@ -827,10 +859,22 @@ export default {
|
|
|
console.log('11111111111111');
|
|
|
|
|
|
}) */
|
|
|
+ if(this.setAnswerInfo.countdownType && !this.setAnswerInfo.hour && !this.setAnswerInfo.minute || !this.setAnswerInfo.groupId.length || !this.setAnswerInfo.startTime && this.setAnswerInfo.answerTime.length != 2) {
|
|
|
+ this.$message({
|
|
|
+ message: '请完善考试信息!',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.isLoading = Loading.service({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ })
|
|
|
let params = {
|
|
|
evaluationId: this.evaluationClient.id,
|
|
|
groupList: [],
|
|
|
- activate: this.evaluationClient.activate ? 0 : 1,
|
|
|
+ activate: this.setAnswerInfo.activate ? 0 : 1,
|
|
|
countdownType: this.setAnswerInfo.countdownType,
|
|
|
countdown: '',
|
|
|
startline: '',
|
|
@@ -873,6 +917,8 @@ export default {
|
|
|
type: 'warning'
|
|
|
});
|
|
|
}
|
|
|
+ }).finally(() => {
|
|
|
+ this.isLoading.close()
|
|
|
})
|
|
|
},
|
|
|
updatePackage() {
|
|
@@ -906,16 +952,53 @@ export default {
|
|
|
this.isLoading.close()
|
|
|
})
|
|
|
},
|
|
|
- // 先调用 getRoundList if(settings === []) 不调用getExamRoundInfo else 获取 settings中activate === 1 的数据,若有,则调用getExamRoundInfo 否则不调用
|
|
|
- getExamRoundInfo() {
|
|
|
+ getRoundList() {
|
|
|
let params = {
|
|
|
evaluationId: this.evaluationClient.id,
|
|
|
openCode: this.evaluationClient.openCode,
|
|
|
shortCode: this.evaluationClient.shortCode,
|
|
|
- settingId: '',
|
|
|
+ }
|
|
|
+ this.$api.getRoundList(params).then(res => {
|
|
|
+ if(res.code === 200) {
|
|
|
+ if(res.settings.length) {
|
|
|
+ this.roundList = res.settings.map(item => {
|
|
|
+ item.startTime = this.$tools.getDate(item.startline, 'year')
|
|
|
+ item.endTime = this.$tools.getDate(item.deadline, 'year')
|
|
|
+ let second = item.countdown / 1000 / 60
|
|
|
+ let hour = Math.floor(second / 60)
|
|
|
+ let minute = (second - hour * 60)
|
|
|
+ item.duration = `${hour}时${minute}分`
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ let roundGroup = res.settings.map(item => item.groupList).flat();
|
|
|
+ this.evaluationClient.grouplist.forEach(item => {
|
|
|
+ if(roundGroup.find(group => group.id === item.id)) item.isUesed = true
|
|
|
+ })
|
|
|
+ let activateInfo = res.settings.find(item => item.activate === 1)
|
|
|
+ if(activateInfo) this.getExamRoundInfo(activateInfo.id)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getExamRoundInfo(settingId, isDialog) {
|
|
|
+ if(isDialog) {
|
|
|
+ this.isRoundList = false
|
|
|
+ if(this.setAnswerInfo.id === settingId) return
|
|
|
+ this.isLoading = Loading.service({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ let params = {
|
|
|
+ evaluationId: this.evaluationClient.id,
|
|
|
+ openCode: this.evaluationClient.openCode,
|
|
|
+ shortCode: this.evaluationClient.shortCode,
|
|
|
+ settingId,
|
|
|
}
|
|
|
this.$api.getExamRoundInfo(params).then(res => {
|
|
|
if(res.code === 200) {
|
|
|
+ this.setAnswerInfo.id = res.setting.id
|
|
|
this.setAnswerInfo.groupId = res.setting.groupList.map(item => item.id)
|
|
|
this.setAnswerInfo.activate = res.setting.activate
|
|
|
this.setAnswerInfo.countdownType = res.setting.countdownType
|
|
@@ -933,6 +1016,8 @@ export default {
|
|
|
return item
|
|
|
})
|
|
|
}
|
|
|
+ }).finally(() => {
|
|
|
+ if(isDialog) this.isLoading.close()
|
|
|
})
|
|
|
},
|
|
|
delInfo(index) {
|
|
@@ -987,7 +1072,7 @@ export default {
|
|
|
selectGroup() {
|
|
|
return this.evaluationClient.grouplist.filter(item => this.setAnswerInfo.groupId.includes(item.id))
|
|
|
},
|
|
|
- },
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|
|
@@ -1026,9 +1111,6 @@ export default {
|
|
|
.el-tabs__header {
|
|
|
margin-bottom: 0;
|
|
|
}
|
|
|
-.el-tab-pane {
|
|
|
- margin: 0 15px 15px;
|
|
|
-}
|
|
|
|
|
|
.test-paper {
|
|
|
height: 100%;
|