master
yujialong 4 years ago
parent 1660f87faf
commit 8e0bfc1d00
  1. 6
      src/libs/util.js
  2. 29
      src/mixins/examDo/index.js
  3. 3
      src/pages/achievement/assessment/index.vue
  4. 6
      src/pages/achievement/list/examResults.vue
  5. 6
      src/pages/achievement/list/practiceResults.vue
  6. 1
      src/pages/achievement/practice/index.vue
  7. 109
      src/pages/exam/do/index.vue
  8. 10
      src/pages/exam/list/index.vue
  9. 35
      src/pages/index/list/index.vue
  10. 75
      src/pages/practice/do/index.vue
  11. 15
      src/pages/practice/list/myPractice.vue
  12. 6
      src/pages/practice/list/randomPractice.vue
  13. 72
      src/pages/practice/randomDo/index.vue
  14. 2
      src/pages/wrongBook/do/index.vue
  15. 25
      src/pages/wrongBook/list/index.vue
  16. 4
      src/setting.js
  17. 1
      src/store/modules/user.js
  18. 22
      src/styles/common.scss
  19. 1
      src/styles/pages/messageBoard.scss
  20. 7
      src/styles/pages/testPaperDetail.scss

@ -106,15 +106,15 @@ const util = {
},
// 成功提示
successMsg(message) {
Message.success({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration: 1500})
Message.success({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration: 3000})
},
// 警告提示
warningMsg(message) {
Message.warning({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration: 1500})
Message.warning({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration: 3000})
},
// 错误提示
errorMsg(message) {
Message.error({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration: 1500})
Message.error({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration: 3000})
},
}

@ -29,6 +29,12 @@ export default {
},
updateProgress(item,isFillBlank){
let subjects = this.subjects
let singleAnswered = []
let multipleAnswered = []
let judgeAnswered = []
let fillBlankAnswered = []
let briefAnswerAnswered = []
if(isFillBlank){
let index = item.getAttribute('data-index')
if([...item.parentElement.querySelectorAll('input')].some(n => n.value)){
@ -37,12 +43,35 @@ export default {
subjects[3][index].hadAnswer = 0
}
this.fillBlankAnsweredCount = subjects[3].filter(n => n.hadAnswer).length
subjects[3].map((n,i) => {
n.hadAnswer && fillBlankAnswered.push(i)
})
this.fillBlankAnswered = fillBlankAnswered
}else{
this.singleAnsweredCount = subjects[0].filter(n => n.val).length
this.multipleAnsweredCount = subjects[1].filter(n => n.val.length).length
this.judgeAnsweredCount = subjects[2].filter(n => n.val).length
this.briefAnswerAnsweredCount = subjects[4].filter(n => n.val).length
subjects[0].map((n,i) => {
n.val && singleAnswered.push(i)
})
subjects[1].map((n,i) => {
n.val.length && multipleAnswered.push(i)
})
subjects[2].map((n,i) => {
n.val && judgeAnswered.push(i)
})
subjects[4].map((n,i) => {
n.val && briefAnswerAnswered.push(i)
})
this.singleAnswered = singleAnswered
this.multipleAnswered = multipleAnswered
this.judgeAnswered = judgeAnswered
this.briefAnswerAnswered = briefAnswerAnswered
}
let answered = this.singleAnsweredCount + this.multipleAnsweredCount + this.judgeAnsweredCount + this.fillBlankAnsweredCount + this.briefAnswerAnsweredCount
this.progress = this.totalLen ? Math.floor((answered / this.totalLen * 100)) : 0
},

@ -87,8 +87,6 @@
<div class="player" id="player"></div>
</div>
<pdf :visible.sync="pdfVisible" :src.sync="pdfSrc"></pdf>
<a ref="videoLink" style="display: none;" crossOrigin="anonymous" download="用户上传视频.mp4" :href="videoSrc">下载</a>
<a ref="picLink" style="display: none;" crossOrigin="anonymous" download="用户上传图片.jpg" :href="imgSrc">下载</a>
</div>
</div>
</div>
@ -196,6 +194,7 @@ export default {
if(n.typeName == '填空题'){
n.answer = answer.join(',')
n.user_answer = n.user_answer ? n.user_answer.split('&lt;&gt;').filter(n => n).join(',') : ''
n.question_stem = n.question_stem.replace(/\(\)\(\)\(\)/g,`______`)
}
n.options = options
}

@ -65,7 +65,7 @@ export default {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.getData()
this.initData()
},500)
}
},
@ -82,6 +82,10 @@ export default {
this.total = res.data.list.totalCount
}).catch(res => {})
},
initData(){
this.page = 1
this.getData()
},
handleCurrentChange(val) {
this.page = val
this.getData()

@ -70,7 +70,7 @@ export default {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.getData()
this.initData()
},500)
}
},
@ -89,6 +89,10 @@ export default {
this.total = res.data.list.totalCount
}).catch(res => {})
},
initData(){
this.page = 1
this.getData()
},
handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'

