lrf402788946 hace 4 años
padre
commit
985353b3ea
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      src/views/stuscore/scoreList.vue

+ 2 - 2
src/views/stuscore/scoreList.vue

@@ -55,13 +55,13 @@ export default {
       let res = await this.query({ lessonid: this.lessonid, teacherid: this.teacherid, ...info });
       let res = await this.query({ lessonid: this.lessonid, teacherid: this.teacherid, ...info });
       if (res.errcode === 0) {
       if (res.errcode === 0) {
         let nd = _.uniqBy(res.data, 'stuid');
         let nd = _.uniqBy(res.data, 'stuid');
-        nd = nd.filter(f => this.stuList.find(sf => sf._id === f.stuid));
+        nd = nd.filter(f => this.stuList.find(sf => sf._id === f.stuid) && f.score);
         this.$set(this, `list`, nd);
         this.$set(this, `list`, nd);
         this.$set(this, `total`, res.total);
         this.$set(this, `total`, res.total);
         // 教师总分
         // 教师总分
         let teatotal = nd.reduce((p, n) => p + (n['score'] * 1 || 0), 0);
         let teatotal = nd.reduce((p, n) => p + (n['score'] * 1 || 0), 0);
         // 教师平均分
         // 教师平均分
-        let teapinjuntotal = _.round(teatotal / this.stutotal, 2);
+        let teapinjuntotal = _.round(teatotal / nd.length, 2);
         let data = {
         let data = {
           teatotal: teatotal,
           teatotal: teatotal,
           teapinjuntotal: teapinjuntotal,
           teapinjuntotal: teapinjuntotal,