yujialong 4 years ago
parent 8e0bfc1d00
commit 529797521d
  1. 10
      src/layouts/navbar/index.vue
  2. 19
      src/pages/exam/do/index.vue
  3. 21
      src/pages/index/list/index.vue
  4. 20
      src/pages/practice/do/index.vue
  5. 2
      src/pages/practice/list/myPractice.vue
  6. 39
      src/pages/practice/randomDo/index.vue
  7. 37
      src/pages/wrongBook/do/index.vue
  8. 2
      src/setting.js

@ -86,11 +86,11 @@ export default {
index: '/wrongBook/list', index: '/wrongBook/list',
title: '错题练习' title: '错题练习'
}, },
{ // {
icon: 'menu-icon icon-msg', // icon: 'menu-icon icon-msg',
index: '/messageBoard/list', // index: '/messageBoard/list',
title: '交流互动' // title: ''
} // }
], ],
menus: [], menus: [],
actives: { actives: {

@ -75,16 +75,7 @@
</el-checkbox-group> </el-checkbox-group>
</template> </template>
<template v-if="item.typeId == 4"> <template v-if="item.typeId == 4">
<el-upload <el-upload class="upload" :before-upload="file => beforeUpload(file,item)" :on-remove="(file, fileList) => handleRemove(file, fileList, item)" :on-error="uploadError" :on-success="(res, file, fileList) => uploadSuccess(res, file, fileList, item)" :before-remove="beforeRemove" :on-exceed="handleExceed" :action="api.fileupload">
class="upload"
:before-upload="file => beforeUpload(file,item)"
:on-remove="(file, fileList) => handleRemove(file, fileList, item)"
:on-error="uploadError"
:on-success="(res, file, fileList) => uploadSuccess(res, file, fileList, item)"
:before-remove="beforeRemove"
:on-exceed="handleExceed"
:action="api.fileupload"
>
<el-button type="primary" class="ml20">上传文件</el-button> <el-button type="primary" class="ml20">上传文件</el-button>
</el-upload> </el-upload>
<el-input type="textarea" rows="5" resize="none" v-model="item.val" @input="updateProgress"></el-input> <el-input type="textarea" rows="5" resize="none" v-model="item.val" @input="updateProgress"></el-input>
@ -212,7 +203,7 @@ export default {
this.judgeScore = data.trueOrFalseQuestionsList.length ? data.trueOrFalseQuestionsList[0].judgeScore : 0 this.judgeScore = data.trueOrFalseQuestionsList.length ? data.trueOrFalseQuestionsList[0].judgeScore : 0
this.fillBlanksScore = data.fillInTheBlanklist.length ? data.fillInTheBlanklist[0].fillBlanksScore : 0 this.fillBlanksScore = data.fillInTheBlanklist.length ? data.fillInTheBlanklist[0].fillBlanksScore : 0
this.briefAnswerScore = data.shortAnswerList.length ? data.shortAnswerList[0].briefAnswerScore : 0 this.briefAnswerScore = data.shortAnswerList.length ? data.shortAnswerList[0].briefAnswerScore : 0
this.scoreList = [this.singlePoint,this.multipleChoiceScore,this.fillBlanksScore,this.briefAnswerScore,this.briefAnswerScore] this.scoreList = [this.singlePoint * this.singleCount,this.multipleChoiceScore * this.multipleCount,this.judgeScore * this.judgeCount,this.fillBlanksScore * this.fillBlankCount,this.briefAnswerScore * this.briefAnswerCount]
this.handleOptions() this.handleOptions()
}).catch(err => {}) }).catch(err => {})
@ -241,7 +232,7 @@ export default {
}else if(i == 3){ }else if(i == 3){
let answer = answered.userAnswer.split('&lt;&gt;'); let answer = answered.userAnswer.split('&lt;&gt;');
[...document.querySelectorAll(`.stem${i}${k} input`)].map((n,j) => { [...document.querySelectorAll(`.stem${i}${k} input`)].map((n,j) => {
n.value = answer[j] if(answer[j]) n.value = answer[j]
}) })
n.val = answered.userAnswer n.val = answered.userAnswer
if(answer.filter(n => n).length) n.hadAnswer = 1 if(answer.filter(n => n).length) n.hadAnswer = 1
@ -453,9 +444,7 @@ export default {
}) })
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) this.$post(`${this.api.addGzAnswerDetails}`,data1).then(res => {}).catch(err => {})
.then(res => {})
.catch(err => {})
}).catch(err => {}) }).catch(err => {})
} }
}, },

