Kaynağa Gözat

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

李思淳 5 yıl önce
ebeveyn
işleme
5e4fd488b4

+ 1 - 1
TEAMModelOS.Service/Models/Exam/Models/ExamInfo.cs

@@ -19,7 +19,7 @@ namespace TEAMModelOS.Service.Models.Exam.Models
         [JsonProperty(PropertyName = "id")]
         public string id { get; set; }
         [PartitionKey]
-        public string schoolCode { get; set; }
+        public string scopeCode { get; set; }
         public string name { get; set; }
         public int stuCount { get; set; }
         public int createTime { get; set; }

+ 2 - 2
TEAMModelOS.Service/Models/Exam/Models/ExamPaper.cs

@@ -26,7 +26,7 @@ namespace TEAMModelOS.Service.Models.Exam.Models
         /// </summary>
         public string examCode { get; set; }
         public List<ExamItem> item { get; set; }       
-        public string subject { get; set; }
-        public string period { get; set; }
+        public string subjectCode { get; set; }
+        public string periodCode { get; set; }
     }
 }

+ 25 - 9
TEAMModelOS/ClientApp/src/view/evaluation/index/ExercisesList.css

@@ -218,7 +218,7 @@
         }
 
         .content-wrap .exercise-item p {
-            margin: 10px 0;
+            /*margin: 10px 0;*/
             display: inline-block;
             word-break: break-all;
         }
@@ -232,16 +232,28 @@
 .exercise-item .item-question {
     /*display: inline-block;*/
     /*margin-top:20px;*/
+    position:relative;
+    cursor:pointer;
 }
 
-.exercise-item .item-difficulty {
-    display: inline-block;
-    padding: 2px 10px;
-    background: rgb(16, 171, 231);
-    border-radius: 5px;
-    color: #fff;
-    font-size:12px;
-}
+    .exercise-item .item-question .item-btn-toggle {
+        position:absolute;
+        right:0;
+    }
+
+        .exercise-item .item-question .item-btn-toggle .ivu-icon {
+            font-size:22px;
+            cursor:pointer;
+        }
+
+    .exercise-item .item-difficulty {
+        display: inline-block;
+        padding: 2px 10px;
+        background: rgb(16, 171, 231);
+        border-radius: 5px;
+        color: #fff;
+        font-size: 12px;
+    }
 .exercise-item .item-type {
     display: inline-block;
     padding: 1px 9px;
@@ -258,6 +270,10 @@
     font-size: 13px;
 }
 
