1.0版本封版

master
yujialong 4 years ago
parent 68af41a4b7
commit 0c602151a6
  1. 4
      src/components/achiStatistics/index.vue
  2. 85
      src/components/doReview/index.vue
  3. 2
      src/layouts/header/index.vue
  4. 12
      src/layouts/navbar/index.vue
  5. 19
      src/pages/achievement/detail/index.vue
  6. 10
      src/pages/achievement/list/examResults.vue
  7. 2
      src/pages/achievement/list/practiceResults.vue
  8. 2
      src/pages/achievement/list/wrongBook.vue
  9. 41
      src/pages/assessment/list/index.vue
  10. 53
      src/pages/assessment/monitor/index.vue
  11. 29
      src/pages/assessment/review/index.vue
  12. 15
      src/pages/quesBank/list/globalQuesBank.vue
  13. 18
      src/pages/quesBank/list/myQuesBank.vue
  14. 18
      src/pages/testPaper/add/index.vue
  15. 13
      src/pages/testPaper/list/allTestPaper.vue
  16. 27
      src/pages/testPaper/list/myTestPaper.vue
  17. 2
      src/setting.js
  18. 2
      src/store/modules/achievement.js
  19. 9
      src/store/modules/assessment.js

@ -77,7 +77,7 @@ export default {
'userId' 'userId'
]), ]),
...mapState('achievement', [ ...mapState('achievement', [
'id','assessmentId','assessmentName','classId' 'id','assessmentId','assessmentName','classId','stuId'
]) ])
}, },
mounted() { mounted() {
@ -85,7 +85,7 @@ export default {
}, },
methods: { methods: {
getData() { getData() {
this.$post(`${this.api.achievementStatistics}?userId=${this.userId}&assessmentId=${this.assessmentId}&paperId=${this.id}&classId=${this.classId}`) this.$post(`${this.api.achievementStatistics}?userId=${this.stuId}&assessmentId=${this.assessmentId}&paperId=${this.id}&classId=${this.classId}`)
.then(res => { .then(res => {
this.info = res.data.list this.info = res.data.list
let statData = [] let statData = []

@ -8,7 +8,7 @@
</div> </div>
<div> <div>
<span class="name">学生得分</span> <span class="name">学生得分</span>
<span class="val">{{(reviewStatus == 2 || reviewStatus == 3) ? total_score : '--'}}</span> <span class="val">{{(reviewStatus == 2 || reviewStatus == 3) ? this_score : '--'}}</span>
</div> </div>
<div> <div>
<span class="name">试卷总分</span> <span class="name">试卷总分</span>
@ -19,7 +19,7 @@
<span class="val">{{duration}}</span> <span class="val">{{duration}}</span>
</div> </div>
</div> </div>
<div class="wrap"> <div class="wrap">
<div class="select"> <div class="select">
<el-radio v-model="look" label="1">查看全部</el-radio> <el-radio v-model="look" label="1">查看全部</el-radio>
@ -30,7 +30,7 @@
<div class="status" :class="{done: item.isCorrecting}">{{item.isSub ? '简答题' : '客观题'}}{{getCorrectingName(item.isCorrecting)}}</div> <div class="status" :class="{done: item.isCorrecting}">{{item.isSub ? '简答题' : '客观题'}}{{getCorrectingName(item.isCorrecting)}}</div>
<div class="name" v-html="item.question_stem"></div> <div class="name" v-html="item.question_stem"></div>
<div class="answer"> <div class="answer">
<div class="info"> <div class="info" v-if="!item.isSub">
<p class="key">正确答案</p> <p class="key">正确答案</p>
<p class="val">{{item.answer}}</p> <p class="val">{{item.answer}}</p>
</div> </div>
@ -50,7 +50,7 @@
<div class="meta"> <div class="meta">
<span class="key">考试得分</span> <span class="key">考试得分</span>
<div class="val"> <div class="val">
<input type="text" v-model.number="item.this_score" :disabled="!isReview"> <input type="text" v-model.number="item.question_score" :disabled="!isReview || !item.isSub">
</div> </div>
</div> </div>
</div> </div>
@ -71,7 +71,7 @@ export default {
return { return {
paperName: '', paperName: '',
userName: '', userName: '',
total_score: '', this_score: '',
duration: '', duration: '',
list: [], list: [],
look: '1', look: '1',
@ -82,7 +82,7 @@ export default {
'userId','clientId' 'userId','clientId'
]), ]),
...mapState('assessment', [ ...mapState('assessment', [
'reviewId','paperId','isReview','reviewStatus' 'reviewId','paperId','isReview','reviewStatus','stuId'
]), ]),
...mapGetters('assessment', [ ...mapGetters('assessment', [
'getCorrectingName' 'getCorrectingName'
@ -98,51 +98,74 @@ export default {
}, },
methods: { methods: {
getData() { getData() {
this.$post(`${this.api.correcting}?assessmentId=${this.reviewId}&userId=${this.userId}&paperId=${this.paperId}`) this.$post(`${this.api.correcting}?assessmentId=${this.reviewId}&userId=${this.stuId}&paperId=${this.paperId}`)
.then(res => { .then(res => {
this.list = res.data.list let list = res.data.list
this.list.forEach(n => { list.forEach(n => {
n.isCorrecting == 0 && (n.this_score = '') n.isCorrecting == 0 && (n.question_score = '')
n.isSub = n.typeName == '简答题' n.isSub = n.typeName == '简答题'
if(n.typeName == '填空题'){
let answer = []
for(let i in n){
if(i.includes('option_')) answer.push(n[i])
}
n.answer = answer.join('|')
n.user_answer = n.user_answer.replace(/&lt;&gt;/g,'|')
}
}) })
this.paperName = this.list[0].name this.list = list
this.userName = this.list[0].userName this.paperName = list[0].name
this.total_score = this.list[0].total_score this.userName = list[0].userName
this.duration = this.list[0].duration this.this_score = list[0].this_score
this.duration = list[0].duration
}) })
.catch(err => {}) .catch(err => {})
}, },
getWrong(){ getWrong(){
this.$post(`${this.api.getWrong}?assessmentId=${1}&userId=${566}&paperId=${1}`) this.$post(`${this.api.getWrong}?assessmentId=${this.reviewId}&userId=${this.stuId}&paperId=${this.paperId}`)
.then(res => { .then(res => {
this.list = res.data.list this.list = res.data.list
}) })
.catch(err => {}) .catch(err => {})
}, },
save(status) { save(status) {
let data = [] let isEmpty = false
let isNotNum = false
let invalid = false
this.list.map(n => {
if(n.question_score === '') isEmpty = true
if(isNaN(n.question_score)) isNotNum = true
if(Number(n.question_score) > Number(n.question_points)) invalid = true
})
if(status){ if(status){
let isEmpty = false
let isNotNum = false
this.list.map(n => {
if(n.this_score === '') isEmpty = true
if(isNaN(n.this_score)) isNotNum = true
if(n.isSub){
data.push({
detailId: n.detailId,
score: n.this_score
})
}
})
if(isEmpty) return this.$message.warning('请批阅完所有题目') if(isEmpty) return this.$message.warning('请批阅完所有题目')
if(isNotNum) return this.$message.warning('考试得分请输入数字') if(isNotNum) return this.$message.warning('考试得分请输入数字')
} }
if(invalid) return this.$message.warning('考试得分不得大于题目分数')
let data = {
review: [],
assessmentId: this.reviewId,
userId: this.stuId,
paperId: this.paperId,
teacherId: this.userId,
}
let totalScore = 0
this.list.map(n => {
n.question_score !== '' && n.isSub && data.review.push({
detailId: Number(n.detailId) ,
score: Number(n.question_score)
})
totalScore += Number(n.question_score)
})
if(!data.review.length) return this.$message.warning('请至少批阅一道题目')
if(status || this.list.filter(n => n.isSub).length == data.review.length){
data.totalScore = totalScore
}
this.$post(this.api.reviewByid,data).then(res => { this.$post(this.api.reviewByid,data).then(res => {
this.$message.success(status ? '提交成功' : '保存成功') this.$message.success(status ? '提交成功' : '保存成功')
this.$router.back() this.$router.back()
}) }).catch(err => {})
.catch(err => {})
}, },
}, },
}; };

@ -1,5 +1,5 @@
<template> <template>
<div class="header flex j-between"> <div class="header flex a-center j-between">
<div v-if="showBack" class="goBack" v-throttle @click="back"><i class="el-icon-arrow-left"></i>返回</div> <div v-if="showBack" class="goBack" v-throttle @click="back"><i class="el-icon-arrow-left"></i>返回</div>
<div v-else class="logo"> <div v-else class="logo">
<img src="../../assets/img/logo-fill.png"> <img src="../../assets/img/logo-fill.png">

@ -60,32 +60,32 @@ export default {
collapse: false, collapse: false,
defaultMenus: [ defaultMenus: [
{ {
icon: 'el-icon-monitor', icon: 'el-icon-user',
index: '/index/list', index: '/index/list',
title: '学生管理' title: '学生管理'
}, },
{ {
icon: 'el-icon-news', icon: 'el-icon-notebook-1',
index: '/quesBank/list', index: '/quesBank/list',
title: '题库管理' title: '题库管理'
}, },
{ {
icon: 'el-icon-user', icon: 'el-icon-receiving',
index: '/testPaper/list', index: '/testPaper/list',
title: '试卷管理' title: '试卷管理'
}, },
{ {
icon: 'el-icon-user', icon: 'el-icon-data-analysis',
index: '/assessment/list', index: '/assessment/list',
title: '考核管理' title: '考核管理'
}, },
{ {
icon: 'el-icon-user', icon: 'el-icon-suitcase-1',
index: '/achievement/list', index: '/achievement/list',
title: '成绩管理' title: '成绩管理'
}, },
{ {
icon: 'el-icon-takeaway-box', icon: 'el-icon-setting',
index: '/system/list', index: '/system/list',
title: '系统设置' title: '系统设置'
} }

@ -75,13 +75,13 @@ export default {
name: '多选题' name: '多选题'
},{ },{
id: 3, id: 3,
name: '填空题' name: '判断题'
},{ },{
id: 4, id: 4,
name: '判断题' name: '简答题'
},{ },{
id: 5, id: 5,
name: '简答题' name: '填空题'
} }
], ],
active: 1, active: 1,
@ -93,7 +93,7 @@ export default {
'userId' 'userId'
]), ]),
...mapState('achievement', [ ...mapState('achievement', [
'id','assessmentId' 'id','assessmentId','stuId'
]) ])
}, },
mounted() { mounted() {
@ -101,8 +101,7 @@ export default {
}, },
methods: { methods: {
getData() { getData() {
this.$post(`${this.api.answerDetail}?userId=${this.userId}&assessmentId=${this.assessmentId}&paperId=${this.id}`) this.$post(`${this.api.answerDetail}?userId=${this.stuId}&assessmentId=${this.assessmentId}&paperId=${this.id}`)
// this.$post(`${this.api.answerDetail}?userId=${1}&assessmentId=${1}&paperId=${1}`)
.then(res => { .then(res => {
this.paperName = res.paperName this.paperName = res.paperName
this.time = res.time this.time = res.time
@ -110,8 +109,7 @@ export default {
this.curType = this.allData.list1 this.curType = this.allData.list1
this.handleOptions() this.handleOptions()
}) })
.catch(err => {}); .catch(err => {})
}, },
tabChange(id){ tabChange(id){
this.active = id this.active = id
@ -123,12 +121,14 @@ export default {
curType.forEach(n => { curType.forEach(n => {
if(!n.options){ if(!n.options){
let options = {} let options = {}
let answer = []
for(let i in n){ for(let i in n){
if(i.includes('option') && n[i]){ if(i.includes('option') && n[i]){
console.log(i.replace('option_',''))
options[i.replace('option_','')] = n[i] options[i.replace('option_','')] = n[i]
if(n.typeName == '填空题') answer.push(n[i])
} }
} }
if(n.typeName == '填空题') n.answer = answer.join('|')
n.options = options n.options = options
} }
}) })
@ -224,7 +224,6 @@ export default {
font-size: 12px; font-size: 12px;
&.ans{ &.ans{
display: flex; display: flex;
align-items: center;
.info{ .info{
margin-right: 20px; margin-right: 20px;
} }

@ -157,7 +157,6 @@ export default {
getClass() { getClass() {
this.$post(this.api.getMyClass,{ this.$post(this.api.getMyClass,{
userId: this.userId userId: this.userId
// userId: 1
}) })
.then(res => { .then(res => {
this.classList = res.data.list this.classList = res.data.list
@ -176,8 +175,7 @@ export default {
this.assessmentId = this.classList.find(n => n.classId == this.classId).assessmentId this.assessmentId = this.classList.find(n => n.classId == this.classId).assessmentId
this.assessmentName = this.assessmentNameList[0].assessmentName this.assessmentName = this.assessmentNameList[0].assessmentName
this.getData() this.getData()
}) }).catch(err => {})
.catch(err => {})
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.page = val this.page = val
@ -193,7 +191,8 @@ export default {
show(row){ show(row){
this.setInfo({ this.setInfo({
id: row.paperId, id: row.paperId,
assessmentId: row.id assessmentId: row.id,
stuId: row.stuId
}) })
this.$router.push('detail') this.$router.push('detail')
}, },
@ -203,7 +202,8 @@ export default {
id: this.listData[0].paperId, id: this.listData[0].paperId,
assessmentId: this.assessmentId, assessmentId: this.assessmentId,
assessmentName: this.assessmentName, assessmentName: this.assessmentName,
classId: this.classId classId: this.classId,
stuId: this.listData[0].stuId
}) })
this.$router.push('statistics') this.$router.push('statistics')
}else{ }else{

@ -147,7 +147,7 @@ export default {
data() { data() {
return { return {
keyword: '', keyword: '',
listData: [{}], listData: [],
classId: '', classId: '',
classList: [], classList: [],
total: 0, total: 0,

@ -95,7 +95,7 @@
export default { export default {
data() { data() {
return { return {
listData: [{}], listData: [],
keyword: '', keyword: '',
page: 1, page: 1,
pageSize: 10, pageSize: 10,

@ -123,7 +123,7 @@
</el-tag> </el-tag>
</el-form-item> </el-form-item>
<el-form-item label="发布班级"> <el-form-item label="发布班级">
<studentSide ref="getSelectData" :classId="form.classId" :studentId="form.studentId" :key="form.id" @fircheck="fircheck" @twocheck="twocheck" @threecheck="threecheck" @fourcheck="fourcheck"></studentSide> <studentSide ref="getSelectData" :classId="form.classId" :studentId="form.studentId" :key="stuCompKey" @fircheck="fircheck" @twocheck="twocheck" @threecheck="threecheck" @fourcheck="fourcheck"></studentSide>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -199,7 +199,7 @@
<div class="details"> <div class="details">
<div class="line"> <div class="line">
<span class="key">考核内容</span> <span class="key">考核内容</span>
<p class="val">{{testPaperName}}</p> <p class="val">{{assContent}}</p>
</div> </div>
<div class="line"> <div class="line">
<span class="key">考核题数</span> <span class="key">考核题数</span>
@ -272,7 +272,10 @@ export default {
testPaperId: '', testPaperId: '',
testPaperName: '', testPaperName: '',
quesNum: 0, quesNum: 0,
assPeopleNum: 0 assPeopleNum: 0,
assContent: '',
timer: null,
stuCompKey: 1
}; };
}, },
components: { components: {
@ -291,6 +294,7 @@ export default {
}, },
mounted() { mounted() {
this.getData() this.getData()
this.addInterval()
}, },
watch: { watch: {
keyword: function(val) { keyword: function(val) {
@ -335,7 +339,15 @@ export default {
this.listData = res.data.Assessment this.listData = res.data.Assessment
this.total = res.data.total this.total = res.data.total
}) })
.catch(err => {}) .catch(err => {
clearInterval(this.timer)
})
},
addInterval(){
this.timer = setInterval(this.getData,1000)
this.$once('hook:beforeDestroy',() => {
clearInterval(this.timer)
})
}, },
handleCheck(data){ handleCheck(data){
let professionalStudentIds = [] let professionalStudentIds = []
@ -380,11 +392,13 @@ export default {
val.ischeck = !val.ischeck val.ischeck = !val.ischeck
val.children.map( e => e.ischeck = val.ischeck) val.children.map( e => e.ischeck = val.ischeck)
val.children.map( e => e.children.map(n => n.ischeck = e.ischeck)) val.children.map( e => e.children.map(n => n.ischeck = e.ischeck))
val.children.map( e => e.children.map(n => n.children.map(j => j.ischeck = e.ischeck)))
this.handleCheck(val2) this.handleCheck(val2)
}, },
twocheck(val,val2){ twocheck(val,val2){
val.ischeck = !val.ischeck val.ischeck = !val.ischeck
val.children.map( e => e.ischeck = val.ischeck) val.children.map( e => e.ischeck = val.ischeck)
val.children.map( e => e.children.map(n => n.ischeck = e.ischeck))
val2.forEach( e => { val2.forEach( e => {
e.children.forEach( r => { e.children.forEach( r => {
if(r.gradeId == val.gradeId){ if(r.gradeId == val.gradeId){
@ -469,6 +483,7 @@ export default {
edit(row){ edit(row){
this.$get(`${this.api.queryAssessmentNumber}?id=${row.id}`).then(res => { this.$get(`${this.api.queryAssessmentNumber}?id=${row.id}`).then(res => {
this.form = row this.form = row
this.originalName = row.assessmentName
this.form.studentId = res.data.studentId this.form.studentId = res.data.studentId
this.testPaperName = row.name this.testPaperName = row.name
this.time = [this.form.startTime,this.form.endTime] this.time = [this.form.startTime,this.form.endTime]
@ -479,7 +494,7 @@ export default {
nameChange(){ nameChange(){
if(this.form.assessmentName !== this.originalName){ if(this.form.assessmentName !== this.originalName){
this.$get(`${this.api.queryAssessmentName}?userId=${this.userId}&assessmentName=${this.form.assessmentName}`).then(res => { this.$get(`${this.api.queryAssessmentName}?userId=${this.userId}&assessmentName=${this.form.assessmentName}`).then(res => {
if(res.data.userInfo){ if(res.data.Assessment){
this.nameRepeat = true this.nameRepeat = true
this.$message.warning('该考核名称已存在') this.$message.warning('该考核名称已存在')
}else{ }else{
@ -492,7 +507,8 @@ export default {
}, },
monitor(row){ monitor(row){
this.setAssInfo({ this.setAssInfo({
id: row.id id: row.id,
endTime: row.endTime
}) })
this.$router.push('monitor') this.$router.push('monitor')
}, },
@ -523,9 +539,12 @@ export default {
if(this.nameRepeat) return this.$message.warning('该考核名称已存在') if(this.nameRepeat) return this.$message.warning('该考核名称已存在')
if(form.type === '') return this.$message.warning('请选择考核类型') if(form.type === '') return this.$message.warning('请选择考核类型')
if(form.startTime === '') return this.$message.warning('请选择考核时间') if(form.startTime === '') return this.$message.warning('请选择考核时间')
if(new Date(this.form.startTime).getTime() < new Date().getTime()) return this.$message.warning('考试开始时间不能小于当前时间')
if((new Date(this.form.endTime).getTime() - new Date(this.form.startTime).getTime()) / 1000 <= 60) return this.$message.warning('考核开始时间和结束时间间隔不得小于1分钟')
if(form.testPaperId === '') return this.$message.warning('请选择试卷') if(form.testPaperId === '') return this.$message.warning('请选择试卷')
if(form.classId === '') return this.$message.warning('请选择发布班级') if(form.classId === '') return this.$message.warning('请选择发布班级')
if(!form.studentId.length) return this.$message.warning('请选择学生') if(!form.studentId.length) return this.$message.warning('请选择学生')
if(new Date(this.form.startTime).getTime() < new Date().getTime()) form.state = 2
let data = { let data = {
id: form.id, id: form.id,
@ -566,6 +585,12 @@ export default {
testPaperId: '', testPaperId: '',
type: '' type: ''
} }
this.time = []
this.testPaperName = ''
this.testPaperId = ''
this.cid = ''
this.keywordPaper = ''
this.stuCompKey++
}, },
openSelect(){ openSelect(){
this.selectVisible = true this.selectVisible = true
@ -606,13 +631,13 @@ export default {
this.selectVisible = false this.selectVisible = false
}, },
closeSelect(){ closeSelect(){
}, },
show(row){ show(row){
this.$get(`${this.api.queryAssessmentDetails}?id=${row.id}`) this.$get(`${this.api.queryAssessmentDetails}?id=${row.id}`)
.then(res => { .then(res => {
let data = res.data.data let data = res.data.data
this.testPaperName = data.name this.assContent = data.name
this.quesNum = data.questionNumber.split(',').length this.quesNum = data.questionNumber.split(',').length
this.assPeopleNum = data.number this.assPeopleNum = data.number
}) })

@ -37,7 +37,7 @@
<div class="filter"> <div class="filter">
<div class="item"> <div class="item">
<p class="key">考试状态</p> <p class="key">考试状态</p>
<el-select v-model="state" clearable placeholder="请选择考试状态" @change="getData"> <el-select v-model="state" clearable placeholder="请选择考试状态" @change="getData" size="small">
<el-option label="不限" value=""></el-option> <el-option label="不限" value=""></el-option>
<el-option v-for="(item,index) in stateList" :key="index" :label="item.name" :value="item.id"></el-option> <el-option v-for="(item,index) in stateList" :key="index" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
@ -49,14 +49,13 @@
</div> </div>
<div class="table"> <div class="table">
<div class="flex-justify-end"> <div class="flex-justify-end m-b-10">
<el-button type="primary" size="small" round @click="rollUp">强制收卷</el-button> <el-button type="primary" size="small" round @click="rollUp">强制收卷</el-button>
</div> </div>
<el-table <el-table
:data="listData" :data="listData"
ref="table" ref="table"
row-key="id" row-key="id"
class="table"
stripe stripe
header-align="center" header-align="center"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
@ -100,6 +99,7 @@
<script> <script>
import mixins from '@/mixins/setBackground' import mixins from '@/mixins/setBackground'
import { mapState,mapGetters } from 'vuex' import { mapState,mapGetters } from 'vuex'
import util from '@/libs/util'
export default { export default {
mixins: [ mixins ], mixins: [ mixins ],
data() { data() {
@ -113,11 +113,12 @@ export default {
multipleSelection: [], multipleSelection: [],
paperName: '', paperName: '',
paperScore: '', paperScore: '',
remainingTime: '', remainingTime: '0小时0分0秒',
shouldArrive: '', shouldArrive: '',
inExamination: '', inExamination: '',
completed: '', completed: '',
notTested: '', notTested: '',
timer: null
}; };
}, },
computed: { computed: {
@ -125,17 +126,44 @@ export default {
'userId','clientId' 'userId','clientId'
]), ]),
...mapState('assessment', [ ...mapState('assessment', [
'id','stateList' 'id','stateList','endTime'
]), ]),
...mapGetters('assessment', [ ...mapGetters('assessment', [
'getTypeName','getStudentStateName' 'getTypeName','getStudentStateName'
]) ])
}, },
directives: {
countdown: {
bind: function(el,binding,vnode) {
let that = vnode.context
let duration = new Date(new Date(that.endTime).getTime() - new Date().getTime()) / 1000
let time = `${Math.floor(duration / 3600)}小时${Math.floor(duration % 3600 / 60)}${Math.floor(duration % 3600 % 60)}`
that.timer = setInterval(() => {
let timeList = time.replace('小时',':').replace('分',':').replace('秒','').split(':')
let total = Number.parseInt(timeList[0] * 60 * 60) + Number.parseInt(timeList[1] * 60) + Number.parseInt(timeList[2])
if(total > 0){
--total
let hours = Math.floor(total / (60 * 60))
let minutes = Math.floor(total % (60 * 60) / 60)
let seconds = Math.floor(total % (60 * 60) % 60)
time = `${util.formateTime(hours)}小时${util.formateTime(minutes)}${util.formateTime(seconds)}`
}else{
clearInterval(that.timer)
}
that.remainingTime = time
},1000)
}
}
},
mounted() { mounted() {
this.getData() this.getData()
this.addLeaveEvent()
}, },
methods: { methods: {
getData() { getData() {
let duration = new Date(new Date(this.endTime).getTime() - new Date().getTime()) / 1000
let time = `${Math.floor(duration / 3600)}小时${Math.floor(duration % 3600 / 60)}${Math.floor(duration % 3600 % 60)}`
this.remainingTime = time
let data = { let data = {
assessmentId: this.id, assessmentId: this.id,
keyword: this.keyword, keyword: this.keyword,
@ -149,7 +177,6 @@ export default {
let list = res.data let list = res.data
this.paperName = list.paperName this.paperName = list.paperName
this.paperScore = list.paperScore this.paperScore = list.paperScore
this.remainingTime = list.remainingTime
this.shouldArrive = list.shouldArrive this.shouldArrive = list.shouldArrive
this.inExamination = list.inExamination this.inExamination = list.inExamination
this.completed = list.completed this.completed = list.completed
@ -157,7 +184,15 @@ export default {
this.listData = list.list.list ? list.list.list : [] this.listData = list.list.list ? list.list.list : []
this.total = list.totalCount this.total = list.totalCount
}) })
.catch(err => {}) .catch(err => {
clearInterval(this.timer)
})
},
addLeaveEvent(){
this.timer = setInterval(this.getData,1000)
this.$once('hook:beforeDestroy',() => {
clearInterval(this.timer)
})
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.page = val this.page = val
@ -210,6 +245,7 @@ export default {
margin-left: 20px; margin-left: 20px;
color: #333; color: #333;
text-align: center; text-align: center;
height: 36px;
line-height: 36px; line-height: 36px;
font-size: 14px; font-size: 14px;
background-color: #f4f4f4; background-color: #f4f4f4;
@ -250,10 +286,9 @@ export default {
} }
} }
.table{ .table{
padding: 10px; padding: 15px;
margin-top: 10px; margin-top: 10px;
background-color: #efefef; background-color: #efefef;
} }
} }
} }

@ -11,6 +11,7 @@
<el-select v-model="assessmentId" clearable placeholder="请选择批阅状态" @change="getData"> <el-select v-model="assessmentId" clearable placeholder="请选择批阅状态" @change="getData">
<el-option label="不限" value=""></el-option> <el-option label="不限" value=""></el-option>
<el-option v-for="(item,index) in reviewStatusList" :key="index" :label="item.name" :value="item.id"></el-option> <el-option v-for="(item,index) in reviewStatusList" :key="index" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -49,7 +50,11 @@
<el-table-column prop="stuName" label="真实姓名" align="center"></el-table-column> <el-table-column prop="stuName" label="真实姓名" align="center"></el-table-column>
<el-table-column prop="stuNo" label="学号" align="center"></el-table-column> <el-table-column prop="stuNo" label="学号" align="center"></el-table-column>
<el-table-column prop="handPaperTime" label="交卷时间" align="center"></el-table-column> <el-table-column prop="handPaperTime" label="交卷时间" align="center"></el-table-column>
<el-table-column prop="timeSpent" label="答题用时(分钟)" align="center"></el-table-column> <el-table-column prop="timeSpent" label="答题用时(分钟)" align="center">
<template slot-scope="scope">
{{transferToMinutes(scope.row.timeSpent)}}
</template>
</el-table-column>
<el-table-column prop="name" label="考试状态" align="center"> <el-table-column prop="name" label="考试状态" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{getExamStatusName(scope.row.examinationStatus)}} {{getExamStatusName(scope.row.examinationStatus)}}
@ -63,7 +68,7 @@
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="review(scope.row,false)">查看</el-button> <el-button type="text" @click="review(scope.row,false)">查看</el-button>
<el-button type="text" @click="review(scope.row,true)" v-if="scope.row.reviewStatus == 0 && scope.row.reviewStatus == 1">批阅</el-button> <el-button type="text" @click="review(scope.row,true)" v-if="(scope.row.reviewStatus == 0 || scope.row.reviewStatus == 1) && scope.row.examinationStatus == 2">批阅</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -86,6 +91,18 @@ export default {
data() { data() {
return { return {
assessmentId: '', assessmentId: '',
reviewStatusList: [
{
id: 0,
name: '未批阅'
},{
id: 1,
name: '批阅部分'
},{
id: 2,
name: '已批阅'
}
],
keyword: '', keyword: '',
listData: [], listData: [],
page: 1, page: 1,
@ -99,7 +116,7 @@ export default {
'userId','clientId' 'userId','clientId'
]), ]),
...mapState('assessment', [ ...mapState('assessment', [
'id','reviewStatusList','examStatusList' 'id','examStatusList'
]), ]),
...mapGetters('assessment', [ ...mapGetters('assessment', [
'getReviewStatusName','getExamStatusName' 'getReviewStatusName','getExamStatusName'
@ -135,11 +152,15 @@ export default {
review(row,isReview){ review(row,isReview){
this.setReviewInfo({ this.setReviewInfo({
isReview, isReview,
id: row.id, id: row.assessmentId,
paperId: row.paperId, paperId: row.paperId,
stuId: row.stuId,
reviewStatus: row.reviewStatus reviewStatus: row.reviewStatus
}) })
this.$router.push('/testPaper/doReview') this.$router.push('/testPaper/doReview')
},
transferToMinutes(seconds){
return isNaN(seconds) ? seconds : (seconds / 60).toFixed(2)
} }
} }
}; };

@ -36,7 +36,7 @@
<div class="flex j-between m-b-20"> <div class="flex j-between m-b-20">
<div class="flex a-center"> <div class="flex a-center">
<p class="hr_tag"></p> <p class="hr_tag"></p>
<span>分类管理</span> <span>题目列表</span>
</div> </div>
<div> <div>
<!-- <el-button type="primary" size="small" round @click="delAllData" v-auth>取消共享</el-button> --> <!-- <el-button type="primary" size="small" round @click="delAllData" v-auth>取消共享</el-button> -->
@ -61,7 +61,6 @@
<el-table-column label="操作" align="center" width="120"> <el-table-column label="操作" align="center" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="show(scope.row)" v-auth>查看</el-button> <el-button type="text" @click="show(scope.row)" v-auth>查看</el-button>
<el-button v-if="scope.row.myShare" type="text" @click="cancelShare(scope.row)">取消共享</el-button>
<el-button type="text" @click="delData(scope.row)" v-auth>删除</el-button> <el-button type="text" @click="delData(scope.row)" v-auth>删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -152,18 +151,6 @@ export default {
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
cancelShare(row) {
this.$confirm('确定要取消共享吗?', '提示', {
type: 'info'
})
.then(() => {
this.$post(`${this.api.cancelByMySharing}?ids=${row.id}`).then(res => {
this.$message.success('取消共享成功');
this.getData()
}).catch(res => {});
})
.catch(() => {});
},
delData(row) { delData(row) {
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要删除吗?', '提示', {
type: 'warning' type: 'warning'

@ -100,13 +100,13 @@
<el-table-column prop="knowledgePoints" label="知识点" width="140" align="center"></el-table-column> <el-table-column prop="knowledgePoints" label="知识点" width="140" align="center"></el-table-column>
<el-table-column prop="useNum" label="使用次数" width="100" align="center"></el-table-column> <el-table-column prop="useNum" label="使用次数" width="100" align="center"></el-table-column>
<el-table-column prop="createTime" label="上传时间" width="140" align="center"></el-table-column> <el-table-column prop="createTime" label="上传时间" width="140" align="center"></el-table-column>
<el-table-column label="操作" width="170" align="center"> <el-table-column label="操作" width="200" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="show(scope.row)">查看</el-button> <el-button type="text" @click="show(scope.row)">查看</el-button>
<el-button type="text" @click="edit(scope.row)">修改</el-button> <el-button type="text" @click="edit(scope.row)">修改</el-button>
<el-button type="text" @click="share(scope.row)">共享</el-button>
<el-button type="text" @click="delData(scope.row)">删除</el-button> <el-button type="text" @click="delData(scope.row)">删除</el-button>
<!-- <el-button type="text" @click="cancelShare(scope.row)">取消共享</el-button> --> <el-button v-if="!scope.row.myShare" type="text" @click="share(scope.row)">共享</el-button>
<el-button v-else type="text" @click="cancelShare(scope.row)">取消共享</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -282,11 +282,7 @@ export default {
type: 'info' type: 'info'
}) })
.then(() => { .then(() => {
let data = { this.$post(`${this.api.cancelByMySharing}?ids=${row.id}`).then(res => {
userId: this.userId,
qid: row.id
}
this.$post(this.api.delete,data).then(res => {
this.$message.success('取消共享成功'); this.$message.success('取消共享成功');
this.getData() this.getData()
}).catch(res => {}); }).catch(res => {});
@ -315,11 +311,13 @@ export default {
this.multipleSelection = []; this.multipleSelection = [];
this.$message.success('共享成功'); this.$message.success('共享成功');
this.getData() this.getData()
}).catch(res => {}); }).catch(res => {
this.getData()
})
}) })
.catch(() => {}); .catch(() => {});
}else{ }else{
this.$message.error('请先选择数据'); this.$message.error('请先选择数据');
} }
}, },
cancelShareBatch() { cancelShareBatch() {

@ -468,7 +468,7 @@ export default {
}) })
this.listData = newData this.listData = newData
this.total = newData.length this.total = newData.length
this.$refs.listData.clearSelection() this.$refs.listTable.clearSelection()
}) })
.catch(err => {}); .catch(err => {});
}, },
@ -633,12 +633,13 @@ export default {
let index = i.replace('countCheck','') let index = i.replace('countCheck','')
if(this[`countNumberInput${index}`]){ if(this[`countNumberInput${index}`]){
everyIsZero = false everyIsZero = false
if(this[`countNumberInput${index}`] < this.pointRules[index-1]){ invalid = true
invalid = true // if(this[`countNumberInput${index}`] < this.pointRules[index-1]){
}else if(this[`countNumberInput${index}`] > this.pointRules[index-1]){ // invalid = true
this.$message.error('题目数量不能大于可选题数') // }else if(this[`countNumberInput${index}`] > this.pointRules[index-1]){
return false // this.$message.error('')
} // return false
// }
} }
}else{ }else{
invalid = true invalid = true
@ -655,7 +656,6 @@ export default {
let remainder = 100 % totalCount let remainder = 100 % totalCount
let avgPoint = 100 / totalCount let avgPoint = 100 / totalCount
if(remainder) avgPoint = (100 - remainder) / totalCount if(remainder) avgPoint = (100 - remainder) / totalCount
this.singleCount = '' this.singleCount = ''
this.multipleCount = '' this.multipleCount = ''
this.fillBlankCount = '' this.fillBlankCount = ''
@ -780,8 +780,6 @@ export default {
coursesList: this.course, coursesList: this.course,
schoolId: this.clientId, schoolId: this.clientId,
userId: this.userId, userId: this.userId,
// schoolId: 2,
// userId: 2,
} }
this.$post(this.api.getQuestionListBySelect,data) this.$post(this.api.getQuestionListBySelect,data)
.then(res => { .then(res => {

@ -201,14 +201,21 @@ export default {
let totalScore = singleCount * row.singleChoiceScore + multipleCount * row.multipleChoiceScore + fillBlankCount * row.fillBlanksScore + judgeCount * row.judgeScore + briefCount * row.briefAnswerScore let totalScore = singleCount * row.singleChoiceScore + multipleCount * row.multipleChoiceScore + fillBlankCount * row.fillBlanksScore + judgeCount * row.judgeScore + briefCount * row.briefAnswerScore
if(totalScore < 100) return this.$message.warning('总分值未满100分,请重新设置') if(totalScore < 100) return this.$message.warning('总分值未满100分,请重新设置')
if(totalScore > 100) return this.$message.warning('总分值超过100分,请重新设置') if(totalScore > 100) return this.$message.warning('总分值超过100分,请重新设置')
this.$post(`${this.api.modifyState}?id=${row.id}`).then(res => {
let data = row
data.state = 1
data.singleChoiceNum = singleCount
data.multipleChoiceNum = multipleCount
data.judgeNum = judgeCount
data.fillBlanksNum = fillBlankCount
data.briefAnswerNum = briefCount
this.$post(this.api.modifyState,data).then(res => {
this.$message.success('发布成功') this.$message.success('发布成功')
this.getData() this.getData()
}).catch(res => {}) }).catch(res => {})
}).catch(err => {}) }).catch(err => {})
} }
}) }).catch(err => {})
.catch(err => {})
}, },
preview(row){ preview(row){
this.setInfo({ this.setInfo({

@ -90,7 +90,6 @@
<el-button type="text" @click="copy(scope.row)" v-auth>复制</el-button> <el-button type="text" @click="copy(scope.row)" v-auth>复制</el-button>
<el-button type="text" @click="edit(scope.row)" v-auth>修改</el-button> <el-button type="text" @click="edit(scope.row)" v-auth>修改</el-button>
<el-button type="text" @click="delData(scope.row)" v-auth>删除</el-button> <el-button type="text" @click="delData(scope.row)" v-auth>删除</el-button>
<el-button type="text" @click="review(scope.row)" v-auth>批阅</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -212,14 +211,14 @@ export default {
}) })
.then(() => { .then(() => {
this.$post(`${this.api.delByMyTestPaper}?ids=${delList.join()}`).then(res => { this.$post(`${this.api.delByMyTestPaper}?ids=${delList.join()}`).then(res => {
this.multipleSelection = []; this.multipleSelection = []
this.$message.success('删除成功'); this.$message.success('删除成功')
this.getData() this.getData()
}).catch(res => {}); }).catch(res => {})
}) })
.catch(() => {}); .catch(() => {})
}else{ }else{
this.$message.error('请先选择数据 !'); this.$message.error('请先选择数据 !')
} }
}, },
publish(row){ publish(row){
@ -243,14 +242,21 @@ export default {
let totalScore = singleCount * row.singleChoiceScore + multipleCount * row.multipleChoiceScore + fillBlankCount * row.fillBlanksScore + judgeCount * row.judgeScore + briefCount * row.briefAnswerScore let totalScore = singleCount * row.singleChoiceScore + multipleCount * row.multipleChoiceScore + fillBlankCount * row.fillBlanksScore + judgeCount * row.judgeScore + briefCount * row.briefAnswerScore
if(totalScore < 100) return this.$message.warning('总分值未满100分,请重新设置') if(totalScore < 100) return this.$message.warning('总分值未满100分,请重新设置')
if(totalScore > 100) return this.$message.warning('总分值超过100分,请重新设置') if(totalScore > 100) return this.$message.warning('总分值超过100分,请重新设置')
this.$post(`${this.api.modifyState}?id=${row.id}`).then(res => {
let data = row
data.state = 1
data.singleChoiceNum = singleCount
data.multipleChoiceNum = multipleCount
data.judgeNum = judgeCount
data.fillBlanksNum = fillBlankCount
data.briefAnswerNum = briefCount
this.$post(this.api.modifyState,data).then(res => {
this.$message.success('发布成功') this.$message.success('发布成功')
this.getData() this.getData()
}).catch(res => {}) }).catch(res => {})
}).catch(err => {}) }).catch(err => {})
} }
}) }).catch(err => {})
.catch(err => {})
}, },
preview(row){ preview(row){
this.setInfo({ this.setInfo({
@ -269,9 +275,6 @@ export default {
edit(row){ edit(row){
this.$router.push(`add?id=${row.id}`) this.$router.push(`add?id=${row.id}`)
}, },
review(row){
this.$router.push('review')
},
addTestPaper(){ addTestPaper(){
this.$router.push('add') this.$router.push('add')
}, },

@ -16,7 +16,7 @@ const Setting = {
showProgressBar: true, showProgressBar: true,
// 接口请求地址 // 接口请求地址
// apiBaseURL: env === 'development' ? 'http://192.168.31.152:8001' : 'http://39.108.250.202:8000/', // apiBaseURL: env === 'development' ? 'http://192.168.31.152:8001' : 'http://39.108.250.202:8000/',
apiBaseURL: env === 'development' ? 'http://39.108.250.202:9000' : 'http://39.108.250.202:9000', apiBaseURL: env === 'development' ? 'http://192.168.31.152:8001' : 'http://39.108.250.202:9000',
// 接口请求返回错误时,弹窗的持续时间,单位:秒 // 接口请求返回错误时,弹窗的持续时间,单位:秒
modalDuration: 3, modalDuration: 3,
// 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice // 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice

@ -5,6 +5,7 @@ export default {
namespaced: true, namespaced: true,
state: { state: {
id: '', id: '',
stuId: '',
assessmentId: '', assessmentId: '',
assessmentName: '', assessmentName: '',
classId: '' classId: ''
@ -15,6 +16,7 @@ export default {
mutations: { mutations: {
SET_INFO: (state, info) => { SET_INFO: (state, info) => {
state.id = info.id state.id = info.id
state.stuId = info.stuId
state.assessmentId = info.assessmentId state.assessmentId = info.assessmentId
state.assessmentName = info.assessmentName state.assessmentName = info.assessmentName
state.classId = info.classId state.classId = info.classId

@ -5,8 +5,10 @@ export default {
namespaced: true, namespaced: true,
state: { state: {
id: '', id: '',
endTime: '',
reviewId: '', reviewId: '',
paperId: '', paperId: '',
stuId: '',
isReview: false, isReview: false,
reviewStatus: '', reviewStatus: '',
typeList: [ typeList: [
@ -66,7 +68,10 @@ export default {
name: '未考' name: '未考'
},{ },{
id: 1, id: 1,
name: '已考试' name: '在考'
},{
id: 2,
name: '已考'
} }
], ],
correctingList: [ correctingList: [
@ -102,10 +107,12 @@ export default {
mutations: { mutations: {
SET_INFO: (state, info) => { SET_INFO: (state, info) => {
state.id = info.id state.id = info.id
state.endTime = info.endTime
}, },
SET_REVIEW_INFO: (state, info) => { SET_REVIEW_INFO: (state, info) => {
state.reviewId = info.id state.reviewId = info.id
state.paperId = info.paperId state.paperId = info.paperId
state.stuId = info.stuId
state.isReview = info.isReview state.isReview = info.isReview
state.reviewStatus = info.reviewStatus state.reviewStatus = info.reviewStatus
}, },

Loading…
Cancel
Save