@ -102,7 +102,7 @@
</div> </div>
</div> </div>
<div class="page"> <!-- <div class="page">
<div class="tabs"> <div class="tabs">
<a class="item active">教师回复</a> <a class="item active">教师回复</a>
</div> </div>
@ -135,7 +135,7 @@
</template> </template>
<div class="none" v-else>暂无教师回复</div> <div class="none" v-else>暂无教师回复</div>
</div> </div>
</div> </div> -->
</div> </div>
</template> </template>
<script> <script>
@ -252,15 +252,22 @@ export default {
this.avgScore = list.length ? (avgScore / list.length).toFixed(2) : 0 this.avgScore = list.length ? (avgScore / list.length).toFixed(2) : 0
let totalDuration = 0 let totalDuration = 0
this.totalDuration = (totalDuration / 60).toFixed(2)
let practiceDateList = {}
list.map(n => { list.map(n => {
if(!isNaN(n.duration)) totalDuration += n.duration if(!isNaN(n.duration)) totalDuration += n.duration
})
this.totalDuration = (totalDuration / 60).toFixed(2)
this.practiceDateList = list.map(n => {
let date = new Date(n.startTime) let date = new Date(n.startTime)
return `${date.getMonth() + 1}.${date.getDate()}` let time = `${date.getMonth() + 1}.${date.getDate()}`
if(!isNaN(n.duration)){
if(!practiceDateList[time]){
practiceDateList[time] = n.duration
}else{
practiceDateList[time] += n.duration
}
}
}) })
this.practiceDurationList = list.map(n => n.duration) this.practiceDateList = Object.keys(practiceDateList)
this.practiceDurationList = Object.values(practiceDateList)
this.getPracticeDuration() this.getPracticeDuration()
}).catch(res => {}) }).catch(res => {})
}, },

