Browse Source

Merge branch 'develop3.0-tmd' of http://106.12.23.251:10080/TEAMMODEL/TEAMModelOS into develop3.0-tmd

CrazyIter_Bin 4 years ago
parent
commit
16bf5da4ac
18 changed files with 866 additions and 268 deletions
  1. 11 1
      TEAMModelOS/ClientApp/src/api/newEvaluation.js
  2. 36 4
      TEAMModelOS/ClientApp/src/components/student-analysis/total/BaseBar.vue
  3. 22 9
      TEAMModelOS/ClientApp/src/components/student-analysis/total/BaseEntryBar.vue
  4. 388 0
      TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/LessonTestReportCharts/StudentScore.vue
  5. 58 36
      TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/PaperView.vue
  6. 95 48
      TEAMModelOS/ClientApp/src/utils/editorTools.js
  7. 1 1
      TEAMModelOS/ClientApp/src/utils/evTools.js
  8. 13 1
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseEditExercise.vue
  9. 16 8
      TEAMModelOS/ClientApp/src/view/evaluation/index/CreateExercises.vue
  10. 6 4
      TEAMModelOS/ClientApp/src/view/learnactivity/Scoring.less
  11. 7 5
      TEAMModelOS/ClientApp/src/view/learnactivity/Scoring.vue
  12. 30 47
      TEAMModelOS/ClientApp/src/view/learnactivity/SimpleAnalysis.vue
  13. 63 16
      TEAMModelOS/ClientApp/src/view/learnactivity/echarts/AvgCompare.vue
  14. 2 2
      TEAMModelOS/ClientApp/src/view/learnactivity/echarts/ScoreMatrix.vue
  15. 11 8
      TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/AchievementAnalysis/AchievementAnalysis.vue
  16. 29 15
      TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/AchievementAnalysis/EntryTables.vue
  17. 77 62
      TEAMModelOS/Controllers/Common/ExamController.cs
  18. 1 1
      TEAMModelOS/Controllers/School/StudentController.cs

+ 11 - 1
TEAMModelOS/ClientApp/src/api/newEvaluation.js

@@ -32,6 +32,16 @@ export default {
      */
     DeleteExamItem: function(data) {
         return post('/item/delete', data)
-    }
+    },
+	
+	/**
+     * 图片压缩
+     * @param {any} data
+     */
+    imageQuant: function(data) {
+        return post('/core/image-quant', data)
+    },
+	
+	
 
 }

+ 36 - 4
TEAMModelOS/ClientApp/src/components/student-analysis/total/BaseBar.vue

@@ -113,7 +113,8 @@
                 // 指定图表的配置项和数据
                 var option = {
                     legend: {
-                        data: data.datas.map(item => item.name).concat([this.$t('totalAnalysis.ach_text5'), this.$t('totalAnalysis.ach_text6')]),
+                        // data: data.datas.map(item => item.name).concat([this.$t('totalAnalysis.ach_text5'), this.$t('totalAnalysis.ach_text6')]),
+                        data: data.subjects.map(item => item.name).concat([this.$t('totalAnalysis.ach_text5'), this.$t('totalAnalysis.ach_text6')]),
                         textStyle: {
                             color: '#e4eadb'
                         }
@@ -245,7 +246,7 @@
                         splitArea: {
                             show: false // 是否显示,默认为false
                         },
-                        data: data.classList
+                        data: data.classes.map(i => i.name)
                     },
                     yAxis: {
                         show: true, // 是否显示
@@ -361,14 +362,44 @@
                 })
             },
 			
+			
+			// 获取每个学科下每个班级的平均分
+			getSeriesData(val){
+				let result = []
+				val.subjects.forEach((i,index) => {
+					val.classAnalyses.forEach(j => {
+						result.push(j.subjects[index].averageScore)
+					})
+				})
+				return result
+			},
+			
 			doRender(val){
-				
+				let subjectList = val.subjects
+				this.subjectSeries = []
+				// 配置 柱状图的 Series 根据科目 配置
+				subjectList.forEach((item, index) => {
+				    let seriesItem = {
+				        name: item.name,
+				        type: 'bar',
+				        stack: subjectList[0].name,
+				        legendHoverLink: true,
+				        itemStyle: {
+				            color: this.subjectColors[index],
+				            width: 10
+				        },
+						barMaxWidth:40,
+				        data: this.getSeriesData(val)
+				    }
+				    this.subjectSeries.push(seriesItem)
+				})
+				this.drawLine(val)
 			}
         },
         mounted() {
             if (this.getBaseBarData) {
-				// this.handleOptions(this.getBaseBarData.average)
 				console.log('BaseBar接收到的vuex',this.getBaseBarData)
+				this.doRender(this.getBaseBarData)
 			}
         },
         computed: {
@@ -381,6 +412,7 @@
             getBaseBarData(val) {
                 if (!val) return
 				console.log('BaseBar接收到watch的vuex',val)
+				this.doRender(val)
                 // this.handleOptions(val.average)
             }
         }

+ 22 - 9
TEAMModelOS/ClientApp/src/components/student-analysis/total/BaseEntryBar.vue

@@ -286,26 +286,39 @@
                 window.addEventListener('resize', function() {
                     myBar.resize()
                 })