+.exercise-item .item-options p{
+    margin:7px 0;
+}
+
 .exercise-item .item-answer {
     display: inline-block;
     cursor:pointer;

+ 178 - 156
TEAMModelOS/ClientApp/src/view/evaluation/index/ExercisesList.vue

@@ -1,152 +1,158 @@
 <template>
     <div class="ev-list-container">
-            <div class="ev-header">
-                <Icon type="md-bookmarks" size="30" color="rgb(16, 171, 231)" />
-                <span class="ev-title">题库列表</span>
-                <span class="ev-length">共 {{list.length}} 道题</span>
+        <div class="ev-header">
+            <Icon type="md-bookmarks" size="30" color="rgb(16, 171, 231)" />
+            <span class="ev-title">题库列表</span>
+            <span class="ev-length">共 {{list.length}} 道题</span>
+        </div>
+        <!-- 筛选部分 -->
+        <div class="filter-wrap">
+            <div class="filter-item">
+                <span class="filter-title">来源:</span>
+                <RadioGroup v-model="filterOrigin" type="button" @on-change="filterOriginChange">
+                    <Radio label="self">私有题库</Radio>
+                    <Radio label="school">学校公用库</Radio>
+                </RadioGroup>
             </div>
-            <!-- 筛选部分 -->
-            <div class="filter-wrap">
-                <div class="filter-item">
-                    <span class="filter-title">来源:</span>
-                    <RadioGroup v-model="filterOrigin" type="button" @on-change="filterOriginChange">
-                        <Radio label="self">个人私有库</Radio>
-                        <Radio label="school">学校公用库</Radio>
-                        <Radio label="system">系统公用库</Radio>
-                    </RadioGroup>
-                </div>
-                <div class="filter-item">
-                    <span class="filter-title">题型:</span>
-                    <RadioGroup v-model="filterType" type="button" @on-change="filterTypeChange">
-                        <Radio label="all">全部</Radio>
-                        <Radio label="Single">单选</Radio>
-                        <Radio label="Multiple">多选</Radio>
-                        <Radio label="Judge">判断</Radio>
-                        <Radio label="Complete">填空</Radio>
-                        <Radio label="Subjective">问答</Radio>
-                    </RadioGroup>
-                </div>
-                <div class="filter-item">
-                    <span class="filter-title">难度:</span>
-                    <RadioGroup v-model="filterDiff" type="button" @on-change="filterDiffChange">
-                        <Radio label="all">全部</Radio>
-                        <Radio label="0">容易</Radio>
-                        <Radio label="1">较易</Radio>
-                        <Radio label="2">一般</Radio>
-                        <Radio label="3">较难</Radio>
-                        <Radio label="4">困难</Radio>
-                    </RadioGroup>
-                </div>
-                <div class="filter-item">
-                    <span class="filter-title">排序:</span>
-                    <RadioGroup v-model="filterSort" type="button" @on-change="filterSortChange">
-                        <Radio label="0">新增时间<Icon type="md-arrow-round-down" /></Radio>
-                        <Radio label="1">使用次数<Icon type="md-arrow-round-down" /></Radio>
-                    </RadioGroup>
-                </div>
+            <div class="filter-item">
+                <span class="filter-title">题型:</span>
+                <RadioGroup v-model="filterType" type="button" @on-change="filterTypeChange">
+                    <Radio label="all">全部</Radio>
+                    <Radio label="Single">单选</Radio>
+                    <Radio label="Multiple">多选</Radio>
+                    <Radio label="Judge">判断</Radio>
+                    <Radio label="Complete">填空</Radio>
+                    <Radio label="Subjective">问答</Radio>
+                </RadioGroup>
             </div>
-            <div class="ev-list-operation">
-                <Checkbox v-model="isShowAnswer">展示答案与解析</Checkbox>
-                <span class="import-exercise">
-                    <Upload multiple action="api/ImportExercise/uploadWord" :headers="headers" :show-upload-list="isShowUploadList" :on-success="uploadSuccess">
-                        <Button type="info">导入习题</Button>
-                    </Upload>
-                </span>
+            <div class="filter-item">
+                <span class="filter-title">难度:</span>
+                <RadioGroup v-model="filterDiff" type="button" @on-change="filterDiffChange">
+                    <Radio label="all">全部</Radio>
+                    <Radio label="0">容易</Radio>
+                    <Radio label="1">较易</Radio>
+                    <Radio label="2">一般</Radio>
+                    <Radio label="3">较难</Radio>
+                    <Radio label="4">困难</Radio>
+                </RadioGroup>
             </div>
-            <!-- 筛选部分结束 -->
-            <!-- 题目列表部分 -->
-            <div v-if="list.length === 0" class="no-data-text">
-                <img src="../../../assets/icon/no_data.svg" width="120" />
-                <span style="margin-top:15px;color:#808080">暂无数据</span>
+            <div class="filter-item">
+                <span class="filter-title">排序:</span>
+                <RadioGroup v-model="filterSort" type="button" @on-change="filterSortChange">
+                    <Radio label="0">新增时间<Icon type="md-arrow-round-down" /></Radio>
+                    <Radio label="1">使用次数<Icon type="md-arrow-round-down" /></Radio>
+                </RadioGroup>
             </div>
-            <div class="content-wrap" v-else>
-                <Loading v-show="importLoading"></Loading>
-
-                <div class="exercise-item" v-for="(item,index) of list" :key="index">
-                    <!-- 题目难度类型以及绑定知识点 -->
-                    <div class="item-types">
-                        <span class="item-difficulty" :style="{backgroundColor:diffColors[item.difficulty || 3]}">{{exersicesDiff[item.difficulty || 3]}}</span>
-                        <span class="item-type">{{exersicesType[item.type]}}</span>
-                        <span class="item-relevant-points">
-                            <span class="item-tools-bind">
-                                <span class="item-tools-tool">
-                                    <span class="item-bind-point">已关联知识点:</span>
-                                    <span class="item-bind-point" v-for="(concept,index) in item.concept" :key="index" v-show="item.concept"><Tag color="success">{{concept.name}}</Tag></span>
-                                    <span class="item-bind-point" v-show="!item.concept">暂未关联</span>
-                                    <Icon type="md-link" size="20" />
-                                    <span @click="handleBindPoint(item.concept || [])">绑定知识点</span>
-                                </span>
+        </div>
+        <div class="ev-list-operation">
+            <Checkbox v-model="isShowAnswer">展示答案与解析</Checkbox>
+            <span class="import-exercise">
+                <Upload multiple action="api/ImportExercise/uploadWord" :headers="headers" :show-upload-list="isShowUploadList" :on-success="uploadSuccess">
+                    <Button type="info">导入习题</Button>
+                </Upload>
+            </span>
+        </div>
+        <!-- 筛选部分结束 -->
+        <!-- 题目列表部分 -->
+        <div v-if="list.length === 0" class="no-data-text">
+            <img src="../../../assets/icon/no_data.svg" width="120" />
+            <span style="margin-top:15px;color:#808080">暂无数据</span>
+        </div>
+        <div class="content-wrap" v-else>
+            <Loading v-show="importLoading"></Loading>
+
+            <div class="exercise-item" v-for="(item,index) of list" :key="index">
+                <!-- 题目难度类型以及绑定知识点 -->
+                <!--<div class="item-types">
+                    <span class="item-difficulty" :style="{backgroundColor:diffColors[item.difficulty || 3]}">{{exersicesDiff[item.difficulty || 3]}}</span>
+                    <span class="item-type">{{exersicesType[item.type]}}</span>
+                    <span class="item-relevant-points">
+                        <span class="item-tools-bind">
+                            <span class="item-tools-tool">
+                                <span class="item-bind-point">已关联知识点:</span>
+                                <span class="item-bind-point" v-for="(concept,index) in item.concept" :key="index" v-show="item.concept"><Tag color="success">{{concept.name}}</Tag></span>
+                                <span class="item-bind-point" v-show="!item.concept">暂未关联</span>
+                                <Icon type="md-link" size="20" />
+                                <span @click="handleBindPoint(item.concept || [])">绑定知识点</span>
                             </span>
                         </span>
-                    </div>
-                    <!-- 题干部分 -->
-                    <div class="item-question">
-                        <p>{{index+1}} : <span v-html="item.question"></span></p>
-                    </div>
-                    <!-- 选项部分 -->
-                    <div v-for="(option,optionIndex) in item.option" :key="optionIndex">
-                        <p>{{String.fromCharCode(64 + parseInt(optionIndex+1))}} : <span v-html="option.value"></span></p>
-                    </div>
+                    </span>
+                </div>-->
+                <!-- 题干部分 -->
+                <div class="item-question" @click="onQuestionToggle(index)">
+                    <p>{{index+1}} : <span v-html="item.question"></span></p>
+                    <span class="item-btn-toggle">
+                        <Icon type="ios-arrow-dropdown" />
+                    </span>
+                </div>
+                <transition name="slide">
+                    <div v-show="collapseList.indexOf(index) > -1">
+                        <!-- 选项部分 -->
+                        <div v-for="(option,optionIndex) in item.option" :key="optionIndex" class="item-options">
+                            <p>{{String.fromCharCode(64 + parseInt(optionIndex+1))}} : <span v-html="option.value"></span></p>
+                        </div>
 
-                    <!-- 如果是组合题 -->
-                    <div v-for="(childQuestion,childIndex) in item.children" :key="childIndex">
-                        <div v-if="item.children.length">
-                            <div class="item-question">
-                                <p>{{childIndex+1}} : <span v-html="childQuestion.question"></span></p>
-                            </div>
-                            <div v-for="(childOption,childOptionIndex) in childQuestion.option" :key="childOptionIndex">
-                                <p>{{String.fromCharCode(64 + parseInt(childOptionIndex+1))}} : <span v-html="childOption.value"></span></p>
+                        <!-- 如果是组合题 -->
+                        <div v-for="(childQuestion,childIndex) in item.children" :key="childIndex">
+                            <div v-if="item.children.length">
+                                <div class="item-question">
+                                    <p>{{childIndex+1}} : <span v-html="childQuestion.question"></span></p>
+                                </div>
+                                <div v-for="(childOption,childOptionIndex) in childQuestion.option" :key="childOptionIndex">
+                                    <p>{{String.fromCharCode(64 + parseInt(childOptionIndex+1))}} : <span v-html="childOption.value"></span></p>
+                                </div>
+                                <div class="item-answer" v-show="isShowAnswer">
+                                    <span style="color:#01b4ef">【答案】:</span>
+                                    <span v-html="childQuestion.answer[0] || childQuestion.answer" v-if="childQuestion.type === 'Subjective'"></span>
+                                    <span :class="[ childQuestion.type === 'Complete' ? 'item-answer-item':'']" v-for="(answer,answerIndex) in childQuestion.answer" :key="answerIndex" v-else-if="childQuestion.type === 'Complete'" v-html="answer"></span>
+                                    <span :class="[ childQuestion.type === 'Complete' ? 'item-answer-item':'']" v-for="(answer,answerIndex) in childQuestion.answer" :key="answerIndex" v-else>{{answer}}</span>
+                                </div>
+                                <div class="item-explain" v-show="isShowAnswer">
+                                    <span style="color:#01b4ef">【解析】:</span>
+                                    <span v-html="childQuestion.explain"></span>
+                                </div>
                             </div>
-                            <div class="item-answer" v-show="isShowAnswer">
-                                <span style="color:#01b4ef">【答案】:</span>
-                                <span v-html="childQuestion.answer[0] || childQuestion.answer" v-if="childQuestion.type === 'Subjective'"></span>
-                                <span :class="[ childQuestion.type === 'Complete' ? 'item-answer-item':'']" v-for="(answer,answerIndex) in childQuestion.answer" :key="answerIndex" v-else-if="childQuestion.type === 'Complete'" v-html="answer"></span>
-                                <span :class="[ childQuestion.type === 'Complete' ? 'item-answer-item':'']" v-for="(answer,answerIndex) in childQuestion.answer" :key="answerIndex" v-else>{{answer}}</span>
-                            </div>
-                            <div class="item-explain" v-show="isShowAnswer">
-                                <span style="color:#01b4ef">【解析】:</span>
-                                <span v-html="childQuestion.explain"></span>
+                        </div>
+                        <!-- 组合题结束 -->
+                        <!-- 答案展示部分 -->
+                        <div class="item-answer" v-show="item.type !== 'Compose' && isShowAnswer">
+                            <span class="answer-title-line"></span>
+                            <span class="answer-title" @click="showAnswer($event,'answer')">答案:点击展开答案详情</span>
+                            <div class="item-answer-details">
+                                <span v-html="item.answer" v-if="item.type === 'Subjective'"></span>
+                                <span :class="[ item.type === 'Complete' ? 'item-answer-item':'']" v-for="(answer,index) in item.answer" :key="index" v-else-if="item.type === 'Complete'" v-html="answer"></span>
+                                <span :class="[ item.type === 'Complete' ? 'item-answer-item':'']" v-for="(answer,index) in item.answer" :key="index" v-else>{{answer}}</span>
                             </div>
                         </div>
-                    </div>
-                    <!-- 组合题结束 -->
-                    <!-- 答案展示部分 -->
-                    <div class="item-answer" v-show="item.type !== 'Compose' && isShowAnswer">
-                        <span class="answer-title-line"></span>
-                        <span class="answer-title" @click="showAnswer($event,'answer')">答案:点击展开答案详情</span>
-                        <div class="item-answer-details">
-                            <span v-html="item.answer" v-if="item.type === 'Subjective'"></span>
-                            <span :class="[ item.type === 'Complete' ? 'item-answer-item':'']" v-for="(answer,index) in item.answer" :key="index" v-else-if="item.type === 'Complete'" v-html="answer"></span>
-                            <span :class="[ item.type === 'Complete' ? 'item-answer-item':'']" v-for="(answer,index) in item.answer" :key="index" v-else>{{answer}}</span>
+                        <!-- 解析部分 -->
+                        <div class="item-explain" v-show="item.type !== 'Compose' && isShowAnswer">
+                            <span class="explain-title-line"></span>
+                            <span class="explain-title" @click="showAnswer($event,'explain')">解析:点击展开解析详情</span>
+                            <div class="item-explain-details">
+                                <span v-html="item.explain"></span>
+                            </div>
                         </div>
-                    </div>
-                    <!-- 解析部分 -->
-                    <div class="item-explain" v-show="item.type !== 'Compose' && isShowAnswer">
-                        <span class="explain-title-line"></span>
-                        <span class="explain-title" @click="showAnswer($event,'explain')">解析:点击展开解析详情</span>
-                        <div class="item-explain-details">
-                            <span v-html="item.explain"></span>
+                        <!-- 底部题目操作栏 -->
+                        <div class="item-tools">
+                            <span class="item-tools-info">来源:浙江省温州市2019年中考数学试卷</span>
+                            <span class="item-tools-info">使用次数:98 次</span>
+                            <span class="item-tools-info" style="border:0">更新时间:2019-07-01</span>
+                            <!--<Button type="info" :style="{backgroundColor:basketList.all.indexOf(item) > -1 ? '#bbbbbb' : ''}" @click="handleChoose(item)">{{basketList.all.indexOf(item) > -1 ? '已选入' : '选题'}} </Button>-->
+                            <Button type="primary" @click="handleEdit(item)" style="margin-right:10px">编辑题目</Button>
                         </div>
                     </div>
-                    <!-- 底部题目操作栏 -->
-                    <div class="item-tools">
-                        <span class="item-tools-info">来源:浙江省温州市2019年中考数学试卷</span>
-                        <span class="item-tools-info">使用次数:98 次</span>
-                        <span class="item-tools-info" style="border:0">更新时间:2019-07-01</span>
-                        <!--<Button type="info" :style="{backgroundColor:basketList.all.indexOf(item) > -1 ? '#bbbbbb' : ''}" @click="handleChoose(item)">{{basketList.all.indexOf(item) > -1 ? '已选入' : '选题'}} </Button>-->
-                        <Button type="primary" @click="handleEdit(item)" style="margin-right:10px">编辑题目</Button>
-                    </div>
-                </div>
+                </transition>
             </div>
+        </div>
 
-            <!-- 底部分页区域 -->
-            <Page :total="totalNum"
-                  show-sizer
-                  @on-page-size-change="pageSizeChange"
-                  @on-change="pageChange"
-                  :page-size-opts="[5,10,15,20]" />
-            <Button type="success" @click="backToAdd" style="margin:10px;">返回</Button>
-            <Button type="success" @click="backToPaper" style="margin:10px;">试卷</Button>
+        <!-- 底部分页区域 -->
+        <Page :total="totalNum"
+              show-sizer
+              @on-page-size-change="pageSizeChange"
+              @on-change="pageChange"
+              :page-size-opts="[5,10,15,20]" />
+        <Button type="success" @click="backToAdd" style="margin:10px;">返回</Button>
+        <Button type="success" @click="backToPaper" style="margin:10px;">试卷</Button>
 
         <!-- 绑定知识点弹窗开始 -->
         <Modal v-model="bindPointModal"
@@ -220,11 +226,18 @@
                 isShowAnswer: true,
                 importLoading: false,
                 tabSelectVal: 'school',
-                dropBalls: []
+                dropBalls: [],
+                pageSize: 10,
+                pageNum: 1,
+                collapseList: []
             }
         },
         created() {
-            this.getExerciseList({})
+            this.getExerciseList({
+                '@OFFSET': this.pageNum,
+                '@LIMIT': this.pageSize
+
+            })
             //this.schoolInfo = JSON.parse(localStorage.getItem('c_role_info')).roleClaim[0]
             this.list = questions.result.data
             this.totalNum = questions.result.data.length
@@ -233,10 +246,10 @@
             }
         },
         methods: {
-
+            // 获取最新题库列表
             getExerciseList(data) {
                 this.$api.newEvaluation.FindExerciseList(data).then(res => {
-                    console.log(res)
+                    this.list = res.result.data
                 })
             },
 
@@ -268,6 +281,15 @@
                 console.log(val)
             },
 