@ -74,16 +74,8 @@
</el-checkbox-group> </el-checkbox-group>
</template> </template>
<template v-if="item.name == '简答题'"> <template v-if="item.name == '简答题'">
<el-upload <el-upload class="upload" :before-upload="file => beforeUpload(file,item)" :on-remove="(file, fileList) => handleRemove(file, fileList, item)"
class="upload" :on-error="uploadError" :on-success="(res, file, fileList) => uploadSuccess(res, file, fileList, item)" :before-remove="beforeRemove" :on-exceed="handleExceed" :action="api.fileupload">
:before-upload="file => beforeUpload(file,item)"
:on-remove="(file, fileList) => handleRemove(file, fileList, item)"
:on-error="uploadError"
:on-success="(res, file, fileList) => uploadSuccess(res, file, fileList, item)"
:before-remove="beforeRemove"
:on-exceed="handleExceed"
:action="api.fileupload"
>
<el-button type="primary" class="ml20">上传文件</el-button> <el-button type="primary" class="ml20">上传文件</el-button>
</el-upload> </el-upload>
<el-input type="textarea" rows="5" resize="none" v-model="item.val" @input="updateProgress"></el-input> <el-input type="textarea" rows="5" resize="none" v-model="item.val" @input="updateProgress"></el-input>
@ -182,7 +174,7 @@ export default {
this.judgeScore = data.list4.length ? data.list4[0].judgeScore : 0 this.judgeScore = data.list4.length ? data.list4[0].judgeScore : 0
this.fillBlanksScore = data.list3.length ? data.list3[0].fillBlanksScore : 0 this.fillBlanksScore = data.list3.length ? data.list3[0].fillBlanksScore : 0
this.briefAnswerScore = data.list5.length ? data.list5[0].briefAnswerScore : 0 this.briefAnswerScore = data.list5.length ? data.list5[0].briefAnswerScore : 0
this.scoreList = [this.singlePoint,this.multipleChoiceScore,this.fillBlanksScore,this.briefAnswerScore,this.briefAnswerScore] this.scoreList = [this.singlePoint * this.singleCount,this.multipleChoiceScore * this.multipleCount,this.judgeScore * this.judgeCount,this.fillBlanksScore * this.fillBlankCount,this.briefAnswerScore * this.briefAnswerCount]
window.updateProgress = (item) => { window.updateProgress = (item) => {
this.updateProgress(item,1) this.updateProgress(item,1)
@ -251,7 +243,7 @@ export default {
}else if(i == 3){ }else if(i == 3){
let answer = answered.user_answer.split('&lt;&gt;'); let answer = answered.user_answer.split('&lt;&gt;');
[...document.querySelectorAll(`.stem${i}${k} input`)].map((n,j) => { [...document.querySelectorAll(`.stem${i}${k} input`)].map((n,j) => {
n.value = answer[j] if(answer[j]) n.value = answer[j]
}) })
n.val = answered.user_answer n.val = answered.user_answer
if(answer.filter(n => n).length) n.hadAnswer = 1 if(answer.filter(n => n).length) n.hadAnswer = 1
@ -388,9 +380,7 @@ export default {
}) })
}) })
}) })
this.$post(`${this.api.addPractiseExamAnswerDetails}`,data1) this.$post(`${this.api.addPractiseExamAnswerDetails}`,data1).then(res => {}).catch(err => {})
.then(res => {})
.catch(err => {})
} }
}, },
}, },

@ -31,7 +31,7 @@
<el-table-column prop="practiceNum" label="练习次数" align="center"></el-table-column> <el-table-column prop="practiceNum" label="练习次数" align="center"></el-table-column>
<el-table-column prop="lastScore" label="最后一次得分" align="center"> <el-table-column prop="lastScore" label="最后一次得分" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.lastScore | defaultShow}}</p> <p>{{scope.row.lastScore == null ? '--' : (scope.row.duration == '--' ? '--' : scope.row.lastScore)}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="180"> <el-table-column label="操作" align="center" width="180">

@ -110,7 +110,8 @@ export default {
avgScore: 0, avgScore: 0,
scoreList: [], scoreList: [],
questionType: ['单选题','多选题','判断题','填空题','简答题'], questionType: ['单选题','多选题','判断题','填空题','简答题'],
submiting: false submiting: false,
isSubmit: false,
}; };
}, },
components: {breadcrumb}, components: {breadcrumb},
@ -122,6 +123,9 @@ export default {
mounted() { mounted() {
this.getData() this.getData()
}, },
beforeDestroy(){
this.addRecords()
},
methods: { methods: {
getData() { 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 => {
@ -145,7 +149,7 @@ export default {
this.avgScore = parseInt(100 / qid.split(',').length) this.avgScore = parseInt(100 / qid.split(',').length)
console.log(11,this.avgScore,this.singleCount) console.log(11,this.avgScore,this.singleCount)
this.scoreList = [this.singlePoint,this.multipleChoiceScore,this.briefAnswerScore,this.fillBlanksScore,this.briefAnswerScore] this.scoreList = [this.singleCount * this.avgScore,this.multipleCount * this.avgScore,this.judgeCount * this.avgScore,this.fillBlankCount * this.avgScore,this.briefAnswerCount * this.avgScore]
window.updateProgress = (item) => { window.updateProgress = (item) => {
this.updateProgress(item,1) this.updateProgress(item,1)
@ -203,15 +207,42 @@ export default {
}) })
}) })
this.$post(`${this.api.AddRandomPractiseExamAnswerDetail}`,data1) this.$post(`${this.api.AddRandomPractiseExamAnswerDetail}`,data1).then(res => {
.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 this.submiting = false
this.isSubmit = true
util.successMsg('提交成功') util.successMsg('提交成功')
this.$router.push('list?isRandom=true') this.$router.push('list?isRandom=true')
}).catch(err => {}) }).catch(err => {})
}).catch(err => {}) }).catch(err => {})
}, },
addRecords(){
if(!this.isSubmit){
let data1 = []
this.subjects.map((e,i) => {
e.map((n,k) => {
let userAnswer = ''
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;')
}else{
userAnswer = n.val
}
data1.push({
randomId: this.randomId,
questionId: n.questionId,
questionStatus : 1,
userAnswer,
userId: this.userId
})
})
})
this.$post(`${this.api.AddRandomPractiseExamAnswerDetail}`,data1).then(res => {
this.$post(`${this.api.addPractiseRecordRandom}?userId=${this.userId}&randomId=${this.randomId}`).then(res => {}).catch(err => {})
}).catch(err => {})
}
},
}, },
} }
</script> </script>