@ -157,6 +157,7 @@ export default {
}
n.answer = answer.join(',')
n.userAnswer = n.userAnswer ? n.userAnswer.split('&lt;&gt;').filter(n => n).join(',') : ''
n.questionStem = n.questionStem.replace(/\(\)\(\)\(\)/g,`______`)
}
if(n.fileUrl) n.fileUrl = JSON.parse(n.fileUrl)
if(n.videoAudio) n.videoAudio = JSON.parse(n.videoAudio)

@ -10,34 +10,34 @@
<el-progress :percentage="progress" :show-text="false"></el-progress>
</div>
<div>
<div class="item">
<p class="type">单选题({{singleCount}}合计{{singlePoint}})</p>
<div class="item" v-if="singleCount">
<p class="type">单选题({{singlePoint}}/{{singleCount}}合计{{singlePoint * singleCount}})</p>
<div class="nums">
<span v-for="n in singleCount" :class="{active: n <= singleAnsweredCount}" :key="n">{{n}}</span>
<span v-for="n in singleCount" :class="{active: singleAnswered.includes(n - 1)}" :key="n">{{n}}</span>
</div>
</div>
<div class="item">
<p class="type">多选题({{multipleCount}}合计{{multipleChoiceScore}})</p>
<div class="item" v-if="multipleCount">
<p class="type">多选题({{multipleChoiceScore}}/{{multipleCount}}合计{{multipleChoiceScore * multipleCount}})</p>
<div class="nums">
<span v-for="n in multipleCount" :class="{active: n <= multipleAnsweredCount}" :key="n">{{n}}</span>
<span v-for="n in multipleCount" :class="{active: multipleAnswered.includes(n - 1)}" :key="n">{{n}}</span>
</div>
</div>
<div class="item">
<p class="type">判断题({{judgeCount}}合计{{judgeScore}})</p>
<div class="item" v-if="judgeCount">
<p class="type">判断题({{judgeScore}}/{{judgeCount}}合计{{judgeScore * judgeCount}})</p>
<div class="nums">
<span v-for="n in judgeCount" :class="{active: n <= judgeAnsweredCount}" :key="n">{{n}}</span>
<span v-for="n in judgeCount" :class="{active: judgeAnswered.includes(n - 1)}" :key="n">{{n}}</span>
</div>
</div>
<div class="item">
<p class="type">填空题({{fillBlankCount}}合计{{fillBlanksScore}})</p>
<div class="item" v-if="fillBlankCount">
<p class="type">填空题({{fillBlanksScore}}/{{fillBlankCount}}合计{{fillBlanksScore * fillBlankCount}})</p>
<div class="nums">
<span v-for="n in fillBlankCount" :class="{active: n <= fillBlankAnsweredCount}" :key="n">{{n}}</span>
<span v-for="n in fillBlankCount" :class="{active: fillBlankAnswered.includes(n - 1)}" :key="n">{{n}}</span>
</div>
</div>
<div class="item">
<p class="type">简答题({{briefAnswerCount}}合计{{briefAnswerScore}})</p>
<div class="item" v-if="briefAnswerCount">
<p class="type">简答题({{briefAnswerScore}}/{{briefAnswerCount}}合计{{briefAnswerScore * briefAnswerCount}})</p>
<div class="nums">
<span v-for="n in briefAnswerCount" :class="{active: n <= briefAnswerAnsweredCount}" :key="n">{{n}}</span>
<span v-for="n in briefAnswerCount" :class="{active: briefAnswerAnswered.includes(n - 1)}" :key="n">{{n}}</span>
</div>
</div>
<div class="btn">
@ -87,7 +87,7 @@
>
<el-button type="primary" class="ml20">上传文件</el-button>
</el-upload>
<el-input type="textarea" rows="5" v-model="item.val" @input="updateProgress"></el-input>
<el-input type="textarea" rows="5" resize="none" v-model="item.val" @input="updateProgress"></el-input>
</template>
</div>
</div>
@ -121,6 +121,11 @@ export default {
judgeAnsweredCount: 0,
fillBlankAnsweredCount: 0,
briefAnswerAnsweredCount: 0,
singleAnswered: [],
multipleAnswered: [],
judgeAnswered: [],
fillBlankAnswered: [],
briefAnswerAnswered: [],
singlePoint: 0,
multipleChoiceScore: 0,
@ -188,6 +193,7 @@ export default {
this.$get(`${this.api.enterExam}?testPaperId=${this.testPaperId}&userId=${this.userId}&assessmentId=${this.assessmentId}`)
.then(res => {
let data = res.data
if(res.data.entertime) this.startTime = new Date(res.data.entertime).getTime()
this.subjects = [
[...data.singleChoiceList],
[...data.multipleChoiceList],
@ -209,8 +215,7 @@ export default {
this.scoreList = [this.singlePoint,this.multipleChoiceScore,this.fillBlanksScore,this.briefAnswerScore,this.briefAnswerScore]
this.handleOptions()
})
.catch(err => {})
}).catch(err => {})
},
getAnswer() {
this.$get(`${this.api.queryGzAnswerDetails}?userId=${this.userId}&assessmentId=${this.assessmentId}&testPaperId=${this.testPaperId}`)
@ -239,6 +244,7 @@ export default {
n.value = answer[j]
})
n.val = answered.userAnswer
if(answer.filter(n => n).length) n.hadAnswer = 1
}else{
n.val = answered.userAnswer
}
@ -248,6 +254,33 @@ export default {
}
})
})
let subjects = this.subjects
let singleAnswered = []
let multipleAnswered = []
let judgeAnswered = []
let fillBlankAnswered = []
let briefAnswerAnswered = []
subjects[0].map((n,i) => {
n.val && singleAnswered.push(i)
})
subjects[1].map((n,i) => {
n.val.length && multipleAnswered.push(i)
})
subjects[2].map((n,i) => {
n.val && judgeAnswered.push(i)
})
subjects[3].map((n,i) => {
n.hadAnswer && fillBlankAnswered.push(i)
})
subjects[4].map((n,i) => {
n.val && briefAnswerAnswered.push(i)
})
this.singleAnswered = singleAnswered
this.multipleAnswered = multipleAnswered
this.judgeAnswered = judgeAnswered
this.fillBlankAnswered = fillBlankAnswered
this.briefAnswerAnswered = briefAnswerAnswered
})
.catch(err => {})
},
@ -300,6 +333,7 @@ export default {
this.$post(`${this.api.getStateById}?id=${this.assessmentId}`)
.then(res => {
if(res.data.state == '已结束'){
clearInterval(this.queryStateTimer)
this.isDone = true
this.save()
}
@ -328,14 +362,16 @@ export default {
if(i == 1){
userAnswer = n.val.join('')
}else if(i == 3){
userAnswer = [...document.querySelectorAll(`.stem${i}${k} input`)].map(n => n.value).join('&lt;&gt;')
userAnswer = [...document.querySelectorAll(`.stem${i}${k} input`)].map(n => n.value).filter(n => n).join('&lt;&gt;')
}else{
userAnswer = n.val
}
n.fileUrl = JSON.stringify(n.fileUrl)
n.video = JSON.stringify(n.video)
if(n.fileUrl == '{}') n.fileUrl = ''
if(n.video == '{}') n.video = ''
let fileUrl = n.fileUrl
let videoAudio = n.video
fileUrl = JSON.stringify(fileUrl)
videoAudio = JSON.stringify(videoAudio)
if(fileUrl == '{}') fileUrl = ''
if(videoAudio == '{}') videoAudio = ''
data1.push({
assessmentId: this.assessmentId,
questionId: n.id,
@ -343,12 +379,11 @@ export default {
testPaperId: this.testPaperId,
userAnswer,
userId: this.userId,
fileUrl: n.fileUrl,
videoAudio: n.video
fileUrl,
videoAudio
})
})
})
this.$post(`${this.api.coverGzAnswerDetails}?userId=${this.userId}&testPaperId=${this.testPaperId}&assessmentId=${this.assessmentId}`)
.then(res => {
this.$post(`${this.api.addGzAnswerDetails}`,data1)
@ -393,14 +428,16 @@ export default {
if(i == 1){
userAnswer = n.val.join('')
}else if(i == 3){
userAnswer = [...document.querySelectorAll(`.stem${i}${k} input`)].map(n => n.value).join('&lt;&gt;')
userAnswer = [...document.querySelectorAll(`.stem${i}${k} input`)].map(n => n.value).filter(n => n).join('&lt;&gt;')
}else{
userAnswer = n.val
}
n.fileUrl = JSON.stringify(n.fileUrl)
n.video = JSON.stringify(n.video)
if(n.fileUrl == '{}') n.fileUrl = ''
if(n.video == '{}') n.video = ''
let fileUrl = n.fileUrl
let videoAudio = n.video
fileUrl = JSON.stringify(fileUrl)
videoAudio = JSON.stringify(videoAudio)
if(fileUrl == '{}') fileUrl = ''
if(videoAudio == '{}') videoAudio = ''
data1.push({
testPaperId: this.testPaperId,
assessmentId: this.assessmentId,
@ -409,19 +446,17 @@ export default {
testPaperId: this.testPaperId,
userAnswer: userAnswer,
userId: this.userId,
fileUrl: n.fileUrl,
videoAudio: n.video
fileUrl,
videoAudio
})
})
})
this.$post(`${this.api.coverGzAnswerDetails}?userId=${this.userId}&testPaperId=${this.testPaperId}&assessmentId=${this.assessmentId}`)
.then(res => {
this.$post(`${this.api.coverGzAnswerDetails}?userId=${this.userId}&testPaperId=${this.testPaperId}&assessmentId=${this.assessmentId}`).then(res => {
this.$post(`${this.api.addGzAnswerDetails}`,data1)
.then(res => {})
.catch(err => {})
})
.catch(err => {})
}).catch(err => {})
}
},
},