+            onQuestionToggle(index) {
+                let listIndex = this.collapseList.indexOf(index)
+                if (listIndex > -1) {
+                    this.collapseList.splice(listIndex, 1)
+                } else {
+                    this.collapseList.push(index)
+                }
+            },
+
             // 展开与收起答案
             showAnswer(e, type) {
                 let el = e.currentTarget
@@ -285,13 +307,13 @@
             },
 
             backToAdd() {
-                this.$router.push({
-                    path: '/createExercises'//  
+                this.$slide.push({
+                    path: '/createExercises'//
                 })
             },
 
             backToPaper() {
-                this.$router.push({
+                this.$slide.push({
                     path: '/testPaper'// 或者路径跳转path: '/addCreditCards',
                 })
             },
@@ -315,7 +337,7 @@
             handleEdit(item) {
                 item.options = item.option
                 item.difficulty = item.difficulty || 2
-                this.$router.push({
+                this.$slide.push({
                     name: 'createExercises',
                     params: {
                         item: item
@@ -360,7 +382,7 @@
                 this.$api.FindSchoolBlockAndPointByDict(data).then(res => {
                     let list = res.result.data
                     list.forEach(item => {
-                        item.expand = !item.expand
+                        item.slide = !item.slide
                     })
                     this.schoolPointList = list
                     this.pointListLoading = false
@@ -372,17 +394,6 @@
 
             },
 
-            // 知识点绑定选中事件
-            // pointTreeCheck(val, data) {
-            //  let points = val.filter(item => item.children.length === 0);
-            //  if (points.length > 5) {
-            //    this.checkedPointList = points.slice(0, 5);
-            //    this.$Message.warning("最多绑定5个知识点!");
-            //  } else {
-            //    this.checkedPointList = points;
-            //  }
-            //  console.log(val, data);
-            // },
 
             // 知识点树形结构渲染
             renderContent(h, { root, node, data }) {
@@ -447,7 +458,7 @@
             },
             // 标题点击收缩展开
             titleClick(root, node, data, event) {
-                data.expand = !data.expand
+                data.slide = !data.slide
             },
 
             // 清空已选知识点
@@ -473,7 +484,7 @@
                     let requestData = { htmlString: response.result.data.HtmlString }
                     this.$api.SaveAnalyzeHtml(requestData).then(res => {
                         if (res.error === null) {
-                            setTimeout(function() {
+                            setTimeout(function () {
                                 that.$Message.success('文件上传解析成功!')
                                 that.list = res.result.data
                                 that.importLoading = false
@@ -495,8 +506,8 @@
 
         },
         mounted() {
-          //this.getStandardList()
-          this.list = questions.result.data
+            //this.getStandardList()
+            this.list = questions.result.data
             //this.getSchoolPoints()
             // this.getAllPoints();
         },
@@ -521,6 +532,17 @@
         width: 50px;
         height: 50px;
     }
+    .slide-enter-active {
+      transition: all .3s ease;
+    }
+    .slide-leave-active {
+      transition: all .3s ease;
+    }
+    .slide-enter, .slide-leave-to
+    /* .slide-fade-leave-active for below version 2.1.8 */ {
+      transform: translateY(10px);
+      opacity: 0;
+    }
 </style>
 
 <!--<style src="../index/ExercisesList.css" scoped></style>-->

+ 15 - 8
TEAMModelOS/Controllers/Analysis/AchievementController.cs

@@ -810,8 +810,9 @@ namespace TEAMModelOS.Controllers.Analysis
             Dictionary<string, object> examMap = new Dictionary<string, object>
             {
                 { "SchoolCode", SchoolCode.ToString()},
-                { "ExamCode", ExamCode.ToString()}
-              
+                { "ExamCode", ExamCode.ToString()},
+                { "Subject",  Subject.ToString()}
+
 
             };
             List<ExamPaper> paper = await azureCosmosDBRepository.FindByDict<ExamPaper>(sub);
@@ -881,13 +882,19 @@ namespace TEAMModelOS.Controllers.Analysis
             resultSum.Sort(delegate (double s1, double s2) { return s1.CompareTo(s2); });
             double rhlCount = resultSum.Count * 0.27;
             double rhl = resultSum[int.Parse(rhwCount.ToString("0"))];
-            exams.ForEach(e =>
+            foreach (SimpleExam ex in exams) {
+                point = ex.Point;
+                result = ex.Result;
+                classes = ex.Classes;
+                ids = ex.Ids;
+            }
+           /* exams.ForEach(e =>
             {
                 point = e.Point;
                 result = e.Result;
                 classes = e.Classes;
                 ids = e.Ids;
-            });
+            });*/
             List<string> knowledgeName = new List<string>();
             foreach (string cla in knowledge)
             {
@@ -1024,7 +1031,7 @@ namespace TEAMModelOS.Controllers.Analysis
                 int rhlC = 0;
                 foreach (string id in ids)
                 {
-                    if (id.Equals("0"))
+                    if (id.Equals("0") || result[m].Sum() == 0)
                     {
                         m++;
                         continue;
@@ -1149,7 +1156,7 @@ namespace TEAMModelOS.Controllers.Analysis
                         className.Add(kvp.Key);
                         for (int n = kvp.Value[0]; n < kvp.Value[1]; n++)
                         {
-
+                            if (result[n].Sum() == 0) continue;
                             paper.ForEach(p =>
                             {
                                 int x = 0;
@@ -1162,7 +1169,7 @@ namespace TEAMModelOS.Controllers.Analysis
                                         {
                                             //当前认知层次在该题占比多少
                                             ePoint = 1 ;
-                                            anwCPoint += result[kvp.Value[0]][x] * ePoint;
+                                            anwCPoint += result[n][x] * ePoint;
                                             cpo += point[x] * ePoint;
                                         }
                                         x++;
@@ -1172,7 +1179,7 @@ namespace TEAMModelOS.Controllers.Analysis
                                         {
                                             //当前知识点在该题占比多少
                                             ePoint = 1 / Convert.ToDouble(i.points.Count);
-                                            anwCPoint += result[kvp.Value[0]][x] * ePoint;
+                                            anwCPoint += result[n][x] * ePoint;
                                             cpo += point[x] * ePoint;
                                         }
                                         x++;

+ 25 - 0
TEAMModelOS/Controllers/Exam/ExamController.cs

@@ -30,9 +30,11 @@ namespace TEAMModelOS.Controllers.Exam
         public async Task<BaseJosnRPCResponse> SaveExamInfo(JosnRPCRequest<ExamInfo> request)
         {
             JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
+            request.@params.scopeCode = request.@params.scopeCode.Replace("#", "");
             if (string.IsNullOrEmpty(request.@params.id))
             {
                 request.@params.id = Guid.NewGuid().ToString();
+              
                 await cosmosDBV3Repository.SaveOrUpdate(request.@params);
             }
             else
@@ -41,6 +43,29 @@ namespace TEAMModelOS.Controllers.Exam
             }
             return builder.Data(request.@params).build();
         }
+
+        /// <summary>
+        /// 查询考试信息
+        /// </summary>
+        /// <param name="request"></param>
+        /// <returns></returns>
+        [HttpPost("FindExamInfo")]
+        public async Task<BaseJosnRPCResponse> FindExamInfo(JosnRPCRequest<Dictionary<string,object>> request)
+        {
+            JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
+            return builder.Data( await cosmosDBV3Repository.FindByDict<ExamInfo>(request.@params)).build();
+        }
+        /// <summary>
+        /// 查询试卷
+        /// </summary>
+        /// <param name="request"></param>
+        /// <returns></returns>
+        [HttpPost("FindExamPaper")]
+        public async Task<BaseJosnRPCResponse> FindExamPaper(JosnRPCRequest<Dictionary<string, object>> request)
+        {
+            JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
+            return builder.Data(await cosmosDBV3Repository.FindByDict<ExamPaper>(request.@params)).build();
+        }
         /// <summary>
         /// 保存试卷
         /// </summary>

+ 28 - 0
TEAMModelOS/Controllers/Exam/ItemInfoController.cs

@@ -81,6 +81,34 @@ namespace TEAMModelOS.Controllers.Exam
         /// </summary>
         /// <param name="request"></param>
         /// <returns></returns>
+        [HttpPost("FindSummary")]
+        public async Task<BaseJosnRPCResponse> FindSummary(JosnRPCRequest<Dictionary<string, object>> request)
+        {
+            JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
+            List<string> props = new List<string> {
+                "question", "id", "scopeCode", "usageCount",
+                "level","field","points","type"
+            };
+            List<ExamItem> items = await cosmosDBV3Repository.FindByDict<ExamItem>(request.@params,propertys: props);
+            return builder.Data(items).Extend(new Dictionary<string, object> { { "props", props } }).build();
+        }
+        /// <summary>
+        /// 手动挑题
+        /// </summary>
+        /// <param name="request"></param>
+        /// <returns></returns>
+        [HttpPost("FindById")]
+        public async Task<BaseJosnRPCResponse> FindById(JosnRPCRequest<string> request)
+        {
+            JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
+            ExamItem items = await cosmosDBV3Repository.FindById<ExamItem>(request.@params);
+            return builder.Data(items).build();
+        }
+        /// <summary>
+        /// 手动挑题
+        /// </summary>
+        /// <param name="request"></param>
+        /// <returns></returns>
         [HttpPost("Find")]
         public async Task<BaseJosnRPCResponse> Find(JosnRPCRequest<Dictionary<string, object>> request)
         {

+ 2 - 2
TEAMModelOS/Startup.cs

@@ -96,8 +96,8 @@ namespace TEAMModelOS
             //});
             services.AddMemoryCache();
             //  services.AddJsonRpc();
-            services.AddControllers();
-                //.AddNewtonsoftJson().AddJsonOptions(options => { options.JsonSerializerOptions.IgnoreNullValues = true; });
+            services.AddControllers().AddJsonOptions(options => { options.JsonSerializerOptions.IgnoreNullValues = true; });
+            //.AddNewtonsoftJson().AddJsonOptions(options => { options.JsonSerializerOptions.IgnoreNullValues = true; });
             //上传文件最大处理
             services.Configure<FormOptions>(x =>
             {   x.BufferBodyLengthLimit= long.MaxValue;