@ -4,34 +4,34 @@
<div class="box"> <div class="box">
<div class="page left"> <div class="page left">
<div> <div>
<div class="item" style="border-top: 0"> <div class="item" style="border-top: 0" v-if="singleCount">
<p class="type">单选题({{singleCount}}合计{{singlePoint}})</p> <p class="type">单选题({{singleCount}})</p>
<div class="nums"> <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> </div>
<div class="item"> <div class="item" v-if="multipleCount">
<p class="type">多选题({{multipleCount}}合计{{multipleChoiceScore}})</p> <p class="type">多选题({{multipleCount}})</p>
<div class="nums"> <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> </div>
<div class="item"> <div class="item" v-if="judgeCount">
<p class="type">判断题({{judgeCount}}合计{{judgeScore}})</p> <p class="type">判断题({{judgeCount}})</p>
<div class="nums"> <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> </div>
<div class="item"> <div class="item" v-if="fillBlankCount">
<p class="type">填空题({{fillBlankCount}}合计{{fillBlanksScore}})</p> <p class="type">填空题({{fillBlankCount}})</p>
<div class="nums"> <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> </div>
<div class="item"> <div class="item" v-if="briefAnswerCount">
<p class="type">简答题({{briefAnswerCount}}合计{{briefAnswerScore}})</p> <p class="type">简答题({{briefAnswerCount}})</p>
<div class="nums"> <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> </div>
<div class="btn"> <div class="btn">
@ -43,7 +43,7 @@
<div class="page right"> <div class="page right">
<template v-for="(subject,k) in subjects"> <template v-for="(subject,k) in subjects">
<div class="item" v-if="subject.length" :key="k"> <div class="item" v-if="subject.length" :key="k">
<p v-if="subjects[k].length" class="title">{{questionType[k]}}{{subjects[k].length}}合计{{scoreList[k]}}</p> <p v-if="subjects[k].length" class="title">{{questionType[k]}}{{subjects[k].length}}</p>
<div class="ques-wrap"> <div class="ques-wrap">
<div class="ques" v-for="(item,index) in subject" :key="index"> <div class="ques" v-for="(item,index) in subject" :key="index">
<div class="name-wrap"> <div class="name-wrap">
@ -119,6 +119,11 @@ export default {
judgeAnsweredCount: 0, judgeAnsweredCount: 0,
fillBlankAnsweredCount: 0, fillBlankAnsweredCount: 0,
briefAnswerAnsweredCount: 0, briefAnswerAnsweredCount: 0,
singleAnswered: [],
multipleAnswered: [],
judgeAnswered: [],
fillBlankAnswered: [],
briefAnswerAnswered: [],
singlePoint: 0, singlePoint: 0,
multipleChoiceScore: 0, multipleChoiceScore: 0,

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

Loading…
Cancel
Save