@ -10,7 +10,7 @@
<ul class="filter">
<li>
<label>考试类型</label>
<el-select v-model="type" clearable placeholder="请选择考试类型" size="small" @change="getData">
<el-select v-model="type" clearable placeholder="请选择考试类型" size="small" @change="initData">
<el-option label="不限" value=""></el-option>
<el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.id"></el-option>
</el-select>
@ -53,7 +53,7 @@
{{getAssessmentStateName(scope.row.assessmentState)}}
</template>
</el-table-column>
<el-table-column label="操作" width="150">
<el-table-column label="操作" width="150" align="center">
<template slot-scope="scope">
<!-- 学生考试状态:考试状态 state: (0未考 1在考 2已考)
考核状态: state: 考核状态(1待开始 2进行中 3已结束) -->
@ -112,7 +112,7 @@ export default {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.getData()
this.initData()
},500)
}
},
@ -132,6 +132,10 @@ export default {
clearInterval(this.timer)
})
},
initData(){
this.page = 1
this.getData()
},
addInterval(){
this.timer = setInterval(this.getData,1000)
this.$once('hook:beforeDestroy',() => {

@ -6,16 +6,15 @@
<a class="item active">考试日历</a>
</div>
<div class="page-content">
<div class="tool">
<ul class="filter">
<li>
<label>创建时间</label>
<el-date-picker v-model="date" align="right" unlink-panels type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable size="small"></el-date-picker>
</li>
</ul>
</div>
<template v-if="listData.length">
<div class="tool">
<ul class="filter">
<li>
<label>创建时间</label>
<el-date-picker v-model="date" align="right" unlink-panels type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable size="small"></el-date-picker>
</li>
</ul>
</div>
<el-table :data="listData" ref="table" row-key="id" class="table" stripe header-align="center">
<el-table-column type="index" width="100" label="序号" align="center">
<template
@ -25,7 +24,7 @@
<el-table-column prop="assessmentName" label="考试名称" align="center"></el-table-column>
<el-table-column prop="startTime" label="考试开始时间" align="center"></el-table-column>
<el-table-column prop="endTime" label="考试结束时间" align="center"></el-table-column>
<el-table-column label="操作" width="200">
<el-table-column label="操作" width="200" align="center">
<template slot-scope="scope">
<el-button type="text" @click="toExam(scope.row)" v-if="scope.row.assessmentState == 2 && scope.row.studentState != 2">进入考试</el-button>
<el-button type="text" @click="toExam(scope.row)" disabled v-if="scope.row.studentState == 2">已经交卷</el-button>
@ -186,7 +185,7 @@ export default {
this.startTime = ''
this.endTime = ''
}
this.getData()
this.initData()
}
},
components: {
@ -194,8 +193,8 @@ export default {
breadcrumb
},
mounted() {
let now = util.formatDate('yyyy-MM-dd')
let second = util.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + 86400000))
let now = util.formatDate('yyyy-MM-dd',new Date(new Date().getTime() - 1296000000))
let second = util.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + 1296000000))
this.date = [now,second]
this.startTime = now
this.endTime = second
@ -222,6 +221,10 @@ export default {
this.total = res.data.list.totalCount
}).catch(err => {})
},
initData(){
this.page = 1
this.getData()
},
handleCurrentChange(val) {
this.page = val
this.getData()
@ -249,7 +252,9 @@ export default {
this.avgScore = list.length ? (avgScore / list.length).toFixed(2) : 0
let totalDuration = 0
list.map(n => totalDuration += n.duration)
list.map(n => {
if(!isNaN(n.duration)) totalDuration += n.duration
})
this.totalDuration = (totalDuration / 60).toFixed(2)
this.practiceDateList = list.map(n => {
let date = new Date(n.startTime)
@ -337,6 +342,8 @@ export default {
}).catch(res => {})
},
submitComment(row){
let content = row.replyContent
if(!content) return util.errorMsg('请填写内容')
let data = {
bid: row.bid,
content: row.replyContent,

@ -9,34 +9,34 @@
<el-progress :percentage="progress" :show-text="false"></el-progress>
</div>
<div>
<div class="item">
<p class="type">单选题({{singleCount}}合计{{singlePoint}})</p>
<div class="item" v-if="singleCount">
<p class="type">单选题({{singlePoint}}/{{singleCount}}合计{{singlePoint * singleCount}})</p>
<div class="nums">
<span v-for="n in singleCount" :class="{active: n <= singleAnsweredCount}" :key="n">{{n}}</span>
<span v-for="n in singleCount" :class="{active: singleAnswered.includes(n - 1)}" :key="n">{{n}}</span>
</div>
</div>
<div class="item">
<p class="type">多选题({{multipleCount}}合计{{multipleChoiceScore}})</p>
<div class="item" v-if="multipleCount">
<p class="type">多选题({{multipleChoiceScore}}/{{multipleCount}}合计{{multipleChoiceScore * multipleCount}})</p>
<div class="nums">
<span v-for="n in multipleCount" :class="{active: n <= multipleAnsweredCount}" :key="n">{{n}}</span>
<span v-for="n in multipleCount" :class="{active: multipleAnswered.includes(n - 1)}" :key="n">{{n}}</span>
</div>
</div>
<div class="item">
<p class="type">判断题({{judgeCount}}合计{{judgeScore}})</p>
<div class="item" v-if="judgeCount">
<p class="type">判断题({{judgeScore}}/{{judgeCount}}合计{{judgeScore * judgeCount}})</p>
<div class="nums">
<span v-for="n in judgeCount" :class="{active: n <= judgeAnsweredCount}" :key="n">{{n}}</span>
<span v-for="n in judgeCount" :class="{active: judgeAnswered.includes(n - 1)}" :key="n">{{n}}</span>
</div>
</div>
<div class="item">
<p class="type">填空题({{fillBlankCount}}合计{{fillBlanksScore}})</p>
<div class="item" v-if="fillBlankCount">
<p class="type">填空题({{fillBlanksScore}}/{{fillBlankCount}}合计{{fillBlanksScore * fillBlankCount}})</p>
<div class="nums">
<span v-for="n in fillBlankCount" :class="{active: n <= fillBlankAnsweredCount}" :key="n">{{n}}</span>
<span v-for="n in fillBlankCount" :class="{active: fillBlankAnswered.includes(n - 1)}" :key="n">{{n}}</span>
</div>
</div>
<div class="item">
<p class="type">简答题({{briefAnswerCount}}合计{{briefAnswerScore}})</p>
<div class="item" v-if="briefAnswerCount">
<p class="type">简答题({{briefAnswerScore}}/{{briefAnswerCount}}合计{{briefAnswerScore * briefAnswerCount}})</p>
<div class="nums">
<span v-for="n in briefAnswerCount" :class="{active: n <= briefAnswerAnsweredCount}" :key="n">{{n}}</span>
<span v-for="n in briefAnswerCount" :class="{active: briefAnswerAnswered.includes(n - 1)}" :key="n">{{n}}</span>
</div>
</div>
<div class="btn">
@ -86,7 +86,7 @@
>
<el-button type="primary" class="ml20">上传文件</el-button>
</el-upload>
<el-input type="textarea" rows="5" v-model="item.val" @input="updateProgress"></el-input>
<el-input type="textarea" rows="5" resize="none" v-model="item.val" @input="updateProgress"></el-input>
</template>
</div>
</div>
@ -119,6 +119,11 @@ export default {
judgeAnsweredCount: 0,
fillBlankAnsweredCount: 0,
briefAnswerAnsweredCount: 0,
singleAnswered: [],
multipleAnswered: [],
judgeAnswered: [],
fillBlankAnswered: [],
briefAnswerAnswered: [],
singlePoint: 0,
multipleChoiceScore: 0,
@ -172,11 +177,11 @@ export default {
this.judgeCount = data.list4.length
this.briefAnswerCount = data.list5.length
this.singlePoint = data.list1.length ? data.list1[0].singleChoiceScore * this.singleCount : 0
this.multipleChoiceScore = data.list2.length ? data.list2[0].multipleChoiceScore * this.multipleCount : 0
this.judgeScore = data.list4.length ? data.list4[0].judgeScore * this.judgeCount : 0
this.fillBlanksScore = data.list3.length ? data.list3[0].fillBlanksScore * this.fillBlankCount : 0
this.briefAnswerScore = data.list5.length ? data.list5[0].briefAnswerScore * this.briefAnswerCount : 0
this.singlePoint = data.list1.length ? data.list1[0].singleChoiceScore : 0
this.multipleChoiceScore = data.list2.length ? data.list2[0].multipleChoiceScore : 0
this.judgeScore = data.list4.length ? data.list4[0].judgeScore : 0
this.fillBlanksScore = data.list3.length ? data.list3[0].fillBlanksScore : 0
this.briefAnswerScore = data.list5.length ? data.list5[0].briefAnswerScore : 0
this.scoreList = [this.singlePoint,this.multipleChoiceScore,this.fillBlanksScore,this.briefAnswerScore,this.briefAnswerScore]
window.updateProgress = (item) => {
@ -249,6 +254,7 @@ export default {
n.value = answer[j]
})
n.val = answered.user_answer
if(answer.filter(n => n).length) n.hadAnswer = 1
}else{
n.val = answered.user_answer
}
@ -256,6 +262,33 @@ export default {
}
})
})
let subjects = this.subjects
let singleAnswered = []
let multipleAnswered = []
let judgeAnswered = []
let fillBlankAnswered = []
let briefAnswerAnswered = []
subjects[0].map((n,i) => {
n.val && singleAnswered.push(i)
})
subjects[1].map((n,i) => {
n.val.length && multipleAnswered.push(i)
})
subjects[2].map((n,i) => {
n.val && judgeAnswered.push(i)
})
subjects[3].map((n,i) => {
n.hadAnswer && fillBlankAnswered.push(i)
})
subjects[4].map((n,i) => {
n.val && briefAnswerAnswered.push(i)
})
this.singleAnswered = singleAnswered
this.multipleAnswered = multipleAnswered
this.judgeAnswered = judgeAnswered
this.fillBlankAnswered = fillBlankAnswered
this.briefAnswerAnswered = briefAnswerAnswered
}
}).catch(err => {})
},

