You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

289 lines
13 KiB
Vue

<!-- 练习成绩 -->
<template>
<div class="el-ErrorSet">
<el-row class="content_block">
<TitleInfo title="练习成绩" :titleImg="zjie"></TitleInfo>
<el-row class="p20" style="min-height: 320px;overflow: auto;">
<el-col :span="6">
<el-row style="overflow: auto;border: 1px solid #DEDEDE;margin-right: 20px;min-height:400px;height: calc(100vh - 220px);padding: 20px;">
<el-form ref="form" :model="search" label-width="80px">
<el-form-item label="选择班级">
<el-select clearable v-model="search.schoolClassId" style="width: 100%;" placeholder="请选择班级">
<template v-for="(item ,index) in classList">
<el-option :label="item.schoolClassIdText" :value="item.schoolClassId"></el-option>
</template>
</el-select>
</el-form-item>
<el-input placeholder="请输入学号或姓名" style="width: calc(100% - 96px)" prefix-icon="el-icon-search" v-model="search.studentOrName"></el-input>
<el-button type="primary" icon="el-icon-search" @click="getStudentList(page_stu = 1)">搜索</el-button>
</el-form>
<el-table
:data="studentList"
@row-click="tableRowClick"
border
style="width: 100%;margin-top: 10px;">
<el-table-column prop="studentName" header-align="center" align="center" label="姓名">
<template slot-scope="scope">
<span class="c_p" :style="scope.row.studentId == seeStudentId?'color:#409EFF':''">{{scope.row.studentName}}</span>
</template>
</el-table-column>
<el-table-column prop="studentSn" header-align="center" align="center" label="学号">
<template slot-scope="scope">
<span class="c_p" :style="scope.row.studentId == seeStudentId?'color:#409EFF':''">{{scope.row.studentSn}}</span>
</template>
</el-table-column>
<el-table-column prop="sumStudentScore" header-align="center" align="center" label="得分">
<template slot-scope="scope">
<span class="c_p" :style="scope.row.studentId == seeStudentId?'color:#409EFF':''">{{scope.row.sumStudentScore}}</span>
</template>
</el-table-column>
</el-table>
<div class="block" style="text-align: right;bottom: 0;width: 100%;margin-top: 20px;">
<el-pagination
@size-change="handleSizeChange_stu"
@current-change="handleCurrentChange_stu"
:current-page.sync="page_stu"
:page-sizes="[8, 20, 50, 100]"
:page-size="limit_stu"
background
small
:pager-count="5"
:hide-on-single-page="true"
layout="prev, pager, next"
:total="total_stu">
</el-pagination>
</div>
</el-row>
</el-col>
<el-col :span="18">
<el-row style="margin-bottom: 10px;">
<label>章节筛选:</label>
<el-select v-model="teacherOpenCourseQuestionSettingId" placeholder="请选择章节">
<template v-for="(item ,index) in zjList">
<el-option :label="item.teacherOpenCourseQuestionSettingName" :value="item.teacherOpenCourseQuestionSettingId"></el-option>
</template>
</el-select>
<el-button type="primary" icon="el-icon-search" @click="()=>{seeStudentId=null;getInfo(1,page = 1);}">搜索</el-button>
<el-button type="primary" icon="el-icon-refresh" @click="refresh">清空</el-button>
<el-button type="success" icon="el-icon-printer" @click="exportInfo">导出</el-button>
</el-row>
<el-row class="mb10">
<label>章节练习汇总:</label>
合计章节练习题目数量:<span style="color: #409EFF;margin-right: 20px;">{{analysisData.questionTotalCount || '0' | toDecimalx(0)}}</span>
合计平均答对数量:<span style="color: #409EFF;margin-right: 20px;">{{analysisData.avgCorrectCount || '0' | toDecimalx(0)}}</span>
合计平均答错数量:<span style="color: #409EFF;margin-right: 20px;">{{analysisData.avgWrongCount || '0' | toDecimalx(0)}}</span>
合计正确率:<span style="color: #409EFF;margin-right: 20px;">{{(analysisData.avgQuestionLogSummarySuccessRate) || '0' | toDecimalx(2)}} %</span>
合计平均得分:<span style="color: #409EFF;">{{analysisData.avgStudentScore || '0' | toDecimalx(1)}}</span>
</el-row>
<el-row>
<el-table
:data="tableData"
border
style="width: 100%">
<el-table-column type="index" header-align="center" align="center" width="80" label="序号"></el-table-column>
<el-table-column prop="studentName" header-align="center" align="center" label="姓名"> </el-table-column>
<el-table-column prop="studentSn" header-align="center" align="center" label="学号" width="100"> </el-table-column>
<el-table-column prop="className" header-align="center" align="center" label="班级" width="180"> </el-table-column>
<el-table-column prop="questionLogSummaryQuestionTotalCount" header-align="center" align="center" label="章节练习题目数量"> </el-table-column>
<el-table-column prop="questionLogSummaryStudentDoCount" header-align="center" align="center" label="已完成题目数量"> </el-table-column>
<el-table-column prop="questionLogSummarySuccessCount" header-align="center" align="center" label="答对数量" width="100"> </el-table-column>
<el-table-column prop="questionLogSummaryErrorCount" header-align="center" align="center" label="答错数量" width="100"> </el-table-column>
<el-table-column prop="questionLogSummarySuccessRate" header-align="center" align="center" label="正确率" width="100">
<template slot-scope="scope">
{{scope.row.questionLogSummarySuccessRate || 0}} %
</template>
</el-table-column>
<el-table-column prop="questionLogSummaryStudentTotalScore" header-align="center" align="center" label="得分" width="100"> </el-table-column>
<el-table-column prop="" header-align="center" align="center" label="完成进度" width="100">
<template v-slot="scope">
{{scope.row.finishProgress}}%
</template>
</el-table-column>
</el-table>
<div class="block" style="text-align: right;bottom: 0;width: 96%;margin: 20px;">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
background
:hide-on-single-page="false"
layout="sizes, prev, pager, next,jumper"
:total="total">
</el-pagination>
</div>
</el-row>
</el-col>
</el-row>
</el-row>
</div>
</template>
<script>
import TitleInfo from "@/components/TitleInfo"; //页面头部
import {getClassInfo, getQuestionAnalysisData, getQuestionSettingSelectList} from "@/common/getInfo"; //加载数据
export default {
name: "ErrorSet",
components: {
TitleInfo,
},
data() {
return {
zjie:require("../../images/course/zjie@2x.png"),
search:{
bj:"",
input:"",
studentOrName:"",
schoolClassId:""
},
tableData:[],
total: 0,
limit:10,
page:1,
total_stu: 0,
limit_stu:10,
page_stu:1,
classList:[],
studentList:[],
zjList:[],
seeStudentId:"",
teacherOpenCourseId:this.$route.query.courseId,
teacherOpenCourseQuestionSettingId:this.$route.query.id,
teacherOpenCourseMergeCourseInfoId:"",
analysisData: {}
};
},
created() {
getClassInfo({teacherOpenCourseId:this.teacherOpenCourseId}).then(ret =>{ //根据课程ID获取班级信息
if(ret.code == 0){
this.classList = ret.data;
if(ret.data.length >0){
// this.search.schoolClassId = ret.data[0].schoolClassId;
this.getStudentList();
}
}
});
getQuestionSettingSelectList({teacherOpenCourseId:this.teacherOpenCourseId, teacherOpenCourseQuestionSettingType: 'CHAPTER_EXERCISE'}).then(ret =>{ //根据课程ID获取班级信息
if(ret.code == 0){
this.zjList = ret.data;
}
});
getQuestionAnalysisData({
teacherOpenCourseId:this.teacherOpenCourseId,
questionSettingType: 'CHAPTER_EXERCISE',
questionSettingId: this.teacherOpenCourseQuestionSettingId
}).then(ret =>{ // 获取当前试卷的分析数据
if(ret.code == 0){
this.analysisData = ret.data || {};
}
});
this.getInfo();
},
mounted() {
},
methods: {
handleSizeChange(val) {
console.log(`每页 ${val}`);
this.limit = val;
this.getInfo();
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
this.page = val;
this.getInfo();
},
handleSizeChange_stu(val) {
console.log(`每页 ${val}`);
this.limit_stu = val;
this.getStudentList();
},
handleCurrentChange_stu(val) {
console.log(`当前页: ${val}`);
this.page_stu = val;
this.getStudentList();
},
refresh(){
this.page = 1;
this.seeStudentId = "";
this.teacherOpenCourseMergeCourseInfoId = "";
this.getInfo();
},
getInfo(tag){ //获取列表
if(tag == 1){
this.getStudentList();
}
let param = {
limit:this.limit,
page:this.page,
studentId:this.seeStudentId,
personId:this.seeStudentId,
questionSettingType:"CHAPTER_EXERCISE",
// teacherOpenCourseMergeCourseInfoId:this.teacherOpenCourseMergeCourseInfoId,
questionSettingId:this.teacherOpenCourseQuestionSettingId
}
this.$post("/api/questionLogSummary/getPageList.do?questionSettingType=CHAPTER_EXERCISE",param).then((ret) =>{
if(ret.code == 0){
this.total = Number(ret.count);
this.tableData = ret.data;
}else{
this.$message({message: ret.msg,type: 'error'});
}
});
},
exportInfo(){ //导出信息
this.$confirm('是否确定导出信息?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let param = 'questionSettingType=CHAPTER_EXERCISE&questionSettingId=' +
this.teacherOpenCourseQuestionSettingId + '&personId=' + (this.seeStudentId == null ? '' : this.seeStudentId) + '&studentId=' + (this.seeStudentId == null ? '' : this.seeStudentId)
this.$downLoadFile('/api/questionLogSummary/export.do?'+param, `章节练习汇总-导出 ${new Date().toLocaleString()}.xlsx`);
// this.$downLoadFile('/api/questionLogSummary/export.do?questionSettingType=CHAPTER_EXERCISE&questionSettingId='+this.teacherOpenCourseQuestionSettingId, `章节练习汇总-导出 ${new Date().toLocaleString()}.xlsx`);
//this.$message({type: 'success',message: '导出成功!'});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
},
getStudentList(){ //获取学生列表
let param = {
schoolClassIdPlural:this.search.schoolClassId,
studentSnOrName:this.search.studentOrName,
limit:this.limit_stu,
page:this.page_stu,
teacherOpenCourseId:this.teacherOpenCourseId,
teacherOpenCourseQuestionSettingId:this.teacherOpenCourseQuestionSettingId,
teacherOpenCourseQuestionLogStatus:2
}
this.$post("/api/teacherOpenCourseQuestionLog/studentScoreList.do",param).then((ret) =>{
if(ret.code == 0){
this.total_stu = Number(ret.count);
this.studentList = ret.data;
}else{
this.$message({message: ret.msg,type: 'error'});
}
});
},
tableRowClick(ow, column, cell, event){
this.seeStudentId = ow.studentId;
this.getInfo();
}
}
};
</script>
<style lang="less">
.el-ErrorSet{
padding: 20px 20px 0;
.content_block{
background-color: #ffffff;
}
}
</style>
<!-- Add "scoped" attribute to limit CSS to this component only -->