|
@@ -3,18 +3,22 @@
|
|
|
<vuescroll ref="score-main-warp">
|
|
|
<SimpleAnalysis :examInfo="examInfo" v-show="!showTest" :overviewInfo="overviewInfo"></SimpleAnalysis>
|
|
|
<div class="ev-target-box dark-iview-select">
|
|
|
- <span class="filter-label" v-if="examInfo.grades && examInfo.grades.length > 0">{{$t('learnActivity.score.gradeLabel')}}</span>
|
|
|
- <Select filterable v-model="chooseGrade" class="filter-select" size="small" v-if="examInfo.grades && examInfo.grades.length > 0" style="margin-right:5px" transfer>
|
|
|
+ <!-- 筛选年级 这里也可以根据owner判断是否筛选年级 -->
|
|
|
+ <span class="filter-label" v-if="examInfo.owner == 'school'">{{$t('learnActivity.score.gradeLabel')}}</span>
|
|
|
+ <Select filterable v-model="chooseGrade" class="filter-select" size="small" v-if="examInfo.owner == 'school'" style="margin-right:5px" transfer>
|
|
|
<Option v-for="(item,index) in examInfo.grades" :value="item.id" :key="index">{{ item.name }}</Option>
|
|
|
</Select>
|
|
|
+ <!-- 筛选班级 -->
|
|
|
<span>{{$t('learnActivity.score.classLabel')}}</span>
|
|
|
<Select filterable v-model="chooseClass" class="filter-select" style="width:140px;" @on-change="getClassStudent" size="small" transfer>
|
|
|
<Option v-for="(item,index) in classList" :value="item.id" :key="index">{{ item.name }}</Option>
|
|
|
</Select>
|
|
|
- <span class="filter-label" v-show="examInfo.code == 'Exam-'+$store.state.userInfo.schoolCode">{{$t('learnActivity.score.subjectLabel')}}</span>
|
|
|
- <Select filterable v-model="chooseSubject" class="filter-select" size="small" @on-change="getCurPaper" v-show="examInfo.code == 'Exam-'+$store.state.userInfo.schoolCode" transfer>
|
|
|
+ <!-- 筛选学科 应该根据owner判断是否需要筛选学科 -->
|
|
|
+ <span class="filter-label" v-if="examInfo.owner == 'school'">{{$t('learnActivity.score.subjectLabel')}}</span>
|
|
|
+ <Select filterable v-model="chooseSubject" class="filter-select" size="small" @on-change="getCurPaper" v-if="examInfo.owner == 'school'" transfer>
|
|
|
<Option v-for="(item,index) in examInfo.subjects" :value="item.id" :key="index">{{ item.name }}</Option>
|
|
|
</Select>
|
|
|
+ <!-- 筛选学生 -->
|
|
|
<span style="margin-left:5px" v-show="showTest">{{$t('learnActivity.score.stuLabel')}}</span>
|
|
|
<Select filterable v-model="chooseStudent.id" label-in-value class="filter-select" style="width:140px;" size="small" clearable @on-change="setStuInfo" v-show="showTest" transfer>
|
|
|
<Option v-for="(item,index) in students" :value="item.id" :key="index">
|
|
@@ -22,6 +26,7 @@
|
|
|
{{ item.name }}
|
|
|
</Option>
|
|
|
</Select>
|
|
|
+ <!-- 切换打分UI -->
|
|
|
<span v-show="showTest" class="common-icon-text" style=" float: right; margin-right: 25px;" @click="toggleScoreStatus" icon="md-apps">
|
|
|
<Icon :custom="showTest ? 'iconfont icon-table':'iconfont icon-scoring'" style="margin-right:5px;" />
|
|
|
{{showTest ? $t('learnActivity.score.scoreView'):$t('learnActivity.score.scoring')}}
|
|
@@ -36,9 +41,6 @@
|
|
|
<span style="color:#2db7f5;" v-else>{{row.data[qIndex]}}</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <!-- <template slot-scope="{ row,index }" slot="total">
|
|
|
- <strong>{{getcount(studentScore[row._index].data)}}</strong>
|
|
|
- </template> -->
|
|
|
<!-- 1: 未作答 2:未评分 3:已评分 -->
|
|
|
<template slot-scope="{ row,index }" slot="status">
|
|
|
<span class="stu-status-tag" @click="getStuScore(row,0)" :style="{'background':row.status == 1 ? '#c5c8ce' : row.status == 2 ? '#ff9900' : '#19be6b', 'cursor':row.status == 1 ? 'text':'pointer'}">
|
|
@@ -57,14 +59,11 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</vuescroll>
|
|
|
- <!-- <div class="mark-viewer">
|
|
|
- <MarkView></MarkView>
|
|
|
- </div> -->
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import PaperScore from "./PaperScore.vue";
|
|
|
-import MarkView from "./markpaper/MarkView.vue";
|
|
|
import SimpleAnalysis from "./SimpleAnalysis.vue";
|
|
|
export default {
|
|
|
props: {
|
|
@@ -76,7 +75,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
- PaperScore, SimpleAnalysis, MarkView
|
|
|
+ PaperScore, SimpleAnalysis
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -216,6 +215,7 @@ export default {
|
|
|
//点击学生题号前往评分页面
|
|
|
getStuScore(data, qIndex) {
|
|
|
if (data.status == 2 || data.status == 3) {
|
|
|
+ //暂时注释原来的评分页面
|
|
|
this.$refs['paperScore'].isComplete = false
|
|
|
this.showTest = true
|
|
|
this.defaultIndex = qIndex
|
|
@@ -226,9 +226,18 @@ export default {
|
|
|
if (answerIndex >= 0) {
|
|
|
this.chooseStudent["scores"] = this.paperInfo[this.chooseClass].studentAns.studentScores[answerIndex]
|
|
|
this.chooseStudent["answers"] = this.paperInfo[this.chooseClass].studentAns.studentAnswers[answerIndex]
|
|
|
- this.chooseStudent["mark"] = this.paperInfo[this.chooseClass].studentAns.mark[answerIndex] || '' //批注
|
|
|
+ this.chooseStudent["mark"] = this.paperInfo[this.chooseClass].studentAns.mark ? this.paperInfo[this.chooseClass].studentAns.mark[answerIndex] || '' : '' //批注
|
|
|
this.chooseStudent["status"] = false
|
|
|
}
|
|
|
+
|
|
|
+ // 前往新的阅卷页面
|
|
|
+ // this.$router.push({
|
|
|
+ // name: 'MarkView',
|
|
|
+ // params: {
|
|
|
+ // type: 1,
|
|
|
+ // from: this.$route.name
|
|
|
+ // }
|
|
|
+ // })
|
|
|
}
|
|
|
},
|
|
|
//获取当前学生信息
|
|
@@ -240,7 +249,7 @@ export default {
|
|
|
if (answerIndex >= 0) {
|
|
|
this.chooseStudent["scores"] = this.paperInfo[this.chooseClass].studentAns.studentScores[answerIndex];
|
|
|
this.chooseStudent["answers"] = this.paperInfo[this.chooseClass].studentAns.studentAnswers[answerIndex];
|
|
|
- this.chooseStudent["mark"] = this.paperInfo[this.chooseClass].studentAns.mark[answerIndex];
|
|
|
+ this.chooseStudent["mark"] = this.paperInfo[this.chooseClass].studentAns.mark ? this.paperInfo[this.chooseClass].studentAns.mark[answerIndex] || '' : '' //批注
|
|
|
this.chooseStudent["status"] = false;
|
|
|
}
|
|
|
}
|
|
@@ -255,64 +264,140 @@ export default {
|
|
|
}
|
|
|
}, 0);
|
|
|
},
|
|
|
- // 获取班级名单
|
|
|
- getClassStudent() {
|
|
|
+ // 获取班级名单 使用PrivScoring.vue方法,兼容班级和自定义名单功能
|
|
|
+ // getClassStudent() {
|
|
|
+ // this.tableData = []
|
|
|
+ // if (!this.chooseClass) return
|
|
|
+ // this.showTest = false
|
|
|
+ // this.tableLoading = true
|
|
|
+ // let requestData = {
|
|
|
+ // ids: [this.chooseClass],
|
|
|
+ // scope: this.examInfo.scope == 'private' ? 'private' : 'school',
|
|
|
+ // // school_code: this.examInfo.scope == 'private' ? this.$store.state.userInfo.TEAMModelId : this.$store.state.userInfo.schoolCode,
|
|
|
+ // school_code: this.$store.state.userInfo.schoolCode
|
|
|
+ // };
|
|
|
+ // this.$api.schoolSetting.getClassroomStudent(requestData).then((res) => {
|
|
|
+ // if (!res.error) {
|
|
|
+ // if (!this.paperInfo[this.chooseClass]) {
|
|
|
+ // this.paperInfo[this.chooseClass] = {}
|
|
|
+ // }
|
|
|
+ // let classStu = {
|
|
|
+ // students: res.stus.length ? res.stus[0] : [],
|
|
|
+ // id: this.chooseClass
|
|
|
+ // }
|
|
|
+ // this.$set(this.paperInfo[this.chooseClass], "students", classStu)
|
|
|
+ // this.students = []
|
|
|
+ // this.studentScore = []
|
|
|
+ // this.tableColumn = [...this.scoreList]
|
|
|
+ // let defSocre = []
|
|
|
+ // if (this.examInfo.progress == 'pending') {//如果评测未发布,没有学生数据,则直接渲染表格
|
|
|
+ // this.quCount = this.paperInfo.item ? this.paperInfo.item.length : 0
|
|
|
+ // for (let i = 0; i < this.quCount; i++) {
|
|
|
+ // let data = {
|
|
|
+ // title: "Q" + (i + 1),
|
|
|
+ // slot: "qu" + i,
|
|
|
+ // align: "center",
|
|
|
+ // minWidth: 65,
|
|
|
+ // }
|
|
|
+ // this.tableColumn.push(data)
|
|
|
+ // defSocre.push(-1)
|
|
|
+ // }
|
|
|
+ // let classStu = this.paperInfo[this.chooseClass].students.students
|
|
|
+ // for (let k = 0; k < classStu.length; k++) {
|
|
|
+ // let score = {}
|
|
|
+ // score.name = classStu[k].name
|
|
|
+ // score.id = classStu[k].id
|
|
|
+ // score.data = defSocre
|
|
|
+ // score.total = 0
|
|
|
+ // score.status = 1
|
|
|
+ // this.studentScore.push(score)
|
|
|
+ // }
|
|
|
+ // this.pageChange(1)
|
|
|
+ // this.tableLoading = false
|
|
|
+ // } else {//如果获取进行中或已结束则需要拉取学生数据
|
|
|
+ // this.getStudentAnswer()
|
|
|
+ // }
|
|
|
+
|
|
|
+ // } else {
|
|
|
+ // this.$Message.error("API ERROR!");
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ async getClassStudent() {
|
|
|
this.tableData = []
|
|
|
if (!this.chooseClass) return
|
|
|
this.showTest = false
|
|
|
this.tableLoading = true
|
|
|
- let requestData = {
|
|
|
- ids: [this.chooseClass],
|
|
|
- scope: this.examInfo.scope == 'private' ? 'private' : 'school',
|
|
|
- // school_code: this.examInfo.scope == 'private' ? this.$store.state.userInfo.TEAMModelId : this.$store.state.userInfo.schoolCode,
|
|
|
- school_code: this.$store.state.userInfo.schoolCode
|
|
|
- };
|
|
|
- this.$api.schoolSetting.getClassroomStudent(requestData).then((res) => {
|
|
|
- if (!res.error) {
|
|
|
- if (!this.paperInfo[this.chooseClass]) {
|
|
|
- this.paperInfo[this.chooseClass] = {}
|
|
|
+ let stuRes = undefined
|
|
|
+ try {
|
|
|
+ //个人自定义名单则直接根据学生id换name
|
|
|
+ if (this.examInfo.scope == 'private') {
|
|
|
+ let stuListInfo = this.privStuList.find(item => {
|
|
|
+ return item.id == this.chooseClass
|
|
|
+ })
|
|
|
+ if (stuListInfo) {
|
|
|
+ stuRes = await this.$api.courseMgmt.findStuSummary({
|
|
|
+ students: stuListInfo.students
|
|
|
+ })
|
|
|
}
|
|
|
- let classStu = {
|
|
|
- students: res.stus.length ? res.stus[0] : [],
|
|
|
- id: this.chooseClass
|
|
|
+ }
|
|
|
+ //校本名单或教室则根据班级id或学生
|
|
|
+ else {
|
|
|
+ let requestData = {
|
|
|
+ ids: [this.chooseClass],
|
|
|
+ scope: this.examInfo.scope,
|
|
|
+ // school_code: this.examInfo.scope == 'private' ? this.$store.state.userInfo.TEAMModelId : this.$store.state.userInfo.schoolCode,
|
|
|
+ school_code: this.$store.state.userInfo.schoolCode
|
|
|
}
|
|
|
- this.$set(this.paperInfo[this.chooseClass], "students", classStu)
|
|
|
- this.students = []
|
|
|
- this.studentScore = []
|
|
|
- this.tableColumn = [...this.scoreList]
|
|
|
- let defSocre = []
|
|
|
- if (this.examInfo.progress == 'pending') {//如果评测未发布,没有学生数据,则直接渲染表格
|
|
|
- this.quCount = this.paperInfo.item ? this.paperInfo.item.length : 0
|
|
|
- for (let i = 0; i < this.quCount; i++) {
|
|
|
- let data = {
|
|
|
- title: "Q" + (i + 1),
|
|
|
- slot: "qu" + i,
|
|
|
- align: "center",
|
|
|
- minWidth: 65,
|
|
|
- }
|
|
|
- this.tableColumn.push(data)
|
|
|
- defSocre.push(-1)
|
|
|
- }
|
|
|
- let classStu = this.paperInfo[this.chooseClass].students.students
|
|
|
- for (let k = 0; k < classStu.length; k++) {
|
|
|
- let score = {}
|
|
|
- score.name = classStu[k].name
|
|
|
- score.id = classStu[k].id
|
|
|
- score.data = defSocre
|
|
|
- score.total = 0
|
|
|
- score.status = 1
|
|
|
- this.studentScore.push(score)
|
|
|
+ stuRes = await this.$api.schoolSetting.getClassroomStudent(requestData)
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ this.$Message.error('API ERROR')
|
|
|
+ this.tableLoading = false
|
|
|
+ }
|
|
|
+ if (!stuRes.error) {
|
|
|
+ if (!this.paperInfo[this.chooseClass]) {
|
|
|
+ this.paperInfo[this.chooseClass] = {}
|
|
|
+ }
|
|
|
+ let classStu = {
|
|
|
+ students: this.examInfo.scope == 'private' ? stuRes.stus || [] : stuRes.stus ? stuRes.stus[0] : [],
|
|
|
+ id: this.chooseClass
|
|
|
+ }
|
|
|
+ this.$set(this.paperInfo[this.chooseClass], "students", classStu)
|
|
|
+ this.students = []
|
|
|
+ this.studentScore = []
|
|
|
+ this.tableColumn = [...this.scoreList]
|
|
|
+ let defSocre = []
|
|
|
+ if (this.examInfo.progress == 'pending') {//如果评测未发布,没有学生数据,则直接渲染表格
|
|
|
+ this.quCount = this.paperInfo.item ? this.paperInfo.item.length : 0
|
|
|
+ for (let i = 0; i < this.quCount; i++) {
|
|
|
+ let data = {
|
|
|
+ title: "Q" + (i + 1),
|
|
|
+ slot: "qu" + i,
|
|
|
+ align: "center",
|
|
|
+ minWidth: 65,
|
|
|
}
|
|
|
- this.pageChange(1)
|
|
|
- this.tableLoading = false
|
|
|
- } else {//如果获取进行中或已结束则需要拉取学生数据
|
|
|
- this.getStudentAnswer()
|
|
|
+ this.tableColumn.push(data)
|
|
|
+ defSocre.push(-1)
|
|
|
}
|
|
|
-
|
|
|
- } else {
|
|
|
- this.$Message.error("API ERROR!");
|
|
|
+ let classStu = this.paperInfo[this.chooseClass].students.students
|
|
|
+ for (let k = 0; k < classStu.length; k++) {
|
|
|
+ let score = {}
|
|
|
+ score.name = classStu[k].name
|
|
|
+ score.id = classStu[k].id
|
|
|
+ score.data = defSocre
|
|
|
+ score.total = 0
|
|
|
+ score.status = 1
|
|
|
+ this.studentScore.push(score)
|
|
|
+ }
|
|
|
+ this.pageChange(1)
|
|
|
+ this.tableLoading = false
|
|
|
+ } else {//如果获取进行中或已结束则需要拉取学生数据
|
|
|
+ this.getStudentAnswer()
|
|
|
}
|
|
|
- })
|
|
|
+ } else {
|
|
|
+ this.$Message.error("API ERROR!");
|
|
|
+ }
|
|
|
},
|
|
|
//计算总览数据
|
|
|
calcOverView(data) {
|
|
@@ -482,12 +567,12 @@ export default {
|
|
|
if (n.subjects && n.subjects.length) {
|
|
|
this.chooseSubject = n.subjects[0].id;
|
|
|
}
|
|
|
-
|
|
|
if (n.grades && n.grades.length) {
|
|
|
this.chooseGrade = n.grades[0].id;
|
|
|
}
|
|
|
if (n.papers && n.papers.length) {
|
|
|
- if (n.code == 'Exam' + this.$store.state.userInfo.schoolCode) { //**现在不能通过scope判断是校本还是个人发布的评测
|
|
|
+ // if (n.code == 'Exam' + this.$store.state.userInfo.schoolCode) { //**现在不能通过scope判断是校本还是个人发布的评测
|
|
|
+ if (n.owner == 'school') { //**现在不能通过scope判断是校本还是个人发布的评测,后面讨论添加了owner字段区分个人评测还是校本评测
|
|
|
let res = n.papers.find((item) => {
|
|
|
return item.subjectId == this.chooseSubject;
|
|
|
});
|
|
@@ -498,6 +583,7 @@ export default {
|
|
|
} else {
|
|
|
this.paperInfo = {};
|
|
|
}
|
|
|
+ // 这里与PrivScoring.vue还少一段代码,不确定是否需要,暂时没有复制过来
|
|
|
},
|
|
|
deep: true,
|
|
|
},
|
|
@@ -539,27 +625,23 @@ export default {
|
|
|
//发布对象为校本名单
|
|
|
if (this.examInfo.scope == 'school') {
|
|
|
this.showTest = false
|
|
|
- let classes = this.schoolClassList.filter(item => {
|
|
|
- return this.examInfo.classes.indexOf(item.id) >= 0 && (item.gradeId == this.chooseGrade || !this.chooseGrade)
|
|
|
- })
|
|
|
+ let classes = []
|
|
|
+ // 校本会有年级条件
|
|
|
+ if (this.examInfo.owner == 'school') {
|
|
|
+ classes = this.schoolClassList.filter(item => {
|
|
|
+ return this.examInfo.classes.indexOf(item.id) >= 0 && (item.gradeId == this.chooseGrade || !this.chooseGrade)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ classes = this.schoolClassList.filter(item => {
|
|
|
+ return this.examInfo.classes.indexOf(item.id) >= 0
|
|
|
+ })
|
|
|
+ }
|
|
|
return classes
|
|
|
}
|
|
|
// 发布对象为个人创建的自定义名单
|
|
|
else {
|
|
|
//根据classes查询班级信息
|
|
|
if (!this.privStuList) {
|
|
|
- // this.$api.schoolSetting.getClassByIds({
|
|
|
- // code: this.$store.state.userInfo.TEAMModelId,
|
|
|
- // ids: this.examInfo.classes
|
|
|
- // }).then(
|
|
|
- // res => {
|
|
|
- // if (res.className && res.className.length) this.chooseClass = res.className[0].id
|
|
|
- // this.privStuList = res.className
|
|
|
- // },
|
|
|
- // err => {
|
|
|
- // console.log(err)
|
|
|
- // }
|
|
|
- // )
|
|
|
//查询当前老师所有stulist
|
|
|
let params = {
|
|
|
code: this.$store.state.userInfo.TEAMModelId,
|
|
@@ -587,8 +669,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
- mounted() {
|
|
|
- },
|
|
|
created() {
|
|
|
this.$store.dispatch('user/getSchoolProfile').then(
|
|
|
res => {
|