@ -23,7 +23,7 @@
{{getDegreeName(scope.row.degree)}}
</template>
</el-table-column>
<el-table-column prop="duration" label="时长(分钟)" align="center">
<el-table-column prop="duration" label="最后一次时长(分钟)" align="center">
<template slot-scope="scope">
<p>{{scope.row.duration | defaultShow}}</p>
</template>
@ -75,7 +75,7 @@ export default {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.getData()
this.initData()
},500)
}
},
@ -92,6 +92,10 @@ export default {
this.total = res.data.pageUtils.totalCount
}).catch(res => {})
},
initData(){
this.page = 1
this.getData()
},
handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
@ -105,11 +109,11 @@ export default {
.catch(() => {});
},
handleSelectionChange(val) {
this.multipleSelection = val;
this.multipleSelection = val
},
handleCurrentChange(val) {
this.page = val;
this.getData();
this.page = val
this.getData()
},
practice(row){
if(row.isHava){
@ -118,6 +122,7 @@ export default {
title: '提示',
confirmButtonText: '是',
cancelButtonText: '否',
customClass: 'normal'
}).then(_ => {
this.toDo(row,0)
}).catch(() => {

@ -52,7 +52,7 @@ export default {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.getData()
this.initData()
},500)
}
},
@ -66,6 +66,10 @@ export default {
this.total = res.data.list.totalCount
}).catch(res => {})
},
initData(){
this.page = 1
this.getData()
},
handleSelectionChange(val) {
this.multipleSelection = val
},

