Parcourir la source

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

JAELYS il y a 4 ans
Parent
commit
c68d242e0f

+ 2 - 2
TEAMModelOS/ClientApp/src/css/common-style.less

@@ -23,12 +23,12 @@
 .custom-scroll-bar {
 .custom-scroll-bar {
     div::-webkit-scrollbar { /*滚动条整体样式*/
     div::-webkit-scrollbar { /*滚动条整体样式*/
         width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
         width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
-        height: 10px;
+        height: 7px;
     }
     }
 
 
     div::-webkit-scrollbar-thumb { /*滚动条里面小方块*/
     div::-webkit-scrollbar-thumb { /*滚动条里面小方块*/
         -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
         -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
-        background: rgb(124,124,124);
+        background: #606060;
     }
     }
 
 
     div::-webkit-scrollbar-track { /*滚动条里面轨道*/
     div::-webkit-scrollbar-track { /*滚动条里面轨道*/

+ 34 - 14
TEAMModelOS/ClientApp/src/view/joinclass/JoinClass.vue

@@ -1,27 +1,48 @@
 <template>
 <template>
-    <div style="text-align:center;">
-        <h1 style="text-align:center;margin-top:100px;font-size:22px;">学生扫码加入名单需要学生端APP对接,学生端APP扫码可以直接读取学生账号信息加入到班级。</h1>
-        <!-- <p>{{tId}}</p> -->
-        <p>教师姓名:{{tName}}</p>
-        <p>教室编码:{{cId}}</p>
-        <p>教室名称:{{cName}}</p>
+    <div>
+        <h1 @click="markStuAnswer">按钮</h1>
+        <div style="text-align:center;" id="test-hahah">
+            <h1 style="text-align:center;margin-top:100px;font-size:22px;">学生扫码加入名单需要学生端APP对接,学生端APP扫码可以直接读取学生账号信息加入到班级。</h1>
+            <!-- <p>{{tId}}</p> -->
+            <p>教师姓名:{{tName}}</p>
+            <p>教室编码:{{cId}}</p>
+            <p>教室名称:{{cName}}</p>
 
 
+        </div>
+        <Modal v-model="markStatus" fullscreen title="批注">
+            <BaseMyCanvas v-if="markStatus" :bgImg="markBg"></BaseMyCanvas>
+        </Modal>
     </div>
     </div>
 </template>
 </template>
 <script>
 <script>
+import html2canvas from 'html2canvas';
 export default {
 export default {
     data() {
     data() {
         return {
         return {
-            tId:'',
-            tName:'',
-            cId:'',
-            cName:''
+            tId: '',
+            tName: '',
+            cId: '',
+            cName: '',
+            markBg:'',
+            markStatus:false
         }
         }
     },
     },
     methods: {
     methods: {
-
+        // 批注学生作答数据
+        markStuAnswer() {
+            let answer = document.getElementById('test-hahah')
+            console.log(answer)
+            html2canvas(answer).then((canvas) => {
+                // canvas.style.width = "100%"
+                // canvas.style.height = "auto"
+                console.log('111111111')
+                this.markBg = canvas.toDataURL()
+                console.log(this.markBg)
+                this.markStatus = true
+            });
+        },
     },
     },
-    created(){
+    created() {
         this.tId = this.$route.query.tId
         this.tId = this.$route.query.tId
         this.tName = this.$route.query.tName
         this.tName = this.$route.query.tName
         this.cId = this.$route.query.cId
         this.cId = this.$route.query.cId
@@ -30,8 +51,7 @@ export default {
 }
 }
 </script>
 </script>
 <style scoped>
 <style scoped>
-div p{
+div p {
     margin: 10px;
     margin: 10px;
-
 }
 }
 </style>
 </style>

+ 6 - 2
TEAMModelOS/ClientApp/src/view/learnactivity/CreatePrivEva.vue

@@ -174,11 +174,15 @@ export default {
             evaType: [
             evaType: [
                 {
                 {
                     value: '0',
                     value: '0',
-                    label: '线上'
+                    label: '线上评量'
                 },
                 },
                 {
                 {
                     value: '1',
                     value: '1',
-                    label: '线下'
+                    label: '课中评量'
+                },
+                {
+                    value: '2',
+                    label: '阅卷评量'
                 }
                 }
             ],
             ],
             publishList: [
             publishList: [

+ 6 - 2
TEAMModelOS/ClientApp/src/view/learnactivity/CreateSchoolEva.vue

@@ -252,11 +252,15 @@ export default {
             evaType: [
             evaType: [
                 {
                 {
                     value: '0',
                     value: '0',
-                    label: '线上'
+                    label: '线上评量'
                 },
                 },
                 {
                 {
                     value: '1',
                     value: '1',
-                    label: '线下'
+                    label: '课中评量'
+                },
+                {
+                    value: '2',
+                    label: '阅卷评量'
                 }
                 }
             ],
             ],
             publishList: [
             publishList: [

+ 1 - 0
TEAMModelOS/ClientApp/src/view/learnactivity/MgtSchoolEva.vue

@@ -223,6 +223,7 @@ export default {
                 onOk: () => {
                 onOk: () => {
                     let params = {
                     let params = {
                         id: this.evaListShow[this.curEvaIndex].id,
                         id: this.evaListShow[this.curEvaIndex].id,
+                        scope: this.evaListShow[this.curEvaIndex].scope,
                         code: this.evaListShow[this.curEvaIndex].code.replace('Exam-', '')
                         code: this.evaListShow[this.curEvaIndex].code.replace('Exam-', '')
                     }
                     }
                     this.isLoading = true
                     this.isLoading = true

+ 43 - 59
TEAMModelOS/ClientApp/src/view/learnactivity/PaperScore.vue

@@ -1,13 +1,12 @@
 <template>
 <template>
     <div class="paper-score-container">
     <div class="paper-score-container">
         <!-- 题目列表部分 -->
         <!-- 题目列表部分 -->
-        <Loading :top="200" type="1" style="text-align:center" v-if="dataLoading"></Loading>
+        <Loading :top="200" type="1" style="text-align:center" v-show="dataLoading"></Loading>
         <div class="scoring-paper-header">
         <div class="scoring-paper-header">
             <div>
             <div>
                 <span class="base-info-item">
                 <span class="base-info-item">
                     学生姓名:
                     学生姓名:
                     <span class="analysis-info">{{studentAnswer.name}}</span>
                     <span class="analysis-info">{{studentAnswer.name}}</span>
-                    <!-- <span class="stu-status-tag">未作答</span> -->
                 </span>
                 </span>
                 <span class="base-info-item">总分:<span class="analysis-info">{{scoreTotal}}分</span></span>
                 <span class="base-info-item">总分:<span class="analysis-info">{{scoreTotal}}分</span></span>
 
 
@@ -19,10 +18,6 @@
                     <Icon :type="showAnswer ? 'md-eye-off':'md-eye'" />
                     <Icon :type="showAnswer ? 'md-eye-off':'md-eye'" />
                     {{ showAnswer ? '隐藏答案' : '显示答案'}}
                     {{ showAnswer ? '隐藏答案' : '显示答案'}}
                 </span>
                 </span>
-                <!-- <span class="base-info-btn" @click="showOption = !showOption">
-                <Icon :type="showOption ? 'md-eye-off':'md-eye'" />
-                {{ showOption ? '隐藏选项' : '显示选项'}}
-            </span> -->
                 <span class="base-info-btn" @click="showQu = !showQu">
                 <span class="base-info-btn" @click="showQu = !showQu">
                     <Icon :type="showQu ? 'md-eye-off':'md-eye'" />
                     <Icon :type="showQu ? 'md-eye-off':'md-eye'" />
                     {{ showQu ? '隐藏题干' : '显示题干'}}
                     {{ showQu ? '隐藏题干' : '显示题干'}}
@@ -46,7 +41,7 @@
                 </div>
                 </div>
             </div>
             </div>
         </div>
         </div>
-        <div class="qu-list-wrap scoring-exercise-wrap" ref="mathJaxContainer" v-if="!dataLoading">
+        <div class="qu-list-wrap scoring-exercise-wrap" ref="mathJaxContainer" v-show="!dataLoading">
             <vuescroll ref="question-scrool" v-show="!isComplete">
             <vuescroll ref="question-scrool" v-show="!isComplete">
                 <div class="list-view" :key="'group'+ typeIndex" v-for="(typeItem,typeIndex) in groupList">
                 <div class="list-view" :key="'group'+ typeIndex" v-for="(typeItem,typeIndex) in groupList">
                     <p class="type-name">
                     <p class="type-name">
@@ -104,34 +99,26 @@
                                     <p class="answer-title">
                                     <p class="answer-title">
                                         <span v-show="!showQu" class="item-question-order">题号 {{ getQuIndex(typeIndex,index)}} .</span>
                                         <span v-show="!showQu" class="item-question-order">题号 {{ getQuIndex(typeIndex,index)}} .</span>
                                         【学 生 作 答】
                                         【学 生 作 答】
-                                        <Icon type="md-checkmark" v-if="studentAnswer.scores[getScoreIndex(typeIndex,index)] == item.score" />
-                                        <Icon type="md-close" color="#ed4014" v-else-if="studentAnswer.scores[getScoreIndex(typeIndex,index)] == 0" />
-                                        <Icon custom="iconfont icon-half-right" color="#ff9900" v-else-if="studentAnswer.scores[getScoreIndex(typeIndex,index)] != -1" />
+                                        <Icon type="md-checkmark" v-show="studentAnswer.scores[getScoreIndex(typeIndex,index)] == item.score" />
+                                        <Icon type="md-close" color="#ed4014" v-show="studentAnswer.scores[getScoreIndex(typeIndex,index)] == 0" />
+                                        <Icon custom="iconfont icon-half-right" color="#ff9900" v-show="studentAnswer.scores[getScoreIndex(typeIndex,index)] > 0 && studentAnswer.scores[getScoreIndex(typeIndex,index)] < item.score" />
                                     </p>
                                     </p>
                                     <!--学生作答答案显示区域-->
                                     <!--学生作答答案显示区域-->
                                     <div class="stu-answer-box item-explain-details" v-if="studentAnswer.answers && studentAnswer.answers.length">
                                     <div class="stu-answer-box item-explain-details" v-if="studentAnswer.answers && studentAnswer.answers.length">
                                         <!-- 批注 -->
                                         <!-- 批注 -->
-                                        <div class="mark-btn-box" @click="markStuAnswer((typeIndex + index))">
+                                        <div class="mark-btn-box" @click="markStuAnswer(getScoreIndex(typeIndex,index))">
                                             <Icon type="md-create" />
                                             <Icon type="md-create" />
                                             <span style="margin-left:5px;">批注</span>
                                             <span style="margin-left:5px;">批注</span>
                                         </div>
                                         </div>
-                                        <!--填空题答案-->
-                                        <!-- <div v-if="item.type === 'complete'" :id="'answer'+  getScoreIndex(typeIndex,index)">
-                                            <div v-for="(answerItem,answerIndex) in studentAnswer.answers[getScoreIndex(typeIndex,index)]" :key="'an'+ (answerIndex+index)">
-                                                <div class="item-answer-items">
-                                                    {{answerIndex+1}}、<span v-html="answerItem" style="display:inline-block;text-decoration: underline;"></span>
-                                                </div>
-                                            </div>
-                                        </div> -->
                                         <!--多选题答案-->
                                         <!--多选题答案-->
-                                        <div v-if="item.type === 'multiple'" :id="'answer'+ (typeIndex + index)">
+                                        <div v-if="item.type === 'multiple'" :id="'answer'+ getScoreIndex(typeIndex,index)">
                                             <span v-for="(answerItem,answerIndex) in studentAnswer.answers[getScoreIndex(typeIndex,index)]" :key="'an'+ (answerIndex+index)" v-html="answerItem" style="display:inline;">
                                             <span v-for="(answerItem,answerIndex) in studentAnswer.answers[getScoreIndex(typeIndex,index)]" :key="'an'+ (answerIndex+index)" v-html="answerItem" style="display:inline;">
                                             </span>
                                             </span>
                                         </div>
                                         </div>
                                         <!--其余题型答案-->
                                         <!--其余题型答案-->
-                                        <div v-else-if="studentAnswer.answers[getScoreIndex(typeIndex,index)]" :id="'answer'+ (typeIndex + index)">
+                                        <div v-else-if="studentAnswer.answers[getScoreIndex(typeIndex,index)]" :id="'answer'+ getScoreIndex(typeIndex,index)">
                                             <div>
                                             <div>
-                                                <span v-html="studentAnswer.answers[getScoreIndex(typeIndex,index)][0]"></span><br />
+                                                <span v-html="studentAnswer.answers[getScoreIndex(typeIndex,index)][0]"></span>
                                             </div>
                                             </div>
                                         </div>
                                         </div>
                                     </div>
                                     </div>
@@ -189,14 +176,14 @@
                                 <div class="item-question-text" v-html="item.question"></div>
                                 <div class="item-question-text" v-html="item.question"></div>
                             </div>
                             </div>
                             <div class="child-item" v-for="(childItem,childIndex) in item.children" :key="childIndex" :id="'qustion'+getScoreIndex(typeIndex,index,childIndex)">
                             <div class="child-item" v-for="(childItem,childIndex) in item.children" :key="childIndex" :id="'qustion'+getScoreIndex(typeIndex,index,childIndex)">
-                                <div class="scoring-input-box" @click.stop v-if="item.type == 'compose' && studentAnswer.scores && studentAnswer.scores.length">
+                                <div class="scoring-input-box" @click.stop v-if="studentAnswer.scores && studentAnswer.scores.length">
                                     <InputNumber v-model="studentAnswer.scores[getScoreIndex(typeIndex,index,childIndex)]" size="small" :formatter="value => value < 0 ? '' : `${value}分`" :parser="value => value.replace('分', '')" :min="0" :max="childItem.score" placeholder="0分" class="score-input" />
                                     <InputNumber v-model="studentAnswer.scores[getScoreIndex(typeIndex,index,childIndex)]" size="small" :formatter="value => value < 0 ? '' : `${value}分`" :parser="value => value.replace('分', '')" :min="0" :max="childItem.score" placeholder="0分" class="score-input" />
                                     <!-- 快速打分 满分 零分 -->
                                     <!-- 快速打分 满分 零分 -->
                                     <div style="display:flex;justify-content: space-evenly;margin-top:5px;">
                                     <div style="display:flex;justify-content: space-evenly;margin-top:5px;">
                                         <span class="fast-score-tag" title="满分" @click="fastSetScore((typeIndex + index + childIndex),childItem.score)">
                                         <span class="fast-score-tag" title="满分" @click="fastSetScore((typeIndex + index + childIndex),childItem.score)">
                                             <!-- 题目分数 -->{{childItem.score}}
                                             <!-- 题目分数 -->{{childItem.score}}
                                         </span>
                                         </span>
-                                        <span class="fast-score-tag" title="零分" @click="fastSetScore((typeIndex + index + childIndex),0)"  style="background:#ed4014">
+                                        <span class="fast-score-tag" title="零分" @click="fastSetScore((typeIndex + index + childIndex),0)" style="background:#ed4014">
                                             0
                                             0
                                         </span>
                                         </span>
                                     </div>
                                     </div>
@@ -235,29 +222,23 @@
                                         <p class="answer-title">
                                         <p class="answer-title">
                                             <span class="child-item-question-order" v-show="!showQu">【题号 {{getQuIndex(typeIndex,index)+'-'+ (childIndex + 1) }}】</span>
                                             <span class="child-item-question-order" v-show="!showQu">【题号 {{getQuIndex(typeIndex,index)+'-'+ (childIndex + 1) }}】</span>
                                             【学 生 作 答】
                                             【学 生 作 答】
-                                            <Icon type="md-checkmark" v-if="studentAnswer.scores[getQuIndex(typeIndex,index) + childIndex] == childItem.score" />
-                                            <Icon type="md-close" color="#ed4014" v-else-if="studentAnswer.scores[getQuIndex(typeIndex,index) + childIndex] == 0" />
-                                            <Icon custom="iconfont icon-half-right" color="#ff9900" v-else-if="studentAnswer.scores[getQuIndex(typeIndex,index) + childIndex] != -1" />
+                                            <Icon type="md-checkmark" v-show="studentAnswer.scores[getScoreIndex(typeIndex,index,childIndex)] == childItem.score" />
+                                            <Icon type="md-close" color="#ed4014" v-show="studentAnswer.scores[getScoreIndex(typeIndex,index,childIndex)] == 0" />
+                                            <Icon custom="iconfont icon-half-right" color="#ff9900" v-show="studentAnswer.scores[getScoreIndex(typeIndex,index,childIndex)] > 0 && studentAnswer.scores[getScoreIndex(typeIndex,index,childIndex)] < childItem.score" />
                                         </p>
                                         </p>
                                         <!--学生作答答案显示区域-->
                                         <!--学生作答答案显示区域-->
                                         <div class="stu-answer-box item-explain-details" v-if="studentAnswer.answers && studentAnswer.answers.length">
                                         <div class="stu-answer-box item-explain-details" v-if="studentAnswer.answers && studentAnswer.answers.length">
                                             <!-- 批注 -->
                                             <!-- 批注 -->
-                                            <div class="mark-btn-box" @click="markStuAnswer((typeIndex + index))">
+                                            <div class="mark-btn-box" @click="markStuAnswer(getScoreIndex(typeIndex,index,childIndex))">
                                                 <Icon type="md-create" />
                                                 <Icon type="md-create" />
                                                 <span style="margin-left:5px;">批注</span>
                                                 <span style="margin-left:5px;">批注</span>
                                             </div>
                                             </div>
-                                            <!--填空题答案-->
-                                            <!-- <div v-if="childItem.type === 'complete'" :id="'answer'+ (typeIndex + index)">
-                                                <div v-for="(answerItem,answerIndex) in studentAnswer.answers[getScoreIndex(typeIndex,index)]" :key="'an'+ index">
-                                                    <p style="margin-right:5px;display:inline-block;">{{answerIndex+1}}、<span v-html="answerItem" style="display:inline-block;text-decoration: underline;"></span></p>
-                                                </div>
-                                            </div> -->
                                             <!--多选题答案-->
                                             <!--多选题答案-->
-                                            <div v-if="childItem.type === 'multiple'" :id="'answer'+ (typeIndex + index)">
+                                            <div v-if="childItem.type === 'multiple'" :id="'answer'+ getScoreIndex(typeIndex,index,childIndex)">
                                                 <span v-for="(answerItem,answerIndex) in studentAnswer.answers[getScoreIndex(typeIndex,index,childIndex)]" :key="'an'+ (index+answerIndex+childIndex)" v-html="answerItem" style="display:inline-block;"></span>
                                                 <span v-for="(answerItem,answerIndex) in studentAnswer.answers[getScoreIndex(typeIndex,index,childIndex)]" :key="'an'+ (index+answerIndex+childIndex)" v-html="answerItem" style="display:inline-block;"></span>
                                             </div>
                                             </div>
                                             <!--其余题型答案-->
                                             <!--其余题型答案-->
-                                            <div v-else-if="studentAnswer.answers[typeIndex + index + childIndex]" :id="'answer'+ (typeIndex + index)">
+                                            <div v-else-if="studentAnswer.answers[typeIndex + index + childIndex]" :id="'answer'+ getScoreIndex(typeIndex,index,childIndex)">
                                                 <div>
                                                 <div>
                                                     <span v-html="studentAnswer.answers[getScoreIndex(typeIndex,index,childIndex)][0]"></span><br />
                                                     <span v-html="studentAnswer.answers[getScoreIndex(typeIndex,index,childIndex)][0]"></span><br />
                                                 </div>
                                                 </div>
@@ -313,9 +294,11 @@
                 <p class="complete-next" @click="nextStu">下一位学生>>></p>
                 <p class="complete-next" @click="nextStu">下一位学生>>></p>
             </div>
             </div>
         </div>
         </div>
-
+        <Modal v-model="markStatus" fullscreen title="批注">
+            <BaseMyCanvas v-if="markStatus" :bgImg="markBg"></BaseMyCanvas>
+        </Modal>
         <!-- <div class="complete-score-box">
         <!-- <div class="complete-score-box">
-            暂未选择学生
+            暂未选择学生BaseMyCanvas
         </div> -->
         </div> -->
     </div>
     </div>
 </template>
 </template>
@@ -351,6 +334,7 @@ export default {
     },
     },
     data() {
     data() {
         return {
         return {
+            markStatus: false,
             isComplete: false,
             isComplete: false,
             isAllOpen: true,
             isAllOpen: true,
             paperInfo: {},
             paperInfo: {},
@@ -372,7 +356,8 @@ export default {
             showAnswer: false,
             showAnswer: false,
             showQu: false,
             showQu: false,
             showOption: false,
             showOption: false,
-            scope: ''
+            scope: '',
+            markBg: undefined
         }
         }
     },
     },
     methods: {
     methods: {
@@ -444,28 +429,23 @@ export default {
         },
         },
         // 批注学生作答数据
         // 批注学生作答数据
         markStuAnswer(index) {
         markStuAnswer(index) {
-            this.$Message.warning('暂未处理批注功能!')
-            return
+            // this.$Message.warning('暂未处理批注功能!')
+            // return
             let answer = document.getElementById('answer' + index)
             let answer = document.getElementById('answer' + index)
-            html2canvas(answer).then(function (canvas) {
-                canvas.style.width = "100%"
-                canvas.style.height = "auto"
+            let tempNode = document.createElement('div');
+            tempNode.innerHTML = this.studentAnswer.answers[index];
+            console.log(answer)
+            console.log('tempNode',tempNode)
+            html2canvas(answer).then((canvas) => {
+                // canvas.style.width = "100%"
+                // canvas.style.height = "auto"
                 canvas.id = "canvas" + index
                 canvas.id = "canvas" + index
-                answer.appendChild(canvas);
-                this.beginMark()
+                console.log('111111111')
+                this.markBg = canvas.toDataURL()
+                console.log(this.markBg)
+                this.markStatus = true
             });
             });
         },
         },
-        //开始标注
-        beginMark(index) {
-            var canvas = document.getElementById("canvas" + index); //获取上下文对象,canvas很多常用方法都是基于这个对象实现的
-            var context = canvas.getContext("2d"); //目前参数只有2d
-            context.lineWidth = 5;  //线条宽度
-            context.moveTo(10, 10);  //光标移到这点
-            context.lineTo(10, 50);  //下一点坐标
-            context.lineTo(100, 50);  //下一点坐标
-            context.lineTo(150, 150);  //下一点坐标
-            context.stroke();
-        },
         //保存学生分数
         //保存学生分数
         saveScore() {
         saveScore() {
             let requestData = {
             let requestData = {
@@ -584,9 +564,13 @@ export default {
                             console.log(this.scope)
                             console.log(this.scope)
                             let sas = this.scope == 'school' ? this.$store.state.user.schoolProfile.blob_sas : this.$store.state.user.userProfile.blob_sas
                             let sas = this.scope == 'school' ? this.$store.state.user.schoolProfile.blob_sas : this.$store.state.user.userProfile.blob_sas
                             let a = await this.$tools.getFile(newValue.answers[0] + '?' + sas)
                             let a = await this.$tools.getFile(newValue.answers[0] + '?' + sas)
-                            console.log('a', JSON.parse(a))
                             if (a) {
                             if (a) {
-                                this.$set(this.studentAnswer, 'answers', JSON.parse(a))
+                                let ans = JSON.parse(a)
+                                ans.forEach((item, index) => {
+                                    if (!item.length) ans[index] = ['未作答']
+                                })
+                                console.log('a', ans)
+                                this.$set(this.studentAnswer, 'answers', ans)
                             } else {
                             } else {
                                 this.$set(this.studentAnswer, 'answers', [])
                                 this.$set(this.studentAnswer, 'answers', [])
                             }
                             }

+ 3 - 2
TEAMModelOS/ClientApp/src/view/learnactivity/Scoring.less

@@ -53,9 +53,10 @@
     // width: 100%;
     // width: 100%;
     width: ~"calc(100% - 10px)";
     width: ~"calc(100% - 10px)";
     color: #ffffff;
     color: #ffffff;
-    background: #353535;
+    // background: #353535;
+    background: rgba(53, 53, 53, 0.5);
     padding: 10px 10px 10px 5px;
     padding: 10px 10px 10px 5px;
-    border-bottom:1px solid #606060;
+    // border-bottom:1px solid #606060;
     .filter-select {
     .filter-select {
         display: inline-block;
         display: inline-block;
         width: 120px;
         width: 120px;

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

@@ -1,7 +1,7 @@
 <template>
 <template>
     <div class="ev-scoring dark-iview-table">
     <div class="ev-scoring dark-iview-table">
         <vuescroll>
         <vuescroll>
-            <SimpleAnalysis :status="examInfo.progress"></SimpleAnalysis>
+            <SimpleAnalysis :status="examInfo.progress" v-show="!showTest"></SimpleAnalysis>
             <div class="ev-target-box dark-iview-select">
             <div class="ev-target-box dark-iview-select">
                 <span class="filter-label" v-show="examInfo.scope == 'school'">学科:</span>
                 <span class="filter-label" v-show="examInfo.scope == 'school'">学科:</span>
                 <Select filterable v-model="chooseSubject" class="filter-select" size="small" @on-change="getCurPaper" v-show="examInfo.scope == 'school'">
                 <Select filterable v-model="chooseSubject" class="filter-select" size="small" @on-change="getCurPaper" v-show="examInfo.scope == 'school'">
@@ -253,7 +253,7 @@ export default {
                         console.log(fixed)
                         console.log(fixed)
                         for (let iterator of fixed) {
                         for (let iterator of fixed) {
                             console.log(iterator)
                             console.log(iterator)
-                            let max = 650 > (48 * this.studentScore.length) ? (48 * this.studentScore.length) : 650
+                            let max = 653 > (48 * this.studentScore.length) ? (48 * this.studentScore.length) : 653
                             // iterator.style.maxHeight =  (this.tableHeight - 40) + 'px'
                             // iterator.style.maxHeight =  (this.tableHeight - 40) + 'px'
                             iterator.style.maxHeight = max + 'px'
                             iterator.style.maxHeight = max + 'px'
                         }
                         }
@@ -478,7 +478,7 @@ export default {
 .scoring-main-wrap .ivu-table-fixed-body {
 .scoring-main-wrap .ivu-table-fixed-body {
     background: #353535;
     background: #353535;
     // background: #2b2b2e;
     // background: #2b2b2e;
-    max-height: 650px;
+    max-height: 653px;
 }
 }
 .scoring-main-wrap .ivu-table-tip {
 .scoring-main-wrap .ivu-table-tip {
     position: relative;
     position: relative;
@@ -496,10 +496,12 @@ export default {
 }
 }
 .scoring-main-wrap {
 .scoring-main-wrap {
     .ivu-table-header thead tr th {
     .ivu-table-header thead tr th {
-        background: #353535;
+        // background: #353535;
+        background: rgba(53, 53, 53, 0.5);
     }
     }
     .ivu-table td {
     .ivu-table td {
-        background: #353535;
+        // background: #353535;
+        background: rgba(53, 53, 53, 0.5);
     }
     }
 }
 }
 </style>
 </style>

+ 7 - 9
TEAMModelOS/ClientApp/src/view/learnactivity/SimpleAnalysis.vue

@@ -49,28 +49,28 @@
                     总人数
                     总人数
                 </span>
                 </span>
             </div>
             </div>
-            <div class="count-box">
+            <div class="count-box" style="color:#2db7f5">
                 <span class="count-subject-num">352</span>
                 <span class="count-subject-num">352</span>
                 <span class="count-subject-text">
                 <span class="count-subject-text">
                     <Icon type="md-checkmark-circle" class="count-icon" />
                     <Icon type="md-checkmark-circle" class="count-icon" />
                     已作答
                     已作答
                 </span>
                 </span>
             </div>
             </div>
-            <div class="count-box">
+            <div class="count-box" style="color:#ed4014">
                 <span class="count-subject-num">400</span>
                 <span class="count-subject-num">400</span>
                 <span class="count-subject-text">
                 <span class="count-subject-text">
                     <Icon type="md-remove-circle" class="count-icon" />
                     <Icon type="md-remove-circle" class="count-icon" />
                     未作答
                     未作答
                 </span>
                 </span>
             </div>
             </div>
-            <div class="count-box">
+            <div class="count-box" style="color:#19be6b">
                 <span class="count-subject-num">158</span>
                 <span class="count-subject-num">158</span>
                 <span class="count-subject-text">
                 <span class="count-subject-text">
                     <Icon type="md-star" class="count-icon" />
                     <Icon type="md-star" class="count-icon" />
                     已评分
                     已评分
                 </span>
                 </span>
             </div>
             </div>
-            <div class="count-box">
+            <div class="count-box"  style="color:#ff9900">
                 <span class="count-subject-num">58</span>
                 <span class="count-subject-num">58</span>
                 <span class="count-subject-text">
                 <span class="count-subject-text">
                     <Icon type="ios-star-outline" class="count-icon" />
                     <Icon type="ios-star-outline" class="count-icon" />
@@ -109,23 +109,21 @@ export default {
         width: 16%;
         width: 16%;
         height: fit-content;
         height: fit-content;
         text-align: center;
         text-align: center;
-        background: #353535;
+        background: rgba(53, 53, 53, 0.5);
         padding: 15px 0px;
         padding: 15px 0px;
+        color: white !important;
         .count-icon {
         .count-icon {
-            color: white;
             font-size: 18px;
             font-size: 18px;
             margin-right: 5px;
             margin-right: 5px;
             vertical-align: sub;
             vertical-align: sub;
         }
         }
         .count-subject-text {
         .count-subject-text {
             display: block;
             display: block;
-            color: white;
             font-size: 12px;
             font-size: 12px;
         }
         }
         .count-subject-num {
         .count-subject-num {
             display: block;
             display: block;
-            color: white;
-            font-size: 35px;
+            font-size: 30px;
             font-weight: 800;
             font-weight: 800;
         }
         }
     }
     }

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

@@ -21,7 +21,7 @@ export default {
                     formatter: '{b} : {c}人'
                     formatter: '{b} : {c}人'
                 },
                 },
                 title: {
                 title: {
-                    "text": "分数分布",
+                    "text": "分数段统计",
                     "left": "center",
                     "left": "center",
                     "top": 0,
                     "top": 0,
                     "textStyle": {
                     "textStyle": {

+ 4 - 4
TEAMModelOS/ClientApp/src/view/student-account/Index.vue

@@ -229,11 +229,11 @@ export default {
                             "</strong>个学生密碼</p>",
                             "</strong>个学生密碼</p>",
                         onOk: () => {
                         onOk: () => {
                             this.tableLoading = true;
                             this.tableLoading = true;
-                            let ids = this.selections.map((item) => {
-                                return { id: item.id, pw: item.id };
-                            });
+                            // let ids = this.selections.map((item) => {
+                            //     return { id: item.id, pw: item.id };
+                            // });
                             this.$api.stuAccount
                             this.$api.stuAccount
-                                .saveAllStudent(this.$store.state.user.schoolCode, ids)
+                                .saveAllStudent(this.$store.state.user.schoolCode, this.selections)
                                 .then(
                                 .then(
                                     (res) => {
                                     (res) => {
                                         this.selections.length = 0;
                                         this.selections.length = 0;

+ 45 - 14
TEAMModelOS/Controllers/Analysis/AchievementController.cs

@@ -1852,6 +1852,12 @@ namespace TEAMModelOS.Controllers.Analysis
                 //以班级为单位
                 //以班级为单位
                 List<double> stuTotals = new List<double>();
                 List<double> stuTotals = new List<double>();
                 List<dynamic> classes = new List<dynamic>();
                 List<dynamic> classes = new List<dynamic>();
+                HashSet<string> idName = new HashSet<string>();
+                foreach (ExamResult examResult in examResults) {
+                    foreach (string ids in examResult.studentIds) {
+                        idName.Add(ids);
+                    }
+                }
                 foreach (string s in info.targetClassIds) {
                 foreach (string s in info.targetClassIds) {
                    
                    
                     //存放每个班级学生总分
                     //存放每个班级学生总分
@@ -1864,9 +1870,18 @@ namespace TEAMModelOS.Controllers.Analysis
                         using var json = await JsonDocument.ParseAsync(sresponse.ContentStream);
                         using var json = await JsonDocument.ParseAsync(sresponse.ContentStream);
                         Class classroom = json.ToObject<Class>();
                         Class classroom = json.ToObject<Class>();
                         classes.Add(new {name=classroom.name,id=s });
                         classes.Add(new {name=classroom.name,id=s });
-                        classAnalysis.stuCount = classroom.students.Count;
+                        //初始化参考人数
+                        int count = 0;
+                        
                         foreach (StudentSimple stu in classroom.students)
                         foreach (StudentSimple stu in classroom.students)
                         {
                         {
+                            if (idName.Contains(stu.id))
+                            {
+                                count++;
+                            }
+                            else {
+                                continue;
+                            }
                             classAnalysis.studentIds.Add(stu.id);
                             classAnalysis.studentIds.Add(stu.id);
                             analysis.names.Add(stu.name);
                             analysis.names.Add(stu.name);
                             analysis.ids.Add(stu.id);
                             analysis.ids.Add(stu.id);
@@ -1885,6 +1900,7 @@ namespace TEAMModelOS.Controllers.Analysis
                             totalClass.Add(stuTotal);
                             totalClass.Add(stuTotal);
                             //total.Add(stuTotal);
                             //total.Add(stuTotal);
                         }
                         }
+                        classAnalysis.stuCount = count;
                     }
                     }
                     /* //声明单个班级单科总分
                     /* //声明单个班级单科总分
                      double subjectTotal = 0;*/
                      double subjectTotal = 0;*/
@@ -2304,10 +2320,10 @@ namespace TEAMModelOS.Controllers.Analysis
                             Qnum++;
                             Qnum++;
                         }
                         }
                     });
                     });
-                    Dictionary<string, object> detail = new Dictionary<string, object>
+                   /* Dictionary<string, object> detail = new Dictionary<string, object>
                     {
                     {
                         { "keys", key }
                         { "keys", key }
-                    };
+                    };*/
                     List<List<string>> datas = new List<List<string>>();
                     List<List<string>> datas = new List<List<string>>();
                     List<string[]> itemAnalysis = new List<string[]>();
                     List<string[]> itemAnalysis = new List<string[]>();
                     Dictionary<string, object> subject = new Dictionary<string, object>
                     Dictionary<string, object> subject = new Dictionary<string, object>
@@ -2408,18 +2424,33 @@ namespace TEAMModelOS.Controllers.Analysis
                             values[1] = "";
                             values[1] = "";
                             values[2] = topic[k].ToString();
                             values[2] = topic[k].ToString();
                             values[3] = e.paper.point[k].ToString();
                             values[3] = e.paper.point[k].ToString();
-                            values[4] = itemAnalysis[k][0];
-                            values[5] = itemAnalysis[k][1];
+                            if (itemAnalysis.Count > 0)
+                            {
+                                values[4] = itemAnalysis[k][0];
+                                values[5] = itemAnalysis[k][1];
+                                values[12] = itemAnalysis[k][2];
+                                values[13] = itemAnalysis[k][3];
+                                values[14] = itemAnalysis[k][4];
+                                values[15] = itemAnalysis[k][5];
+                                values[16] = itemAnalysis[k][6];
+                                values[17] = itemAnalysis[k][7];
+                                values[18] = itemAnalysis[k][8];
+                                values[19] = itemAnalysis[k][9];
+                            }
+                            else {
+                                values[4] = "-";
+                                values[5] = "-";
+                                values[12] = "-";
+                                values[13] = "-";
+                                values[14] = "-";
+                                values[15] = "-";
+                                values[16] = "-";
+                                values[17] = "-";
+                                values[18] = "-";
+                                values[19] = "-";
+                            }                          
                             values[7] = grasdepersent[k];
                             values[7] = grasdepersent[k];
-                            values[8] = grasdepersent[k];
-                            values[12] = itemAnalysis[k][2];
-                            values[13] = itemAnalysis[k][3];
-                            values[14] = itemAnalysis[k][4];
-                            values[15] = itemAnalysis[k][5];
-                            values[16] = itemAnalysis[k][6];
-                            values[17] = itemAnalysis[k][7];
-                            values[18] = itemAnalysis[k][8];
-                            values[19] = itemAnalysis[k][9];
+                            values[8] = grasdepersent[k];                            
                             values[20] = quality[k].ToString();
                             values[20] = quality[k].ToString();
                             values[21] = answer[k].ToString();
                             values[21] = answer[k].ToString();
                             string pointName = "";
                             string pointName = "";

+ 514 - 6
TEAMModelOS/Controllers/Analysis/AnalysisController.cs

@@ -48,11 +48,14 @@ namespace TEAMModelOS.Controllers.Analysis
             List<StudentAys> students = new List<StudentAys>();
             List<StudentAys> students = new List<StudentAys>();
             List<ClassAys> classes = new List<ClassAys>();
             List<ClassAys> classes = new List<ClassAys>();
             List<GradeAys> grades = new List<GradeAys>();
             List<GradeAys> grades = new List<GradeAys>();
+            List<Dictionary<string, dynamic>> PointAnalysis = new List<Dictionary<string, dynamic>>();
+            List<Dictionary<string, dynamic>> exerciseScatter = new List<Dictionary<string, dynamic>>();
+            ExamInfo info = null;
             try
             try
             {
             {
                 var client = _azureCosmos.GetCosmosClient();
                 var client = _azureCosmos.GetCosmosClient();
                 //获取本次评测所有科目结算结果
                 //获取本次评测所有科目结算结果
-                ExamInfo info = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<ExamInfo>(id.ToString(), new PartitionKey($"Exam-{code}"));
+                info = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<ExamInfo>(id.ToString(), new PartitionKey($"Exam-{code}"));
                 School school = await client.GetContainer("TEAMModelOS", "School").ReadItemAsync<School>(code.ToString(), new PartitionKey($"Base"));
                 School school = await client.GetContainer("TEAMModelOS", "School").ReadItemAsync<School>(code.ToString(), new PartitionKey($"Base"));
                 List<ExamResult> examResults = new List<ExamResult>();
                 List<ExamResult> examResults = new List<ExamResult>();
                 var query = $"select c.id,c.name,c.subjectId,c.studentScores,c.studentIds,c.paper,c.classes from c where c.examId =  '{id}' ";
                 var query = $"select c.id,c.name,c.subjectId,c.studentScores,c.studentIds,c.paper,c.classes from c where c.examId =  '{id}' ";
@@ -149,7 +152,7 @@ namespace TEAMModelOS.Controllers.Analysis
                     var stuCount = classRes.range[1] - classRes.range[0] + 1;
                     var stuCount = classRes.range[1] - classRes.range[0] + 1;
                     var classStudents = students.GetRange(classRes.range[0], classRes.range[1] - classRes.range[0] + 1);
                     var classStudents = students.GetRange(classRes.range[0], classRes.range[1] - classRes.range[0] + 1);
                     List<double> stuTotals = classStudents.Select(x=>x.total).ToList();
                     List<double> stuTotals = classStudents.Select(x=>x.total).ToList();
-                    stuTotals.Sort(delegate (double s1, double s2) { return s2.CompareTo(s1); });
+                    stuTotals.Sort(  (  s1,   s2) =>{ return s2.CompareTo(s1); });
                     double ipoint = stuTotals[personCount];
                     double ipoint = stuTotals[personCount];
                     //初始化进线人数
                     //初始化进线人数
                     int lineCount = 0;
                     int lineCount = 0;
@@ -167,7 +170,10 @@ namespace TEAMModelOS.Controllers.Analysis
                         studentIds.Add(x.id);
                         studentIds.Add(x.id);
                         x.classId = classId;
                         x.classId = classId;
                         x.className = classroom.name;
                         x.className = classroom.name;
-                        x.name = classroom.students.Where(s => x.id == x.id).First().name;
+                        x.gradeId = classroom.gradeId;
+                        var stu = classroom.students.Where(s => x.id == x.id).First();
+                        x.name = stu.name;
+                        x.no = stu.no;
                         //标准差
                         //标准差
                         powSum += Math.Pow(x.total - totalAverage, 2);
                         powSum += Math.Pow(x.total - totalAverage, 2);
                         //进线人数
                         //进线人数
@@ -178,13 +184,15 @@ namespace TEAMModelOS.Controllers.Analysis
                         int index = stuTotals.IndexOf(x.total);
                         int index = stuTotals.IndexOf(x.total);
                         double CPR = 100 - (100 * (index + 1) - 50) / stuCount;
                         double CPR = 100 - (100 * (index + 1) - 50) / stuCount;
                         x.cpr = CPR;
                         x.cpr = CPR;
+                        x.csort = index + 1;
                         //班级单科的pr
                         //班级单科的pr
                         x.subjects.ForEach(y=> {
                         x.subjects.ForEach(y=> {
-                            var subjectT= subjectTotal[y.id];
-                            subjectT.Sort(delegate (double s1, double s2) { return s2.CompareTo(s1); });
+                            var subjectT= classStudents.SelectMany(s=>s.subjects).Where(sub=>sub.id==y.id).Select(scr=>scr.score).ToList();
+                            subjectT.Sort( (  s1,   s2) =>{ return s2.CompareTo(s1); });
                             int index = subjectT.IndexOf(y.score);
                             int index = subjectT.IndexOf(y.score);
                             double CPR = 100 - (100 * (index + 1) - 50) / stuCount;
                             double CPR = 100 - (100 * (index + 1) - 50) / stuCount;
                             y.cpr = CPR;
                             y.cpr = CPR;
+                            y.csort = index + 1;
                             //按科目获取一个班的分数
                             //按科目获取一个班的分数
                             keyValues.Add(new KeyValuePair<string, double>(y.id, y.score));
                             keyValues.Add(new KeyValuePair<string, double>(y.id, y.score));
                         });
                         });
@@ -251,12 +259,512 @@ namespace TEAMModelOS.Controllers.Analysis
                         gradeAys.subjects.Add(subject);
                         gradeAys.subjects.Add(subject);
                     }
                     }
                     grades.Add(gradeAys);
                     grades.Add(gradeAys);
+                    //处理学生年级相关的pr值
+                    var studentAys = students.Where(x => x.gradeId.Equals(greade)).ToList();
+                    var stuGradeTotal = studentAys.Select(x => x.total).ToList();
+                    stuGradeTotal.Sort((s1, s2) => { return s2.CompareTo(s1); });
+                    var stuCount = stuGradeTotal.Count;
+                    studentAys.ForEach(x => {
+                        //年级全科的pr
+                        int index = stuGradeTotal.IndexOf(x.total);
+                        double GPR = 100 - (100 * (index + 1) - 50) / stuCount;
+                        x.gpr = GPR;
+                        x.gsort = index + 1;
+                        //年级单科的pr
+                        x.subjects.ForEach(y => {
+                            var subjectT = studentAys.SelectMany(s => s.subjects).Where(sub => sub.id == y.id).Select(scr => scr.score).ToList(); ;
+                            subjectT.Sort((s1, s2) => { return s2.CompareTo(s1); });
+                            int index = subjectT.IndexOf(y.score);
+                            double GPR = 100 - (100 * (index + 1) - 50) / stuCount;
+                            y.gpr = GPR;
+                            y.gsort = index + 1;
+                        });
+                    });
                 }
                 }
+                PointAnalysis = getPointAnalysises(examResults, info);
+                exerciseScatter = getExerciseScatteres(examResults, info);
+                
             }
             }
             catch (Exception ex) { 
             catch (Exception ex) { 
             
             
             }
             }
-            return Ok(new { students, classes, grades });
+            var sub = info.subjects.Select(x => new { id = x.id, name = x.name });
+            return Ok(new { students, classes, grades , points= PointAnalysis,paper= exerciseScatter, subjects=sub  });
+        }
+
+        
+        private static List<Dictionary<string, dynamic>> getExerciseScatteres(List<ExamResult> exams, ExamInfo exam)
+        {
+            /* ResponseBuilder builder = ResponseBuilder.custom();*/
+            List<string> classList = new List<string>();
+            List<Dictionary<string, object>> exerciseScatter = new List<Dictionary<string, object>>();
+            //Dictionary<string, object> scatterAnalysis = new Dictionary<string, object>();
+            classList = exam.targetClassIds;
+            List<string> key = new List<string>
+            {
+                "id",
+                "type",
+                "areaName",
+                "score",
+                "diff",
+                "identify",
+                "classScoreRate",
+                "gradeScoreRate",
+                "areaScoreRate",
+                "highScoreRate",
+                "lowScoreRate",
+                "knowledgePoint",
+                "R1",
+                "R2",
+                "R3",
+                "R4",
+                "R5",
+                "R6",
+                "PH",
+                "PL",
+                "X",
+                "Y",
+                "knowledge"
+            };
+            if (exams.IsNotEmpty())
+            {
+                exams.ForEach(e =>
+                {
+                    List<double> gradeAnswer = new List<double>();
+                    List<string> grasdepersent = new List<string>();
+                    for (int n = 0; n < e.paper.point.Count; n++)
+                    {
+                        gradeAnswer.Add(0);
+                    }
+                    //参考人数
+                    double Qnum = 0;
+                    e.studentIds.ForEach(i =>
+                    {
+                        if (!i.Equals("0"))
+                        {
+                            Qnum++;
+                        }
+                    });
+                    /* Dictionary<string, object> detail = new Dictionary<string, object>
+                     {
+                         { "keys", key }
+                     };*/
+                    List<List<string>> datas = new List<List<string>>();
+                    List<string[]> itemAnalysis = new List<string[]>();
+                    Dictionary<string, object> subject = new Dictionary<string, object>
+                    {
+                        { "name", e.subjectId }
+                    };
+                    Dictionary<string, object> classPersent = new Dictionary<string, object>();
+                    List<List<string>> classdatas = new List<List<string>>();
+                    try
+                    {
+                        e.classes.ForEach(c =>
+                        {
+                            //初始化每题得分情况
+                            List<int> answerCount = new List<int>();
+                            List<string> persent = new List<string>();
+                            double peopleCount = 0;
+                            for (int n = 0; n < e.paper.point.Count; n++)
+                            {
+                                answerCount.Add(0);
+                            }
+                            int qCount = 0;
+                            //int right = 0;
+                            /*                            //c.Keys遍历key值
+                                                        foreach (string keys in c.Keys)
+                                                        {
+                                                            classList.Add(keys);
+                                                        }*/
+                            //每个班级得分占比
+
+                            for (int i = c.range[0]; i <= c.range[1]; i++)
+                            {
+                                if (e.studentScores[i].Sum() > 0)
+                                {
+                                    for (int j = 0; j < e.studentScores[i].Count; j++)
+                                    {
+                                        if (e.studentScores[i][j] > 0)
+                                        {
+                                            //记录班级每题得分数
+                                            answerCount[j] = answerCount[j] + 1;
+                                            //记录年级每题得分数
+                                            gradeAnswer[j] = gradeAnswer[j] + 1;
+
+                                            //right++;
+                                        }
+                                    }
+                                }
+                                else
+                                {
+                                    qCount++;
+                                }
+
+                                peopleCount = c.range[1] - c.range[0] + 1 - qCount;
+                            }
+                            foreach (int p in answerCount)
+                            {
+                                var t = Math.Floor(Math.Round(decimal.Parse((p / peopleCount).ToString("0.000")), 2) * 100);
+                                persent.Add(t.ToString());
+
+                            }
+                            classdatas.Add(persent);
+                        });
+                        classPersent.Add("classList", classList);
+                        classPersent.Add("datas", classdatas);
+                        exerciseScatter.Add(classPersent);
+
+
+                        double[] point = StringHelper.ListTodouble(e.paper.point);
+                        double[,] result = StringHelper.ListToDouble(e.studentScores);
+                        var cdm = new ClouDASMatrix(result, point);
+                        //试题Y
+                        List<double> answer = cdm.AnswerRate;
+                        //试题X
+                        List<double> quality = cdm.QualityRate;
+                        //试题区域
+                        List<string> topic = cdm.TopicFallArea;
+                        //试题相关分析结果
+                        List<(double Diff, double Identify, double R1, double R2, double R3, double R4, double R5, double R6, double RH, double RL)> rs = cdm.RS;
+                        for (int i = 0; i < rs.Count; i++)
+                        {
+                            string[] ex = new string[] { };
+                            string ss = rs[i].ToString()[1..^1];
+                            ex = ss.Split(",");
+                            itemAnalysis.Add(ex);
+                        }
+                        foreach (int p in gradeAnswer)
+                        {
+                            var t = Math.Floor(Math.Round(decimal.Parse((p / Qnum).ToString("0.000")), 2) * 100);
+                            grasdepersent.Add(t.ToString());
+                        }
+                        for (int k = 0; k < e.paper.point.Count; k++)
+                        {
+                            List<string> values = new List<string>();
+                            key.ForEach(x =>
+                            {
+                                values.Add("-");
+                            });
+                            values[0] = (k + 1).ToString();
+                            values[1] = "";
+                            values[2] = topic[k].ToString();
+                            values[3] = e.paper.point[k].ToString();
+                            if (itemAnalysis.Count > 0)
+                            {
+                                values[4] = itemAnalysis[k][0];
+                                values[5] = itemAnalysis[k][1];
+                                values[12] = itemAnalysis[k][2];
+                                values[13] = itemAnalysis[k][3];
+                                values[14] = itemAnalysis[k][4];
+                                values[15] = itemAnalysis[k][5];
+                                values[16] = itemAnalysis[k][6];
+                                values[17] = itemAnalysis[k][7];
+                                values[18] = itemAnalysis[k][8];
+                                values[19] = itemAnalysis[k][9];
+                            }
+                            else
+                            {
+                                values[4] = "-";
+                                values[5] = "-";
+                                values[12] = "-";
+                                values[13] = "-";
+                                values[14] = "-";
+                                values[15] = "-";
+                                values[16] = "-";
+                                values[17] = "-";
+                                values[18] = "-";
+                                values[19] = "-";
+                            }
+                            values[7] = grasdepersent[k];
+                            values[8] = grasdepersent[k];
+                            values[20] = quality[k].ToString();
+                            values[21] = answer[k].ToString();
+                            string pointName = "";
+                            /*if (paper[0].item[k].points.Count == 1)
+                            {
+                                foreach (string index in paper[0].item[k].points)
+                                {
+                                    pointName = index;
+                                }
+                            }
+                            else if (paper[0].item[k].points.Count > 1)
+                            {
+                                foreach (string index in paper[0].item[k].points)
+                                {
+                                    pointName += index + ",";
+                                }
+                            }*/
+                            values[22] = pointName;
+                            datas.Add(values);
+
+
+                        }
+                        subject.Add("keys", key);
+                        subject.Add("datas", datas);
+                        exerciseScatter.Add(subject);
+
+                    }
+                    catch (Exception ex)
+                    {
+                        // throw new BizException(ex.Message);
+                    }
+
+                });
+                return exerciseScatter;
+            }
+            else return exerciseScatter;
+        }
+        private void DoEx(ExamResult e, ExamInfo exam, List<string> key) 
+        {
+            Dictionary<string, dynamic> scatterAnalysis = new Dictionary<string, dynamic>();
+            Dictionary<string, object> detail = new Dictionary<string, object>
+                    {
+                        { "keys", key }
+                    };
+            List<List<string>> datas = new List<List<string>>();
+            Dictionary<string, object> subject = new Dictionary<string, object>
+                    {
+                        { "subjectId", e.subjectId }
+                    };
+            double[] point = StringHelper.ListTodouble(e.paper.point);
+            double[,] result = StringHelper.ListToDouble(e.studentScores);
+            try
+            {
+                var cdm = new ClouDASMatrix(result, point);
+                //学生通过率
+                List<double> pass = cdm.PassingRate;
+                //学生稳定度
+                List<double> sta = cdm.StabilityRate;
+                //落点区域
+                List<string> stu = cdm.StuFallArea;
+                //需努力的题型
+                List<int[]> strive = cdm.StriveTopic;
+                //需小心的题型
+                List<int[]> careful = cdm.CarefulTopic;
+                int i = 0;
+                for (int k = e.studentIds.Count - 1; k >= 0; k--)
+                {
+                    if (e.studentIds[k].Equals("0"))
+                    {
+                        e.studentIds.Remove(e.studentIds[k]);
+                    }
+                }
+                e.studentIds.ForEach(s =>
+                {
+                    if (e.studentScores[i].Sum() != 0)
+                    {
+                        List<string> info = new List<string>
+                                {
+                                    s,
+                                    "-",
+                                    sta[i].ToString(),
+                                    pass[i].ToString(),
+                                    i + 1 + "",
+                                    e.studentScores[i].Sum().ToString()
+                                };
+                        int right = 0;
+                        int wrong = 0;
+                        foreach (int p in e.studentScores[i])
+                        {
+                            if (p > 0)
+                            {
+                                right++;
+                            }
+                            else
+                            {
+                                wrong++;
+                            }
+                        }
+                        info.Add(right + "");
+                        info.Add(wrong + "");
+                        int[] str = strive[i];
+                        string striveAll = "";
+
+                        foreach (int n in str)
+                        {
+                            striveAll += n.ToString() + ",";
+                        }
+                        int[] care = careful[i];
+                        string careAll = "";
+                        foreach (int n in care)
+                        {
+                            careAll += n.ToString() + ",";
+                        }
+                        if (string.IsNullOrEmpty(striveAll))
+                        {
+                            info.Add("无");
+                        }
+                        else
+                        {
+                            info.Add(striveAll.Substring(0, striveAll.Length - 1));
+                        }
+                        if (string.IsNullOrEmpty(careAll))
+                        {
+                            info.Add("无");
+                        }
+                        else
+                        {
+                            info.Add(careAll.Substring(0, careAll.Length - 1)); ;
+                        }
+                        info.Add(stu[i].ToString());
+                        datas.Add(info);
+
+                    }
+                    i++;
+                });
+                //AchievementService.ReName(datas, idToName, classToName, students);
+                detail.Add("datas", datas);
+                subject.Add("scatter", detail);
+                //scatterAnalysis.Add(subject);
+
+            }
+            catch (Exception ex)
+            {
+                //builder.Data(exams);
+                //ex.Message;
+                Console.WriteLine("---------------------" + ex.Message + "--------------------------");
+            }
+        }
+        //落点分析
+        private static List<Dictionary<string, dynamic>> getPointAnalysises(List<ExamResult> exams, ExamInfo exam)
+        {
+            List<Dictionary<string, dynamic>> scatterAnalysis = new List<Dictionary<string, dynamic>>();
+            List<string> key = new List<string>
+            {
+                "name",
+                "className",
+                "x",
+                "y",
+                "memberId",
+                "score",
+                "trueNum",
+                "falseNum",
+                "hardList",
+                "carefulList",
+                "scatter"
+            };
+            //key.Add("areaName");
+            if (exams.Count > 0)
+            {
+                /* //提取班级信息
+                 List<Dictionary<string, int[]>> classToName = exams[0].classes;
+                 //提取学生ID信息
+                 List<string> idToName = exams[0].ids;*/
+                exams.ForEach(e =>
+                {
+                    Dictionary<string, object> detail = new Dictionary<string, object>
+                    {
+                        { "keys", key }
+                    };
+                    List<List<string>> datas = new List<List<string>>();
+                    Dictionary<string, object> subject = new Dictionary<string, object>
+                    {
+                        { "name", e.subjectId }
+                    };
+                    double[] point = StringHelper.ListTodouble(e.paper.point);
+                    double[,] result = StringHelper.ListToDouble(e.studentScores);
+                    try
+                    {
+                        var cdm = new ClouDASMatrix(result, point);
+                        //学生通过率
+                        List<double> pass = cdm.PassingRate;
+                        //学生稳定度
+                        List<double> sta = cdm.StabilityRate;
+                        //落点区域
+                        List<string> stu = cdm.StuFallArea;
+                        //需努力的题型
+                        List<int[]> strive = cdm.StriveTopic;
+                        //需小心的题型
+                        List<int[]> careful = cdm.CarefulTopic;
+                        int i = 0;
+                        for (int k = e.studentIds.Count - 1; k >= 0; k--)
+                        {
+                            if (e.studentIds[k].Equals("0"))
+                            {
+                                e.studentIds.Remove(e.studentIds[k]);
+                            }
+                        }
+                        e.studentIds.ForEach(s =>
+                        {
+                            if (e.studentScores[i].Sum() != 0)
+                            {
+                                List<string> info = new List<string>
+                                {
+                                    s,
+                                    "-",
+                                    sta[i].ToString(),
+                                    pass[i].ToString(),
+                                    i + 1 + "",
+                                    e.studentScores[i].Sum().ToString()
+                                };
+                                int right = 0;
+                                int wrong = 0;
+                                foreach (int p in e.studentScores[i])
+                                {
+                                    if (p > 0)
+                                    {
+                                        right++;
+                                    }
+                                    else
+                                    {
+                                        wrong++;
+                                    }
+                                }
+                                info.Add(right + "");
+                                info.Add(wrong + "");
+                                int[] str = strive[i];
+                                string striveAll = "";
+
+                                foreach (int n in str)
+                                {
+                                    striveAll += n.ToString() + ",";
+                                }
+                                int[] care = careful[i];
+                                string careAll = "";
+                                foreach (int n in care)
+                                {
+                                    careAll += n.ToString() + ",";
+                                }
+                                if (string.IsNullOrEmpty(striveAll))
+                                {
+                                    info.Add("无");
+                                }
+                                else
+                                {
+                                    info.Add(striveAll.Substring(0, striveAll.Length - 1));
+                                }
+                                if (string.IsNullOrEmpty(careAll))
+                                {
+                                    info.Add("无");
+                                }
+                                else
+                                {
+                                    info.Add(careAll.Substring(0, careAll.Length - 1)); ;
+                                }
+                                info.Add(stu[i].ToString());
+                                datas.Add(info);
+
+                            }
+                            i++;
+                        });
+                        //AchievementService.ReName(datas, idToName, classToName, students);
+                        detail.Add("datas", datas);
+                        subject.Add("scatter", detail);
+                        scatterAnalysis.Add(subject);
+
+                    }
+                    catch (Exception ex)
+                    {
+                        //builder.Data(exams);
+                        //ex.Message;
+                        Console.WriteLine("---------------------" + ex.Message + "--------------------------");
+                    }
+
+                });
+                return scatterAnalysis;
+            }
+            else return scatterAnalysis;
+
         }
         }
     }
     }
 }
 }

+ 6 - 0
TEAMModelOS/Controllers/Analysis/StudentAys.cs

@@ -8,13 +8,17 @@ namespace TEAMModelOS.Controllers.Analysis
     public class StudentAys
     public class StudentAys
     {
     {
         public string id { get; set; }
         public string id { get; set; }
+        public string no { get; set; }
         public string name { get; set; }
         public string name { get; set; }
         public double total { get; set; }
         public double total { get; set; }
         public double gpr { get; set; }
         public double gpr { get; set; }
         public double cpr { get; set; }
         public double cpr { get; set; }
+        public int csort {get;set;}
+        public int  gsort{get;set;}
         public List<StudentSubject> subjects { get; set; } = new List<StudentSubject>();
         public List<StudentSubject> subjects { get; set; } = new List<StudentSubject>();
         public string classId { get; set; }
         public string classId { get; set; }
         public string className { get; set; }
         public string className { get; set; }
+        public string gradeId { get; set; }
     }
     }
     public class StudentSubject{ 
     public class StudentSubject{ 
         public string id { get; set; }
         public string id { get; set; }
@@ -22,5 +26,7 @@ namespace TEAMModelOS.Controllers.Analysis
         public double gpr { get; set; }
         public double gpr { get; set; }
         public double cpr { get; set; }
         public double cpr { get; set; }
         public double score { get; set; }
         public double score { get; set; }
+        public int csort { get; set; }
+        public int gsort { get; set; }
     }
     }
 }
 }

+ 1 - 1
TEAMModelOS/Controllers/Common/ExamController.cs

@@ -211,7 +211,7 @@ namespace TEAMModelOS.Controllers
                 //var id = jwt.Payload.Sub;
                 //var id = jwt.Payload.Sub;
                 var client = _azureCosmos.GetCosmosClient();
                 var client = _azureCosmos.GetCosmosClient();
                 List<ExamInfo> examInfo = new List<ExamInfo>();
                 List<ExamInfo> examInfo = new List<ExamInfo>();
-                var query = $"select c.id,c.name,c.code,c.period,c.startTime,c.endTime,c.stuCount,c.type,c.progress,c.examType,c.createTime, c.subjects, c.grades from c ";
+                var query = $"select c.id,c.name,c.code,c.period,c.startTime,c.endTime,c.stuCount,c.type,c.progress,c.examType,c.createTime, c.subjects, c.grades,c.papers from c ";
                 await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Exam-{code}") }))
                 await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Exam-{code}") }))
                 {
                 {
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);