-            }
+            },
+			
+			getEntryBarData(analysisJson){
+				let result = []
+				analysisJson.classes.forEach((classItem,classIndex) => {
+					let totalNum = analysisJson.classAnalyses[classIndex].stuCount
+					let	entryNum = analysisJson.classAnalyses[classIndex].lineCount
+					result.push({
+						name:classItem.name,
+						totalNum:totalNum,
+						entryNum:entryNum,
+						overAverageRate:((entryNum / totalNum) * 100).toFixed(2)
+					})
+				})
+				return result
+			}
         },
         mounted() {
-			console.log(this.getEntryBarData)
-            if (this.getEntryBarData){
-				this.drawLine(this.$tools.jsonTransform(this.getEntryBarData.entryLineBar))
+            if (this.getAnalysisJson){
+				this.drawLine(this.getEntryBarData(this.getAnalysisJson))
 			}
         },
         computed: {
             // 获取最新柱状图数据
-            getEntryBarData() {
-                return this.$store.state.totalAnalysis.achievementData
+            getAnalysisJson() {
+                return this.$store.state.totalAnalysis.analysisJson
             }
         },
         watch: {
-            getEntryBarData(val) {
-				console.log(val)
+            getAnalysisJson(val) {
                 if (val) {
 					this.$nextTick(() => {
-						this.drawLine(this.$tools.jsonTransform(val.entryLineBar))
+						this.drawLine(this.getEntryBarData(val))
 					})
 				}
             }

+ 388 - 0
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/LessonTestReportCharts/StudentScore.vue

@@ -0,0 +1,388 @@
+<template>
+    <div id="stuScore">
+        <div class="stu-analyse">
+            <div class="stu-info">
+                <ul>
+                    <li>
+                        <p><Icon type="ios-home" size="24" />本次考试名称:<span>成都市第三次月考</span></p>
+                    </li>
+                    <li>
+                        <p><Icon type="ios-paper" size="24" />考试类型:<span>正规考</span></p>
+                    </li>
+                    <li>
+                        <p><Icon type="ios-list-box" size="24" />学习稳定系数:<span>0.8</span></p>
+                    </li>
+                    <li>
+                        <p><Icon type="ios-person" size="24" />姓名:<span>SOUL</span></p>
+                    </li>
+                    <li>
+                        <p style="margin-top:5px">学号:<span>12345678</span></p>
+                    </li>
+                    <li>
+                        <p style="margin-top:5px">班级:<span>高三五班</span></p>
+                    </li>
+                </ul>
+            </div>
+            <div class="stu-score">
+                <p class="all-sub">全学科成绩</p>
+                <ul>
+                    <li style="margin-right:5%;margin-top:15px;">
+                        <h2 style="color:cornflowerblue;font-size:18px">个人总分</h2>
+                        <p style="color: cornflowerblue;font-size: 30px;font-weight: 800">483</p>
+                    </li>
+                    <li class="sub-ave">
+                        <h2>班级平均分</h2>
+                        <p>472</p>
+                    </li>
+                    <li class="sub-ave">
+                        <h2>年级平均分</h2>
+                        <p>468</p>
+                    </li>
+                    <li class="sub-ave">
+                        <h2>区级平均分</h2>
+                        <p>457</p>
+                    </li>
+                    <li class="sub-ave">
+                        <h2>班级排名</h2>
+                        <p>05<span>/56</span></p>
+                    </li>
+                    <li class="sub-ave">
+                        <h2>年级排名</h2>
+                        <p>65<span>/456</span></p>
+                    </li>
+                    <li class="sub-ave">
+                        <h2>区级排名</h2>
+                        <p>296<span>/1456</span></p>
+                    </li>
+                    <li>
+                        <span style="font-size:16px;margin-top:20px;display:block">是否进线</span>
+                        <p style="font-size:24px;font-weight:600;width:60px;text-align:center">是</p>
+                    </li>
+                </ul>
+            </div>
+            <div class="sub-title">
+                <ul>
+                    <li class="sub-item">
+                        <span>学科</span>
+                    </li>
+                    <li class="sub-item">
+                        <span>个人得分</span>
+                    </li>
+                    <li class="sub-item">
+                        <span>班级平均</span>
+                    </li>
+                    <li class="sub-item">
+                        <span>年级平均</span>
+                    </li>
+                    <li class="sub-item">
+                        <span>区级平均</span>
+                    </li>
+                    <li class="sub-item">
+                        <span>班级排名</span>
+                    </li>
+                    <li class="sub-item">
+                        <span>年级排名</span>
+                    </li>
+                    <li class="sub-item">
+                        <span>区级排名</span>
+                    </li>
+                    <li class="sub-item">
+                        <span>答对题数</span>
+                    </li>
+                    <li class="sub-item">
+                        <span>综合难度</span>
+                    </li>
+                </ul>
+                <ul v-for="(item,index) in data.examInfo">
+                    <li class="sub-item">
+                        <div class="sub-show"><span>{{item.subject}}</span></div>
+                    </li>
+                    <li class="sub-item">
+                        <p>{{item.stuScore}}<span>/{{item.score}}</span></p>
+                    </li>
+                    <li class="sub-item">
+                        <p>{{item.classAve}}</p>
+                    </li>
+                    <li class="sub-item">
+                        <p>{{item.gradeAve}}</p>
+                    </li>
+                    <li class="sub-item">
+                        <p>{{item.areaAve}}</p>
+                    </li>
+                    <li class="sub-item">
+                        <p>08<span>/56</span></p>
+                    </li>
+                    <li class="sub-item">
+                        <p>45<span>/456</span></p>
+                    </li>
+                    <li class="sub-item">
+                        <p>455<span>/1456</span></p>
+                    </li>
+                    <li class="sub-item">
+                        <div class="ans">
+                            <div class="obj-ans">
+                                <h5>客观</h5>
+                                <p>36<span>/40</span></p>
+                            </div>
+                            <div class="sub-ans">
+                                <h5>主观</h5>
+                                <p>5<span>/6</span></p>
+                            </div>
+                        </div>
+
+                    </li>
+                    <li class="sub-item">
+                        <span>一般</span>
+                    </li>
+                </ul>
+            </div>
+
+        </div>
+    </div>
+</template>
+<script>
+
+export default {
+  data(){
+    return {
+        data: {
+            "paperInfo": {
+                "personScore": 483,
+                "classScore": 472,
+                "gradeScore": 468,
+                "areaScore": 457,
+                "classNum": 56,
+                "gradeNum": 456,
+                "areaNum": 1456,
+                "classIndex": 5,
+                "gradeIndex": 65,
+                "areaIndex": 296,
+                "pr": 0.8
+            },
+            "examInfo": [
+                {
+                    "subject": "语文",
+                    "subCode":"5465456-hjghj-5464564-23123",
+                    "score": 150,
+                    "stuScore": 120,
+                    "classAve": 104,
+                    "gradeAve": 102,
+                    "areaAve": 105,
+                    "classIndex": 8,
+                    "gradeIndex": 45,
+                    "areaIndex": 465,
+                    "type": "normal"
+                },
+                {
+                    "subject": "数学",
+                    "subCode":"5465456-hjghj-5464564-23123",
+                    "score": 150,
+                    "stuScore": 116,
+                    "classAve": 110,
+                    "gradeAve": 102,
+                    "areaAve": 108,
+                    "classIndex": 10,
+                    "gradeIndex": 87,
+                    "areaIndex": 494,
+                    "type": "normal"
+                },
+                {
+                    "subject": "英语",
+                    "subCode":"5465456-hjghj-5464564-23123",
+                    "score": 150,
+                    "stuScore": 138,
+                    "classAve": 114,
+                    "gradeAve": 112,
+                    "areaAve": 115,
+                    "classIndex": 3,
+                    "gradeIndex": 35,
+                    "areaIndex": 365,
+                    "type": "normal"
+                }
+            ]
+        }
+    }
+  },
+  created() {
+  },
+ 
+  methods: {
+
+  },
+  mounted(){
+  }
+}
+</script>
+<style lang="less" scoped>
+    .stu-analyse {
+        /*height: 300px;*/
+        width: 100%;
+        border-radius: 5px;
+        background-color: #F0F0F0;
+    }
+
+        .stu-analyse .stu-info {
+            padding-top: 5px;
+        }
+
+            .stu-analyse .stu-info ul {
+                display: flex;
+                list-style: none;
+                width: 98%;
+                border-radius: 5px;
+                margin-left: 10px;
+            }
+
+            .stu-analyse .stu-info li {
+                margin-right: 6%;
+                font-weight: 600;
+                font-size: 14px;
+            }
+
+        .stu-analyse .stu-score .all-sub {
+            display: block;
+            margin-top: 10px;
+            margin-bottom: 5px;
+            font-size: 18px;
+            font-weight: 800;
+            margin-left: 5px;
+            width: 120px;
+            color: #24b880;
+            border-radius: 5px;
+            text-align: center;
+            background-color: #ffffff
+        }
+
+        .stu-analyse .stu-score ul {
+            background-color: #ffffff;
+            display: flex;
+            list-style: none;
+            margin-left: 5px;
+            width: calc(100% - 10px);
+        }
+
+        .stu-analyse .stu-score .sub-ave {
+            margin-right: 7%;
+        }
+
+            .stu-analyse .stu-score .sub-ave h2 {
+                display: block;
+                margin-top: 20px;
+                font-size: 16px;
+                font-weight: 600;
+            }
+
+            .stu-analyse .stu-score .sub-ave p {
+                display: block;
+                margin-top: 5px;
+                font-size: 24px;
+                font-weight: 600;
+            }
+
+            .stu-analyse .stu-score .sub-ave span {
+                font-size: 14px;
+                font-weight: 600;
+            }
+
+
+
+        .stu-analyse .sub-title ul {
+            /*       background-color: #ffffff;
+            opacity: 0.8;*/
+            font-size: 18px;
+            display: flex;
+            list-style: none;
+            width: calc(100% - 10px);
+            margin-left: 5px;
+        }
+
+        .stu-analyse .sub-title .sub-item {
+            margin-right: 5%;
+        }
+
+        .stu-analyse .sub-title .sub-items {
+            margin-right: 8%;
+        }
+
+        .stu-analyse .sub-title .sub-item span {
+            display: block;
+            font-size: 14px;
+            font-weight: 800;
+            /*width: 70px;*/
+        }
+
+        .stu-analyse .sub-title .sub {
+            width: 80px;
+            background-color: #ffffff;
+            padding: 5px 5px;
+        }
+
+        .stu-analyse .sub-title .sub-show {
+            /*background-color:#ffffff;*/
+            /*height:20px;*/
+            margin-top: 15px;
+            border-left: 5px solid #24b880;
+        }
+
+            .stu-analyse .sub-title .sub-show span {
+                display: block;
+                font-weight: 800;
+                font-size: 18px;
+                text-align: center;
+                margin-left: 5px;
+            }
+
+        .stu-analyse .sub-title .sub-item {
+            width: 5%;
+        }
+
+            .stu-analyse .sub-title .sub-item p {
+                margin-top: 15px;
+                display: flex;
+                font-size: 20px;
+            }
+
+            .stu-analyse .sub-title .sub-item span {
+                margin-top: 6px;
+            }
+
+            .stu-analyse .sub-title .sub-item .ans {
+                display: flex;
+                width: 95px;
+                height: 50px;
+            }
+
+                .stu-analyse .sub-title .sub-item .ans p {
+                    display: flex;
+                    margin-top: -5px;
+                    text-align: center;
+                }
+
+                .stu-analyse .sub-title .sub-item .ans .obj-ans {
+                    border-right: 2px solid #24B880;
+                    margin-right: 5px;
+                    padding-right: 5px;
+                    height: 45px;
+                }
+
+        .stu-analyse .sub-score ul {
+            font-size: 18px;
+            display: flex;
+            list-style: none;
+            width: 98%;
+            margin-left: 10px;
+            margin-top: 20px;
+        }
+
+
+        .stu-analyse .sub-score li {
+            margin-left: 20px;
+            margin-right: 50px;
+        }
+
+
+        .stu-analyse .sub-score span {
+            font-size: 14px;
+            font-weight: 600;
+        }   
+</style>

+ 58 - 36
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/PaperView.vue

@@ -4,42 +4,48 @@
         <PaperTest :papers="selectData" v-if="this.$store.getters.getisOpenLessonTestPopNow"  />
         <div>
             <EventBasicInfo :paper="paperData" />
-                <div class="title-rect-group">
-                    <div class="title-rect" />
-                    <h2 class="title-rect-name">试卷链接</h2>
-                </div>
-                <!--多學科試卷-->
-                <div v-if="paperData.length > 0 ">
-                    <div class="item-box">
-                        <div v-for="(item, index) in paperData" 
-                        :key="index"
-                        :class="['paper-item',item.paperId == chooseData.paperId ? 'paper-choose' : '']"
-                        @click="opentestWithSubject(item)"
-                             >
-                            <svg-icon icon-class="test" class="title-icon" />
-                            <span style="margin-top:5px">{{ item.subject.name }}{{$store.getters.getItemTitle.scope == 'school' ? '科试卷':''}}</span>
-                            <div :class="{ unfinished: item.stuAns.length == 0 ,finished:item.stuAns.length != 0 }">
-                                <Icon style="margin-top:-10px;margin-left:-8px;" type="ios-checkmark" size="36" />
-                            </div>
+            <div class="title-rect-group">
+                <div class="title-rect" />
+                <h2 class="title-rect-name">试卷链接</h2>
+            </div>
+            <!--多學科試卷-->
+            <div v-if="paperData.length > 0 ">
+                <div class="item-box">
+                    <div v-for="(item, index) in paperData"
+                         :key="index"
+                         :class="['paper-item',item.paperId == chooseData.paperId ? 'paper-choose' : '']"
+                         @click="opentestWithSubject(item)">
+                        <svg-icon icon-class="test" class="title-icon" />
+                        <span style="margin-top:5px">{{ item.subject.name }}{{$store.getters.getItemTitle.scope == 'school' ? '科试卷':''}}</span>
+                        <div :class="{ unfinished: item.stuAns.length == 0 ,finished:item.stuAns.length != 0 }">
+                            <Icon style="margin-top:-10px;margin-left:-8px;" type="ios-checkmark" size="36" />
                         </div>
-                    </div>         
-                </div>
-                <div class="title-rect-group">
-                    <div v-if="chooseData.subject !== undefined">
-                        <div class="title-rect" />
-                        <h2 class="title-rect-name">当前科目:{{chooseData.subject.name}}</h2>
-                        <!--<span v-show="isExamDown" @click="showTest" style="margin-left: 25px;color: #03966a;cursor:pointer">--><!--试卷详情--><!--</span>-->
-                        <LessonTestReport :paperInfo="selectData" :examInfo="chooseData" />
-                    </div>
-                    <div class="load-box">
-                        <load :active.sync="isLoad"
-                              background-color="#000">
-                            <template slot="default">
-                                <svg-icon icon-class="loader" class="loader-icon" />
-                            </template>
-                        </load>
                     </div>
                 </div>
+            </div>
+            <!--<div class="title-rect-group" >
+                <div class="title-rect" />
+                <h2 class="title-rect-name">评测分析</h2>
+            </div>
+            <div style="display:none">
+                <StudentScore></StudentScore>
+            </div>-->
+            <div class="title-rect-group">
+                <div v-if="chooseData.subject !== undefined">
+                    <div class="title-rect" />
+                    <h2 class="title-rect-name">当前科目:{{chooseData.subject.name}}</h2>
+                    <!--<span v-show="isExamDown" @click="showTest" style="margin-left: 25px;color: #03966a;cursor:pointer">--><!--试卷详情--><!--</span>-->
+                    <LessonTestReport :paperInfo="selectData" :examInfo="chooseData" />
+                </div>
+                <div class="load-box">
+                    <load :active.sync="isLoad"
+                          background-color="#000">
+                        <template slot="default">
+                            <svg-icon icon-class="loader" class="loader-icon" />
+                        </template>
+                    </load>
+                </div>
+            </div>
         </div>
     </div>
 </template>
@@ -49,6 +55,7 @@
     import "vue-loading-overlay/dist/vue-loading.css";
     import EventBasicInfo from "../../EventBasicInfo";
     import LessonTestReport from "./LessonTestReport";
+    import StudentScore from "./LessonTestReportCharts/StudentScore";
     import PaperTest from "./PaperTest";
     export default {
         name: "PaperView",
@@ -56,7 +63,8 @@
             EventBasicInfo,
             LessonTestReport,
             PaperTest,
-            Load
+            Load,
+            StudentScore
         },
         created() {
             this.getPaperData()
@@ -104,8 +112,13 @@
                         }
                         for (let i = 0; i < this.paperData.length; i++) {
                             this.paperData[i].subject = resData.subjects[i]
-                            this.paperData[i].stuAns = resData.stuAns[i]
-                            this.paperData[i].stuScore = resData.stuScore[i]
+                            if (resData.stuAns[i] == undefined) {
+                                this.paperData[i].stuAns = []
+                                this.paperData[i].stuScore = []
+                            } else {
+                                this.paperData[i].stuAns = resData.stuAns[i]
+                                this.paperData[i].stuScore = resData.stuScore[i]
+                            }
                         }
                         this.opentestWithSubject(this.paperData[0])
                     })
@@ -153,6 +166,15 @@
                     } else {
                         this.selectData = exam
                     }
+                    if (data.stuScore[0] == undefined) {
+                        let score = []
+                        for (let item of this.selectData.slides) {
+                            if (item.type !== 'compose') {
+                                score.push(-1)
+                            }
+                        }
+                        data.stuScore = score
+                    }
                     this.chooseData = data
                     this.isLoad = false
                     if (this.selectData.item.length > 0) {

+ 95 - 48
TEAMModelOS/ClientApp/src/utils/editorTools.js

@@ -360,11 +360,12 @@ export default {
 		editor.config.menus = editor.config.menus.concat(canvasDraw);
 	},
 
-	
+
 	/* 移除上传的音视频富文本src中的HOST */
 	doRemoveMideaHost(exerciseItem) {
 		console.log(exerciseItem)
-		let isSubjective = exerciseItem.type === 'complete' || exerciseItem.type === 'subjective' || exerciseItem.type === 'compose'
+		let isSubjective = exerciseItem.type === 'complete' || exerciseItem.type === 'subjective' || exerciseItem.type ===
+			'compose'
 		let richTextObj = {
 			question: exerciseItem.question,
 			answer: Array.isArray(exerciseItem.answer) && exerciseItem.answer.length ? exerciseItem.answer[0] : exerciseItem.answer,
@@ -376,20 +377,20 @@ export default {
 			// 遍历题目的所有富文本内容
 			for (let key in richTextObj) {
 				promiseArr.push(new Promise((r, j) => {
-					let videoSrcList = this.getRichTextSrc(richTextObj[key],'video')
-					let audioSrcList = this.getRichTextSrc(richTextObj[key],'audio')
+					let videoSrcList = this.getRichTextSrc(richTextObj[key], 'video')
+					let audioSrcList = this.getRichTextSrc(richTextObj[key], 'audio')
 					let srcList = videoSrcList.concat(audioSrcList)
-					if(srcList.length){
+					if (srcList.length) {
 						srcList.forEach(src => {
 							richTextObj[key] = richTextObj[key].replace(src, src.split('/')[src.split('/').length - 1]);
 						})
-						if(key === 'answer' && Array.isArray(exerciseItem.answer) && exerciseItem.answer.length){
+						if (key === 'answer' && Array.isArray(exerciseItem.answer) && exerciseItem.answer.length) {
 							exerciseItem.answer[0] = richTextObj[key]
-						}else{
+						} else {
 							exerciseItem[key] = richTextObj[key]
 						}
 						r(200)
-					}else{
+					} else {
 						r(200)
 					}
 				}))
@@ -401,7 +402,7 @@ export default {
 	},
 
 	/* 转换富文本内容中的base64数据 进行压缩处理 */
-	transBase64Src(exerciseItem) {
+	transBase64Src(exerciseItem, editorWidth) {
 		var srcReg = /<img [^>]*src=['"]([^'"]+)[^>]*>/g;
 		var heightReg = /<img [^>]*height=['"]([^'"]+)[^>]*>/g;
 		var widthReg = /<img [^>]*width=['"]([^'"]+)[^>]*>/g;
@@ -418,7 +419,7 @@ export default {
 			// 遍历题目的所有富文本内容
 			for (let key in richTextObj) {
 				if (key === 'option') {
-					if(richTextObj[key].length){
+					if (richTextObj[key].length) {
 						promiseArr.push(new Promise(async (r2, j2) => {
 							let optionsPromiseArr = []
 							/* 如果是试题选项里面的富文本 */
@@ -447,11 +448,28 @@ export default {
 													srcWidth = capture
 												});
 												let newBase64 = await this.compressImg(src, srcWidth, srcHeight)
-												console.log('压缩后', newBase64)
 												item = item.replace(src, newBase64)
 												r(item)
+											} else if (!heightReg.test(item) && widthReg.test(item)) {
+												// 取到宽度的百分比
+												let srcWidth = ''
+												item.replace(widthReg, async (match, capture) => {
+													srcWidth = parseInt(capture)
+												});
+												let img = new Image();
+												img.src = src;
+												// 如果是宽度 则需要根据编辑器的宽度来计算出 拉伸后的高度和宽度
+												img.onload = async () => {
+													let newWidth = editorWidth.optionWidth * srcWidth * 0.01
+													let newHeight = newWidth * (img.height / img.width)
+													let newBase64 = await this.compressImg(src, newWidth, newHeight)
+													item = item.replace(src, newBase64)
+													r(item)
+												}
 											} else {
-												console.log('没有需要压缩的')
+												// 如果没有拉伸或者点击百分比显示 则按照原图进行压缩 宽高不变
+												let newBase64 = await this.compressImg(src, 0, 0)
+												item = item.replace(src, newBase64)
 												r(item)
 											}
 										}
@@ -470,7 +488,7 @@ export default {
 								console.log('选项转换完', richTextObj[key])
 							})
 						}))
-					}else{
+					} else {
 						promiseArr.push(new Promise(async (r2, j2) => {
 							r2(200)
 						}))
@@ -481,10 +499,10 @@ export default {
 						let imgList = [];
 						let srcList = []
 						let item = richTextObj[key]
-						if(!item){
+						if (!item) {
 							r('')
 							return
-						}else if(Array.isArray(item) && !item.length){
+						} else if (Array.isArray(item) && !item.length) {
 							r([])
 							return
 						}
@@ -511,8 +529,27 @@ export default {
 									console.log('压缩后', newBase64)
 									item = item.replace(src, newBase64)
 									r(item)
+								} else if (!heightReg.test(item) && widthReg.test(item)) {
+									// 取到宽度的百分比
+									let srcWidth = ''
+									item.replace(widthReg, async (match, capture) => {
+										srcWidth = parseInt(capture)
+									});
+									let img = new Image();
+									img.src = src;
+									// 如果是宽度 则需要根据编辑器的宽度来计算出 拉伸后的高度和宽度
+									img.onload = async () => {
+										let newWidth = editorWidth.optionWidth * srcWidth * 0.01
+										let newHeight = newWidth * (img.height / img.width)
+										let newBase64 = await this.compressImg(src, newWidth, newHeight)
+										item = item.replace(src, newBase64)
+										r(item)
+									}
 								} else {
-									console.log('没有需要压缩的')
+									// 如果没有拉伸或者点击百分比显示 则按照原图进行压缩 宽高不变
+									let newBase64 = await this.compressImg(src, 0, 0)
+									console.log('压缩后', newBase64)
+									item = item.replace(src, newBase64)
 									r(item)
 								}
 							}
@@ -528,13 +565,12 @@ export default {
 				console.log('处理后的富文本集合')
 				console.log(result)
 				exerciseItem.question = result[0]
-				if(Array.isArray(exerciseItem.answer) && exerciseItem.answer.length){
+				if (Array.isArray(exerciseItem.answer) && exerciseItem.answer.length) {
 					exerciseItem.answer[0] = result[1]
-				}else{
+				} else {
 					exerciseItem.answer = result[1]
 				}
 				exerciseItem.explain = result[2]
-
 				const doRemoveItem = await this.doRemoveMideaHost(exerciseItem)
 				resolve(doRemoveItem)
 			})
@@ -550,36 +586,47 @@ export default {
 	 */
 	compressImg(imgSrc, targetWidth, targetHeight) {
 		return new Promise((resolve, reject) => {
-			try {
-				//创建一个img对象
-				var img = new Image();
-				img.src = imgSrc
-				// base64地址图片加载完毕后执行
-				img.onload = function() {
-					// 缩放图片需要的canvas(也可以在DOM中直接定义canvas标签,这样就能把压缩完的图片不转base64也能直接显示出来)
-					var canvas = document.createElement('canvas');
-					var context = canvas.getContext('2d');
-					// canvas对图片进行缩放
-					canvas.width = targetWidth;
-					canvas.height = targetHeight;
-					// 图片压缩
-					/*第一个参数是创建的img对象;第二三个参数是左上角坐标,后面两个是画布区域宽高*/
-					context.drawImage(img, 0, 0, targetWidth, targetHeight);
-					//压缩后的图片转base64 url
-					//canvas.toDataURL(mimeType, qualityArgument),mimeType 默认值是'image/png';
-					//qualityArgument表示导出的图片质量,只有导出为jpeg和webp格式的时候此参数才有效,默认值是0.92
-					var base64_url = canvas.toDataURL('image/png', 0.92); //base64 格式
-					resolve(base64_url);
-				}
-			} catch (e) {
-				console.log(e)
-			}
+			// 调用压缩接口返回
+			$api.newEvaluation.imageQuant([{
+				base64: imgSrc,
+				width: parseInt(targetWidth),
+				height: parseInt(targetHeight)
+			}]).then(res => {
+				console.log(res)
+				resolve(res[0].base64);
+			}).catch(err => {
+				reject(err)
+			})
+			// try {
+			// 	//创建一个img对象
+			// 	var img = new Image();
+			// 	img.src = imgSrc
+			// 	// base64地址图片加载完毕后执行
+			// 	img.onload = function() {
+			// 		// 缩放图片需要的canvas(也可以在DOM中直接定义canvas标签,这样就能把压缩完的图片不转base64也能直接显示出来)
+			// 		var canvas = document.createElement('canvas');
+			// 		var context = canvas.getContext('2d');
+			// 		// canvas对图片进行缩放
+			// 		canvas.width = targetWidth;
+			// 		canvas.height = targetHeight;
+			// 		// 图片压缩
+			// 		/*第一个参数是创建的img对象;第二三个参数是左上角坐标,后面两个是画布区域宽高*/
+			// 		context.drawImage(img, 0, 0, targetWidth, targetHeight);
+			// 		//压缩后的图片转base64 url
+			// 		//canvas.toDataURL(mimeType, qualityArgument),mimeType 默认值是'image/png';
+			// 		//qualityArgument表示导出的图片质量,只有导出为jpeg和webp格式的时候此参数才有效,默认值是0.92
+			// 		var base64_url = canvas.toDataURL('image/png', 0.92); //base64 格式
+			// 		resolve(base64_url);
+			// 	}
+			// } catch (e) {
+			// 	console.log(e)
+			// }
 		})
 	},
 
 	/* 获取富文本的资源src数据 */
-	getRichTextSrc(richText,type) {
-		if(!richText){
+	getRichTextSrc(richText, type) {
+		if (!richText) {
 			return []
 		}
 		var videoReg = /<video.*?(?:>|\/>)/gi;
@@ -589,9 +636,9 @@ export default {
 		var srcReg = /src=[\'\"]?([^\'\"]*)[\'\"]?/i;
 		var arr = richText.match(type === 'img' ? imgReg : type === 'video' ? videoReg : audioReg);
 		var result = []
-		if(!arr || !arr.length){
+		if (!arr || !arr.length) {
 			return []
-		}else{
+		} else {
 			for (var i = 0; i < arr.length; i++) {
 				var src = arr[i].match(srcReg);
 				//获取图片地址
@@ -601,6 +648,6 @@ export default {
 			}
 			return result
 		}
-		
+
 	}
 }

+ 1 - 1
TEAMModelOS/ClientApp/src/utils/evTools.js

@@ -406,7 +406,7 @@ export default {
 	
 	// 提取富文本内容中的文本
 	getSimpleText(html) {
-		var r = /<(?!img|video|audio).*?>/g;
+		var r = /<\/?(img)[^>]*>/gi;
 		return html.replace(r, "");
 	},
 	

+ 13 - 1
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseEditExercise.vue

@@ -344,10 +344,22 @@
 					this.$store.state.userInfo.schoolCode :
 					this.$store.state.userInfo.TEAMModelId;
 				exerciseItem.scope = this.exerciseScope === 0 ? "private" : "school";
+				
+				// 收集编辑器宽度 方便压缩富文本图片中宽度为百分比的图片
+				let editorWidth = {}
+				if(exerciseItem.type === 'single'){
+					editorWidth.questionWidth = this.$refs.single.stemEditor.$textContainerElem.elems[0].clientWidth
+					editorWidth.optionWidth = this.$refs.single.optionEditors[0].$textContainerElem.elems[0].clientWidth
+				}else if(exerciseItem.type === 'multiple'){
+					editorWidth.questionWidth = this.$refs.multiple.stemEditor.$textContainerElem.elems[0].clientWidth
+					editorWidth.optionWidth = this.$refs.multiple.optionEditors[0].$textContainerElem.elems[0].clientWidth
+				}else{
+					editorWidth.questionWidth = this.analysisEditor.$textContainerElem.elems[0].clientWidth
+				}
 
 				// 判断获取的数据是否有空数据以及是否为空字符串
 				if (this.checkContent(exerciseItem)) {
-					exerciseItem = await this.$editorTools.transBase64Src(exerciseItem)
+					exerciseItem = await this.$editorTools.transBase64Src(exerciseItem,editorWidth)
 					if (this.refId !== "paperEdit") {
 						// 生成JSON文件名称以及新增试题的ID
 						const guid = this.editInfo.id ? this.editInfo.id : this.$tools.guid();

+ 16 - 8
TEAMModelOS/ClientApp/src/view/evaluation/index/CreateExercises.vue

@@ -321,14 +321,10 @@
 					default:
 						break;
 				}
-				exerciseItem.repairResource = this.formatRepairResource(
-					this.$refs.repairRef.datas
-				);
+				exerciseItem.repairResource = this.formatRepairResource(this.$refs.repairRef.datas);
 				exerciseItem.field = this.exerciseField + 1;
 				exerciseItem.points = this.exercisePoints;
-				exerciseItem.periodId = this.isSchool ?
-					this.schoolInfo.period[this.exercisePeriod].id :
-					null;
+				exerciseItem.periodId = this.isSchool ? this.schoolInfo.period[this.exercisePeriod].id : null;
 				exerciseItem.gradeIds = this.isSchool ?
 					this.exerciseGrade.length ?
 					this.exerciseGrade :
@@ -344,10 +340,22 @@
 					this.$store.state.userInfo.TEAMModelId :
 					this.schoolInfo.id;
 				exerciseItem.scope = this.exerciseScope === 0 ? "private" : "school";
-
+				
+				// 收集编辑器宽度 方便压缩富文本图片中宽度为百分比的图片
+				let editorWidth = {}
+				if(exerciseItem.type === 'single'){
+					editorWidth.questionWidth = this.$refs.single.stemEditor.$textContainerElem.elems[0].clientWidth
+					editorWidth.optionWidth = this.$refs.single.optionEditors[0].$textContainerElem.elems[0].clientWidth
+				}else if(exerciseItem.type === 'multiple'){
+					editorWidth.questionWidth = this.$refs.multiple.stemEditor.$textContainerElem.elems[0].clientWidth
+					editorWidth.optionWidth = this.$refs.multiple.optionEditors[0].$textContainerElem.elems[0].clientWidth
+				}else{
+					editorWidth.questionWidth = this.analysisEditor.$textContainerElem.elems[0].clientWidth
+				}
+				
 				// 判断获取的数据是否有空数据以及是否为空字符串
 				if (this.checkContent(exerciseItem)) {
-					exerciseItem = await this.$editorTools.transBase64Src(exerciseItem)
+					exerciseItem = await this.$editorTools.transBase64Src(exerciseItem,editorWidth)
 					console.log('转换后的试题')
 					console.log(exerciseItem)
 					this.saveLoading = true;

+ 6 - 4
TEAMModelOS/ClientApp/src/view/learnactivity/Scoring.less

@@ -43,16 +43,18 @@
     user-select: none;
 }
 .scoring-main-wrap {
-    // width: ~"calc(100% - 10px)";
-    width: 100%;
+    width: ~"calc(100% - 10px)";
+    // width: 100%;
     height: ~"calc(100% - 45px)";
 }
 
 .ev-target-box {
     margin-top: 20px;
-    width: 100%;
+    // width: 100%;
+    width: ~"calc(100% - 10px)";
     color: #ffffff;
-    padding-bottom:10px;
+    background: #353535;
+    padding: 10px 10px 10px 5px;
     border-bottom:1px solid #606060;
     .filter-select {
         display: inline-block;

+ 7 - 5
TEAMModelOS/ClientApp/src/view/learnactivity/Scoring.vue

@@ -253,7 +253,7 @@ export default {
                         console.log(fixed)
                         for (let iterator of fixed) {
                             console.log(iterator)
-                            let max = (this.tableHeight - 50) > (48 * this.studentScore.length) ? (48 * this.studentScore.length) : (this.tableHeight - 50)
+                            let max = 650 > (48 * this.studentScore.length) ? (48 * this.studentScore.length) : 650
                             // iterator.style.maxHeight =  (this.tableHeight - 40) + 'px'
                             iterator.style.maxHeight = max + 'px'
                         }
@@ -476,7 +476,8 @@ export default {
 </style>
 <style lang="less">
 .scoring-main-wrap .ivu-table-fixed-body {
-    background: #454545;
+    background: #353535;
+    // background: #2b2b2e;
     max-height: 650px;
 }
 .scoring-main-wrap .ivu-table-tip {
@@ -488,16 +489,17 @@ export default {
     display: none;
 }
 .scoring-main-wrap .ivu-table-fixed-header thead tr th {
-    background: #454545;
+    background: #353535;
+    // background: #2b2b2e;
     border-color: #606060;
     color: white;
 }
 .scoring-main-wrap {
     .ivu-table-header thead tr th {
-        background: #404040;
+        background: #353535;
     }
     .ivu-table td {
-        background: #404040;
+        background: #353535;
     }
 }
 </style>

+ 30 - 47
TEAMModelOS/ClientApp/src/view/learnactivity/SimpleAnalysis.vue

@@ -1,6 +1,6 @@
 <template>
     <div>
-        <div class="overview-box" v-if="status == 'finish'">
+        <div class="overview-box"  v-if="status == 'finish'">
             <div class="count-box">
                 <span class="count-subject-num">752</span>
                 <span class="count-subject-text">
@@ -22,44 +22,22 @@
                     班级
                 </span>
             </div>
-            <!-- <div class="count-box">
-                <span class="count-subject-num">3</span>
-                <span class="count-subject-text">
-                    <Icon custom="iconfont icon-kecheng" class="count-icon" size="14" style="vertical-align: text-top;" />
-                    学科
-                </span>
-            </div> -->
             <div class="count-box">
-                <span class="count-subject-num">92</span>
+                <span class="count-subject-num">3</span>
                 <span class="count-subject-text">
                     <Icon custom="iconfont icon-class-self" class="count-icon" />
-                    总平均
-                </span>
-            </div>
-            <div class="count-box">
-                <span class="count-subject-num">88</span>
-                <span class="count-subject-text">
-                    <!-- <Icon type="ios-arrow-down" class="count-icon" size="14" style="vertical-align: text-top;" /> -->
-                    <Icon custom="iconfont icon-kecheng" class="count-icon" size="14" style="vertical-align: text-top;" />
-                    语文均分
-                </span>
-            </div>
-            <div class="count-box">
-                <span class="count-subject-num">90</span>
-                <span class="count-subject-text">
-                    <Icon custom="iconfont icon-kecheng" class="count-icon" size="14" style="vertical-align: text-top;" />
-                    数学均分
+                    学科
                 </span>
             </div>
             <div class="count-box">
-                <span class="count-subject-num">95</span>
+                <span class="count-subject-num">273</span>
                 <span class="count-subject-text">
-                    <Icon custom="iconfont icon-kecheng" class="count-icon" size="14" style="vertical-align: text-top;" />
-                    英语均分
+                    <Icon custom="iconfont icon-class-self" class="count-icon" />
+                    平均分
                 </span>
             </div>
         </div>
-        <div class="overview-box" style="justify-content: space-around;padding-top:40px"  v-if="status == 'finish'">
+        <div class="overview-box" style="justify-content: space-around;padding-top:40px" v-if="status == 'finish'">
             <ScoreMatrix></ScoreMatrix>
             <AvgCompare></AvgCompare>
         </div>
@@ -74,28 +52,28 @@
             <div class="count-box">
                 <span class="count-subject-num">352</span>
                 <span class="count-subject-text">
-                    <Icon type="md-checkmark-circle"  class="count-icon"/>
+                    <Icon type="md-checkmark-circle" class="count-icon" />
                     已作答
                 </span>
             </div>
             <div class="count-box">
                 <span class="count-subject-num">400</span>
                 <span class="count-subject-text">
-                    <Icon type="md-remove-circle"  class="count-icon"/>
+                    <Icon type="md-remove-circle" class="count-icon" />
                     未作答
                 </span>
             </div>
             <div class="count-box">
                 <span class="count-subject-num">158</span>
                 <span class="count-subject-text">
-                    <Icon type="md-star" class="count-icon"/>
+                    <Icon type="md-star" class="count-icon" />
                     已评分
                 </span>
             </div>
             <div class="count-box">
                 <span class="count-subject-num">58</span>
                 <span class="count-subject-text">
-                    <Icon type="ios-star-outline" class="count-icon"/>
+                    <Icon type="ios-star-outline" class="count-icon" />
                     未评分
                 </span>
             </div>
@@ -110,46 +88,51 @@ export default {
         AvgCompare,
         ScoreMatrix
     },
-    props:{
-        status:{
-            default:'',
-            type:String
+    props: {
+        status: {
+            default: '',
+            type: String
         }
     }
 }
 </script>
 <style lang="less" scoped>
-.overview-box{
+.overview-box {
     width: 100%;
     flex-wrap: wrap;
-    padding: 10px 20px 10px 10px;
+    padding: 10px 10px 0px 0px;
     display: flex;
     justify-content: space-between;
-    background: #404040;
-    .count-box{
+    // background: #404040;
+    .count-box {
         min-width: 150px;
+        width: 16%;
         height: fit-content;
         text-align: center;
-        background: #404040;
-        padding: 10px 0px;
-        .count-icon{
+        background: #353535;
+        padding: 15px 0px;
+        .count-icon {
             color: white;
             font-size: 18px;
             margin-right: 5px;
             vertical-align: sub;
         }
-        .count-subject-text{
+        .count-subject-text {
             display: block;
             color: white;
             font-size: 12px;
         }
-        .count-subject-num{
+        .count-subject-num {
             display: block;
             color: white;
             font-size: 35px;
             font-weight: 800;
         }
     }
-    
+}
+.finish-count-box {
+    .count-box {
+        margin-bottom: 10px;
+    }
 }
 </style>

+ 63 - 16
TEAMModelOS/ClientApp/src/view/learnactivity/echarts/AvgCompare.vue

@@ -32,22 +32,22 @@ export default {
                 ],
                 legend: {
                     // data: ['语文', '数学', '英语']
-                    right:5,
-                    data:[
+                    right: 5,
+                    data: [
                         {
-                            name:'语文',
-                            textStyle:{
-                                color:'#FFF'
+                            name: '语文',
+                            textStyle: {
+                                color: '#FFF'
                             }
-                        },{
-                            name:'数学',
-                            textStyle:{
-                                color:'#FFF'
+                        }, {
+                            name: '数学',
+                            textStyle: {
+                                color: '#FFF'
                             }
-                        },{
-                            name:'英语',
-                            textStyle:{
-                                color:'#FFF'
+                        }, {
+                            name: '英语',
+                            textStyle: {
+                                color: '#FFF'
                             }
                         }
                     ]
@@ -65,9 +65,9 @@ export default {
                     trigger: 'axis'
                 },
                 grid: {
-                    left: '3%',
-                    right: '4%',
-                    bottom: '3%',
+                    left: '0%',
+                    right: '40px',
+                    bottom: '0%',
                     containLabel: true
                 },
                 // toolbox: {
@@ -122,6 +122,30 @@ export default {
                         stack: '总量',
                         barMaxWidth: 30,
                         data: [85, 89, 88, 92, 99]
+                    },
+                    {
+                        name: '总分',
+                        type: 'line',
+                        itemStyle: {
+                            color: '#11C2EE',
+                            width: 2
+                        },
+                        symbol: 'none',
+                        lineStyle: {
+                            type: 'dashed',
+                            width: 0
+                        },
+                        markLine: {
+                            data: [
+                                { type: 'average' }
+                            ],
+                            lineStyle: {
+                                color: '#11C2EE',
+                                type: 'dashed',
+                                width: 2
+                            }
+                        },
+                        data: [272, 271, 273, 279, 273]
                     }
                 ]
             }
@@ -138,6 +162,29 @@ export default {
                 this.progressPie.resize()
             })
         })
+        this.progressPie.on('legendselectchanged', (params) =>{
+            console.log(params)
+            let active = this.option.series.filter(item=>{
+                if(params.selected[item.name]){
+                    return true
+                }else{
+                    return false
+                }
+            })
+            let score = []
+            active.forEach((item)=>{
+                item.data.forEach((scoreItem,index)=>{
+                    if(!score[index]) score[index] = 0
+                    score[index] += scoreItem
+                })
+            })
+            console.log('active',active)
+            console.log('score',score)
+            let len = this.option.series.length
+            this.option.series[len-1].data = score
+            this.progressPie.setOption(this.option)
+
+        });
     },
     watch: {
         pieData: {

+ 2 - 2
TEAMModelOS/ClientApp/src/view/learnactivity/echarts/ScoreMatrix.vue

@@ -47,8 +47,8 @@ export default {
                     {
                         hoverOffset: 5,
                         type: 'pie',
-                        radius: '45%',
-                        center: ['50%', '50%'],
+                        radius: '50%',
+                        center: ['45%', '50%'],
                         selectedMode: 'single',
                         label: {
                             show: true,

+ 11 - 8
TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/AchievementAnalysis/AchievementAnalysis.vue

@@ -164,11 +164,12 @@
 				let result = []
 				analysisJson.classAnalyses[0].subjects.forEach((item,index) => {
 					result.push({
-						name:item.id,
-						class:item.passPersent[0],
-						grade:analysisJson.gradeAnalyses[0].subjects[index].passPersent[0]
+						name:this.subjectList.filter(i => i.id === item.id)[0].name,
+						class:(+item.passPercent * 100) + '%',
+						grade:+analysisJson.gradeAnalyses[0].subjects[index].passPercent * 100 + '%'
 					})
 				})
+				console.log('passRate',result)
 				return result
 			}
         },
@@ -179,7 +180,7 @@
             // 如果有缓存的数据 则读取缓存数据
             if (this.getAnalysisJson) {
                 // this.earlyWarningData = this.$tools.jsonTransform(this.getAchievementData.earlyWarning)
-                // this.subjectList = this.getAchievementData.average.datas.map(item => item.name)
+                this.subjectList = this.getAnalysisJson.subjects
                 this.passRate = this.getPassRate(this.getAnalysisJson)
 				console.log('achievement页面接收的JSON',this.getAnalysisJson)
             }
@@ -209,11 +210,13 @@
         },
         watch: {
             // 渲染最新预警统计数据
-            getAchievementData(val) {
+            getAnalysisJson(val) {
                 if (!val) return
-                this.earlyWarningData = this.$tools.jsonTransform(val.earlyWarning) // 预警统计表格
-                this.passRate = val.passRate // 及格率统计
-                this.subjectList = val.average.datas.map(item => item.name) // 科目列表
+                // this.earlyWarningData = this.$tools.jsonTransform(val.earlyWarning) // 预警统计表格
+                // this.passRate = val.passRate // 及格率统计
+                // this.subjectList = val.average.datas.map(item => item.name) // 科目列表
+				this.subjectList = val.subjects
+				this.passRate = this.getPassRate(val)
             },
             // 渲染最新预警统计数据
             getSubjectList(val) {

+ 29 - 15
TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/AchievementAnalysis/EntryTables.vue

@@ -138,33 +138,47 @@
 				// 清除之前的科目columns 添加当前评测的科目columns
 				this.entryNumberColumns.splice(4,this.entryNumberColumns.length - 4,...subjectColumns)
             },
+			
+			getTableDatas(analysisJson){
+				let result = []
+				analysisJson.analysis.names.forEach((stu,stuIndex) => {
+					result.push({
+						name:stu.name,
+						className:0,
+						gradeRank:0,
+						score:0,
+					})
+				})
+			}
         },
         mounted() {
             this.$refs.rateTable.$el.childNodes[1].style.borderRight = '0'
             this.$refs.entryTable.$el.childNodes[1].style.borderRight = '0'
 
-            if (this.getEntryData) {
-                this.entryBarData = this.$tools.jsonTransform(this.getEntryData.entryLineBar) // 进线人数统计柱状图数据
-                this.renderColumns(this.getEntryData.entryTable) // 渲染科目表头
-                this.entryTableData = this.$tools.jsonTransform(this.getEntryData.entryTable) // 进线人数统计表格数据
-                let tableList = this.entryTableData
-                this.entryTableData = tableList
+            if (this.getAnalysisJson) {
+                // this.entryBarData = this.$tools.jsonTransform(this.getEntryData.entryLineBar) // 进线人数统计柱状图数据
+                // this.renderColumns(this.getEntryData.entryTable) // 渲染科目表头
+                // this.entryTableData = this.$tools.jsonTransform(this.getEntryData.entryTable) // 进线人数统计表格数据
+                // let tableList = this.entryTableData
+                // this.entryTableData = tableList
+				console.log('进线情况统计表格',this.getAnalysisJson)
             }
         },
         computed: {
-            getEntryData() {
-                return this.$store.state.totalAnalysis.achievementData
+            getAnalysisJson() {
+                return this.$store.state.totalAnalysis.analysisJson
             }
         },
         watch: {
-            getEntryData(val) {
+            getAnalysisJson(val) {
                 if (!val) return
-                let vuexData = val.entryTable // 拿到最新的 成绩分析模块 进线人数和进线情况数据
-                this.entryBarData = this.$tools.jsonTransform(val.entryLineBar) // 渲染进线人数统计柱状图表格
-                this.renderColumns(vuexData)
-                this.entryTableData = this.$tools.jsonTransform(vuexData)
-                let tableList = this.entryTableData
-                this.entryTableData = tableList
+                // let vuexData = val.entryTable // 拿到最新的 成绩分析模块 进线人数和进线情况数据
+                // this.entryBarData = this.$tools.jsonTransform(val.entryLineBar) // 渲染进线人数统计柱状图表格
+                // this.renderColumns(vuexData)
+                // this.entryTableData = this.$tools.jsonTransform(vuexData)
+                // let tableList = this.entryTableData
+                // this.entryTableData = tableList
+				console.log('进线情况统计表格Watch',val)
             }
         }
     }

+ 77 - 62
TEAMModelOS/Controllers/Common/ExamController.cs

@@ -348,13 +348,21 @@ namespace TEAMModelOS.Controllers
                     //classResult.studentAnswers[index] = ans;
                     if (index == -1)
                     {
+                        List<double> ansPoint = new List<double>();
+                        foreach (List<string> num in standard)
+                        {
+                            //ans.Add(new List<string>());
+                            ansPoint.Add(-1);
+                        }
                         result.studentIds.Add(studentId.ToString());
-                        result.studentScores.Add(new List<double>());
+                        result.studentScores.Add(ansPoint);
                         result.studentAnswers.Add(new List<string>());
+                        result.sum.Add(0);
                     }
+                    int newIndex = result.studentIds.IndexOf(studentId.ToString());
                     string FileName = result.examId + "/" + result.subjectId+"/" +studentId ;
                     string blob = await _azureStorage.UploadFileByContainer(school.ToString(), ans.ToJsonString(), "exam", FileName +"/"+ "ans.json");
-                    result.studentAnswers[index].Add(blob);
+                    result.studentAnswers[newIndex].Add(blob);
 
                     for (int i = 0; i < ans.Count; i++)
                     {                         
@@ -368,11 +376,11 @@ namespace TEAMModelOS.Controllers
                                 {
                                     if (standard[i].Contains(right))
                                     {
-                                        result.studentScores[index][i] = points[i];
+                                        result.studentScores[newIndex][i] = points[i];
                                     }
                                     else
                                     {
-                                        result.studentScores[index][i] = 0;
+                                        result.studentScores[newIndex][i] = 0;
                                     }
                                 }
 
@@ -382,87 +390,94 @@ namespace TEAMModelOS.Controllers
                                 if (rule > 0)
                                 {
                                     int falseCount = 0;
-                                    foreach (string obj in ans[i])
+                                    if (ans[i].Count > 0)
                                     {
-                                        if (!standard[i].Contains(obj))
+                                        foreach (string obj in ans[i])
                                         {
-                                            falseCount++;
-                                        }
-                                    }
-                                    switch (rule)
-                                    {
-                                        case 1:
-                                            if (ans[i].Count == standard[i].Count)
+                                            if (!standard[i].Contains(obj))
                                             {
-                                                if (falseCount == 0)
+                                                falseCount++;
+                                            }
+                                        }
+                                        switch (rule)
+                                        {
+                                            case 1:
+                                                if (ans[i].Count == standard[i].Count)
                                                 {
-                                                    result.studentScores[index][i] = points[i];
+                                                    if (falseCount == 0)
+                                                    {
+                                                        result.studentScores[newIndex][i] = points[i];
+                                                    }
+                                                    else
+                                                    {
+                                                        result.studentScores[newIndex][i] = 0;
+                                                    }
                                                 }
                                                 else
                                                 {
-                                                    result.studentScores[index][i] = 0;
+                                                    result.studentScores[newIndex][i] = 0;
                                                 }
-                                            }
-                                            else
-                                            {
-                                                result.studentScores[index][i] = 0;
-                                            }
-                                            break;
-                                        case 2:
-                                            if (falseCount > 0)
-                                            {
-                                                result.studentScores[index][i] = 0;
-                                            }
-                                            else
-                                            {
-                                                if (ans[i].Count == standard[i].Count)
+                                                break;
+                                            case 2:
+                                                if (falseCount > 0)
                                                 {
-                                                    result.studentScores[index][i] = points[i];
+                                                    result.studentScores[newIndex][i] = 0;
                                                 }
                                                 else
                                                 {
-                                                    result.studentScores[index][i] = points[i] / 2;
-                                                }
+                                                    if (ans[i].Count == standard[i].Count)
+                                                    {
+                                                        result.studentScores[newIndex][i] = points[i];
+                                                    }
+                                                    else
+                                                    {
+                                                        result.studentScores[newIndex][i] = points[i] / 2;
+                                                    }
 
-                                            }
-                                            break;
-                                        case 3:
-                                            if (falseCount > 0)
-                                            {
-                                                result.studentScores[index][i] = 0;
-                                            }
-                                            else
-                                            {
-                                                if (ans[i].Count == standard[i].Count)
+                                                }
+                                                break;
+                                            case 3:
+                                                if (falseCount > 0)
                                                 {
-                                                    result.studentScores[index][i] = points[i];
+                                                    result.studentScores[newIndex][i] = 0;
                                                 }
                                                 else
                                                 {
-                                                    result.studentScores[index][i] = System.Math.Round((double)ans[i].Count / standard[i].Count * points[i], 1);
-                                                }
+                                                    if (ans[i].Count == standard[i].Count)
+                                                    {
+                                                        result.studentScores[newIndex][i] = points[i];
+                                                    }
+                                                    else
+                                                    {
+                                                        result.studentScores[newIndex][i] = System.Math.Round((double)ans[i].Count / standard[i].Count * points[i], 1);
+                                                    }
 
-                                            }
-                                            break;
-                                        case 4:
-                                            if (ans[i].Count == standard[i].Count)
-                                            {
-                                                result.studentScores[index][i] = points[i];
-                                            }
-                                            else
-                                            {
-                                                double persent = (double)(standard[i].Count - 2 * falseCount) / standard[i].Count;
-                                                if (persent <= 0)
+                                                }
+                                                break;
+                                            case 4:
+                                                if (ans[i].Count == standard[i].Count)
                                                 {
-                                                    result.studentScores[index][i] = 0;
+                                                    result.studentScores[newIndex][i] = points[i];
                                                 }
                                                 else
                                                 {
-                                                    result.studentScores[index][i] = System.Math.Round(persent * points[i], 1);
+                                                    double persent = (double)(standard[i].Count - 2 * falseCount) / standard[i].Count;
+                                                    if (persent <= 0)
+                                                    {
+                                                        result.studentScores[newIndex][i] = 0;
+                                                    }
+                                                    else
+                                                    {
+                                                        result.studentScores[newIndex][i] = System.Math.Round(persent * points[i], 1);
+                                                    }
                                                 }
-                                            }
-                                            break;
+                                                break;
+                                        }
                                     }
+                                    else {
+                                        result.studentScores[newIndex][i] = 0;
+                                    }
+                                    
                                 }
                             }
                         }
@@ -495,7 +510,7 @@ namespace TEAMModelOS.Controllers
                         });
                         await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(exam, id.ToString(), new PartitionKey($"Exam-{school}"));
                     }
-                    result.sum[index] = result.studentScores[index].Sum();
+                    result.sum[newIndex] = result.studentScores[newIndex].Sum();
                     classResult = await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(result, result.id, new PartitionKey($"{result.code}"));
                 }
                 

+ 1 - 1
TEAMModelOS/Controllers/School/StudentController.cs

@@ -382,7 +382,7 @@ namespace TEAMModelOS.Controllers
                 writer.WriteNull("sn");
                 writer.WriteNull("style");
                 writer.WriteNull("timetable");
-                writer.WriteString("scope", "shcool");
+                writer.WriteString("scope", "school");//school单词拼写错误修正
                 writer.WriteNull("status");
                 writer.WriteEndObject();
                 writer.Flush();