@ -4,34 +4,34 @@
<div class="box">
<div class="page left">
<div>
<div class="item" style="border-top: 0">
<p class="type">单选题({{singleCount}}合计{{singlePoint}})</p>
<div class="item" style="border-top: 0" v-if="singleCount">
<p class="type">单选题({{avgScore}}/{{singleCount}}合计{{singleCount * avgScore}})</p>
<div class="nums">
<span v-for="n in singleCount" :class="{active: n <= singleAnsweredCount}" :key="n">{{n}}</span>
<span v-for="n in singleCount" :class="{active: singleAnswered.includes(n - 1)}" :key="n">{{n}}</span>
</div>
</div>
<div class="item">
<p class="type">多选题({{multipleCount}}合计{{multipleChoiceScore}})</p>
<div class="item" v-if="multipleCount">
<p class="type">多选题({{avgScore}}/{{multipleCount}}合计{{multipleCount * avgScore}})</p>
<div class="nums">
<span v-for="n in multipleCount" :class="{active: n <= multipleAnsweredCount}" :key="n">{{n}}</span>
<span v-for="n in multipleCount" :class="{active: multipleAnswered.includes(n - 1)}" :key="n">{{n}}</span>
</div>
</div>
<div class="item">
<p class="type">判断题({{judgeCount}}合计{{judgeScore}})</p>
<div class="item" v-if="judgeCount">
<p class="type">判断题({{avgScore}}/{{judgeCount}}合计{{judgeCount * avgScore}})</p>
<div class="nums">
<span v-for="n in judgeCount" :class="{active: n <= judgeAnsweredCount}" :key="n">{{n}}</span>
<span v-for="n in judgeCount" :class="{active: judgeAnswered.includes(n - 1)}" :key="n">{{n}}</span>
</div>
</div>
<div class="item">
<p class="type">填空题({{fillBlankCount}}合计{{fillBlanksScore}})</p>
<div class="item" v-if="fillBlankCount">
<p class="type">填空题({{avgScore}}/{{fillBlankCount}}合计{{fillBlankCount * avgScore}})</p>
<div class="nums">
<span v-for="n in fillBlankCount" :class="{active: n <= fillBlankAnsweredCount}" :key="n">{{n}}</span>
<span v-for="n in fillBlankCount" :class="{active: fillBlankAnswered.includes(n - 1)}" :key="n">{{n}}</span>
</div>
</div>
<div class="item">
<p class="type">简答题({{briefAnswerCount}}合计{{briefAnswerScore}})</p>
<div class="item" v-if="briefAnswerCount">
<p class="type">简答题({{avgScore}}/{{briefAnswerCount}}合计{{briefAnswerCount * avgScore}})</p>
<div class="nums">
<span v-for="n in briefAnswerCount" :class="{active: n <= briefAnswerAnsweredCount}" :key="n">{{n}}</span>
<span v-for="n in briefAnswerCount" :class="{active: briefAnswerAnswered.includes(n - 1)}" :key="n">{{n}}</span>
</div>
</div>
<div class="btn">
@ -54,7 +54,7 @@
<div class="options">
<template v-if="item.name == '单项选择' || item.name == '判断题'">
<div class="option">
<el-radio-group v-model="item.val" @change.once="updateProgress">
<el-radio-group v-model="item.val" @change.once="val => updateProgress(val,0,index)">
<el-radio v-for="(option,i) in item.options" :key="i" :label="i">
{{i}}.{{item.options[i]}}
</el-radio>
@ -62,14 +62,14 @@
</div>
</template>
<template v-if="item.name == '多项选择'">
<el-checkbox-group v-model="item.val" @change="updateProgress">
<el-checkbox-group v-model="item.val" @change="val => updateProgress(val,0,index)">
<el-checkbox class="option-check" :label="i" v-for="(option,i) in item.options" :key="i">
{{i}}.{{item.options[i]}}
</el-checkbox>
</el-checkbox-group>
</template>
<template v-if="item.name == '简答题'">
<el-input type="textarea" rows="5" v-model="item.val" @input="updateProgress"></el-input>
<el-input type="textarea" rows="5" resize="none" v-model="item.val" @input="val => updateProgress(val,0,index)"></el-input>
</template>
</div>
</div>
@ -101,12 +101,13 @@ export default {
judgeAnsweredCount: 0,
fillBlankAnsweredCount: 0,
briefAnswerAnsweredCount: 0,
singleAnswered: [],
multipleAnswered: [],
judgeAnswered: [],
fillBlankAnswered: [],
briefAnswerAnswered: [],
singlePoint: 0,
multipleChoiceScore: 0,
judgeScore: 0,
fillBlanksScore: 0,
briefAnswerScore: 0,
avgScore: 0,
scoreList: [],
questionType: ['单选题','多选题','判断题','填空题','简答题'],
submiting: false
@ -123,12 +124,11 @@ export default {
},
methods: {
getData() {
this.$post(`${this.api.randomPractice}?userId=${this.userId}&schoolId=${this.clientId}`)
.then(res => {
this.$post(`${this.api.randomPractice}?userId=${this.userId}&schoolId=${this.clientId}`).then(res => {
let data = res.data
this.randomId = data.randomId
this.$post(`${this.api.previewPaper}?qid=${data.qid}`)
.then(res => {
let qid = data.qid
this.$post(`${this.api.previewPaper}?qid=${data.qid}`).then(res => {
let data = res.data
let subjects = [
[...data.list1],
@ -143,12 +143,9 @@ export default {
this.judgeCount = data.list4.length
this.briefAnswerCount = data.list5.length
this.singlePoint = data.list1.length ? data.list1[0].singleChoiceScore * this.singleCount : 0
this.multipleChoiceScore = data.list2.length ? data.list2[0].multipleChoiceScore * this.multipleCount : 0
this.judgeScore = data.list4.length ? data.list4[0].judgeScore * this.judgeCount : 0
this.fillBlanksScore = data.list3.length ? data.list3[0].fillBlanksScore * this.fillBlankCount : 0
this.briefAnswerScore = data.list5.length ? data.list5[0].briefAnswerScore * this.briefAnswerCount : 0
this.scoreList = [this.singlePoint,this.multipleChoiceScore,this.fillBlanksScore,this.briefAnswerScore,this.briefAnswerScore]
this.avgScore = parseInt(100 / qid.split(',').length)
console.log(11,this.avgScore,this.singleCount)
this.scoreList = [this.singlePoint,this.multipleChoiceScore,this.briefAnswerScore,this.fillBlanksScore,this.briefAnswerScore]
window.updateProgress = (item) => {
this.updateProgress(item,1)
@ -208,15 +205,12 @@ export default {
this.$post(`${this.api.AddRandomPractiseExamAnswerDetail}`,data1)
.then(res => {
this.$post(`${this.api.addPractiseRecordRandom}?userId=${this.userId}&randomId=${this.randomId}`)
.then(res => {
this.$post(`${this.api.addPractiseRecordRandom}?userId=${this.userId}&randomId=${this.randomId}`).then(res => {
this.submiting = false
util.successMsg('提交成功')
this.$router.push('list?isRandom=true')
})
.catch(err => {})
})
.catch(err => {})
}).catch(err => {})
}).catch(err => {})
},
},
}

@ -69,7 +69,7 @@
</el-checkbox-group>
</template>
<template v-if="item.name == '简答题'">
<el-input type="textarea" rows="5" v-model="item.val" @input="updateProgress"></el-input>
<el-input type="textarea" rows="5" resize="none" v-model="item.val" @input="updateProgress"></el-input>
</template>
</div>
</div>

@ -16,13 +16,13 @@
</li>
<li>
<label>试卷名称</label>
<el-select v-model="paperId" placeholder="请选择试卷名称" size="small" @change="getData">
<el-select v-model="paperId" placeholder="请选择试卷名称" size="small" @change="initData">
<el-option v-for="(item,index) in nameList" :key="index" :label="item.paperName" :value="item.paperId"></el-option>
</el-select>
</li>
<li>
<label>试题类型</label>
<el-select v-model="typeId" clearable placeholder="请选择试题类型" size="small" @change="getData">
<el-select v-model="typeId" clearable placeholder="请选择试题类型" size="small" @change="initData">
<el-option label="不限" value=""></el-option>
<el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.id"></el-option>
</el-select>
@ -43,7 +43,11 @@
slot-scope="scope"
>{{scope.$index + (page - 1) * pageSize + 1}}</template>
</el-table-column>
<el-table-column prop="questionStem" label="错题题干名称" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="questionStem" label="错题题干名称" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope">
<div class="ellipsis" v-html="scope.row.questionStem"></div>
</template>
</el-table-column>
<el-table-column label="题目来源" width="120" align="center">
<template>
{{type == 1 ? '考试' : '练习'}}
@ -72,7 +76,7 @@
<p class="val" v-html="quesInfo.questionStem"></p>
<div class="media" :id="quesInfo.mediaEleId"></div>
</div>
<div class="meta">
<div class="meta" v-if="quesInfo.typeId == 1 || quesInfo.typeId == 2">
<p class="key">选项</p>
<div class="val">
<p v-for="(option,i) in quesInfo.options" :key="i">{{i}}.{{quesInfo.options[i]}}</p>
@ -175,7 +179,7 @@ export default {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.getData()
this.initData()
},500)
}
},
@ -186,10 +190,18 @@ export default {
getData() {
this.$post(`${this.api.getMineWrong}?type=${this.type}&pageNum=${this.page}&pageSize=${this.pageSize}&paperId=${this.paperId}&userId=${this.userId}&typeId=${this.typeId}&knowledgePoints=${this.keyword}`)
.then(res => {
this.listData = util.removeHtmlTag(res.data.pageUtils.list,'questionStem')
let list = util.removeHtmlTag(res.data.pageUtils.list,'questionStem')
list.map(n => {
n.questionStem = n.questionStem.replace(/\(\)\(\)\(\)/g,`______`)
})
this.listData = list
this.total = res.data.pageUtils.totalCount
}).catch(err => {})
},
initData(){
this.page = 1
this.getData()
},
getName() {
this.$post(`${this.api.getPaperInfo}?type=${this.type}&userId=${this.userId}`)
.then(res => {
@ -226,6 +238,7 @@ export default {
options[i.replace('option','')] = info[i]
}
}
if(info.typeId == 5) info.questionStem = info.questionStem.replace(/\(\)\(\)\(\)/g,`______`)
info.options = options
this.quesInfo = info
}).catch(err => {})

@ -15,8 +15,8 @@ const Setting = {
// 页面切换时,是否显示模拟的进度条
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:9000',
// apiBaseURL: env === 'development' ? 'http://192.168.31.151:8001' : 'http://39.108.250.202:8000',
apiBaseURL: env === 'development' ? 'http://39.108.250.202:9000' : 'http://39.108.250.202:9000',
// 接口请求返回错误时,弹窗的持续时间,单位:秒
modalDuration: 3,
// 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice

@ -72,7 +72,6 @@ export default {
})
Setting.dynamicRoute && addRoutes(routes)
util.session.set(Setting.usernameKey, user.userName)
util.session.set(Setting.storeKey, JSON.stringify(state))
util.successMsg('登录成功');
resolve()
}else{

@ -284,14 +284,16 @@
color: #ffa900;
}
}
.el-button--primary{
color: #606266;
background: #fff;
border-color: #DCDFE6;
&:hover{
color: $--color-primary;
border-color: #efbdbb;
background-color: #fae9e8;
&:not(.normal){
.el-button--primary{
color: #606266;
background: #fff;
border-color: #DCDFE6;
&:hover{
color: $--color-primary;
border-color: #efbdbb;
background-color: #fae9e8;
}
}
}
}
@ -356,6 +358,10 @@
}
}
.el-tooltip__popper{
width: 300px;
}
@media(max-width: 1600px){
.el-table{
.el-switch__label--right.is-active{

@ -1,5 +1,6 @@
.list{
li{
margin-bottom: 10px;
border-top: 1px solid #f1f1f1;
&:first-child{
border-top: 0;

@ -44,7 +44,7 @@
}
}
.wrap{
height: calc(100vh - 367px);
height: calc(100vh - 413px);
margin-top: 24px;
overflow: auto;
.item{
@ -91,6 +91,11 @@
.val{
color: rgba(0, 0, 0, 0.65);
font-size: 14px;
p{
img{
max-width: 100%;
}
}
}
.meta-mul{
display: flex;

Loading…
Cancel
Save