Explorar el Código

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

liqk hace 4 años
padre
commit
0f05490c83
Se han modificado 33 ficheros con 805 adiciones y 396 borrados
  1. 15 13
      TEAMModelOS/ClientApp/src/components/student-analysis/total/BaseKnowledgeDetail.vue
  2. 2 2
      TEAMModelOS/ClientApp/src/components/student-analysis/total/BaseLevelPie.vue
  3. 1 1
      TEAMModelOS/ClientApp/src/components/student-analysis/total/BaseLevelRadar.vue
  4. 17 15
      TEAMModelOS/ClientApp/src/components/student-analysis/total/BaseRadar.vue
  5. 28 2
      TEAMModelOS/ClientApp/src/locale/lang/zh-CN/evaluation.js
  6. 32 6
      TEAMModelOS/ClientApp/src/locale/lang/zh-TW/evaluation.js
  7. 36 0
      TEAMModelOS/ClientApp/src/store/module/totalAnalysis.js
  8. 0 6
      TEAMModelOS/ClientApp/src/utils/MathJax.js
  9. 3 1
      TEAMModelOS/ClientApp/src/utils/blobTool.js
  10. 85 1
      TEAMModelOS/ClientApp/src/utils/public.js
  11. 17 41
      TEAMModelOS/ClientApp/src/view/evaluation/bank/TestPaperList.vue
  12. 7 3
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseChild.vue
  13. 6 0
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseExerciseList.vue
  14. 1 1
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseImport.vue
  15. 10 10
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseRepair.vue
  16. 16 17
      TEAMModelOS/ClientApp/src/view/evaluation/index/CreateExercises.vue
  17. 1 0
      TEAMModelOS/ClientApp/src/view/evaluation/index/TestPaper.vue
  18. 2 2
      TEAMModelOS/ClientApp/src/view/evaluation/types/BaseCompletion.vue
  19. 1 1
      TEAMModelOS/ClientApp/src/view/evaluation/types/BaseCompose.vue
  20. 2 2
      TEAMModelOS/ClientApp/src/view/evaluation/types/BaseConnector.vue
  21. 2 2
      TEAMModelOS/ClientApp/src/view/evaluation/types/BaseCorrect.vue
  22. 4 4
      TEAMModelOS/ClientApp/src/view/evaluation/types/BaseJudge.vue
  23. 4 4
      TEAMModelOS/ClientApp/src/view/evaluation/types/BaseMultiple.vue
  24. 4 4
      TEAMModelOS/ClientApp/src/view/evaluation/types/BaseSingle.vue
  25. 2 2
      TEAMModelOS/ClientApp/src/view/evaluation/types/BaseSubjective.vue
  26. 1 1
      TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/AchievementAnalysis/EntryTables.vue
  27. 2 2
      TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/KnowledgeAnalysis/KnowledgeAnalysis.vue
  28. 4 4
      TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/LevelAnalysis/LevelAnalysis.vue
  29. 7 2
      TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/LevelAnalysis/ScoreDetails.vue
  30. 1 0
      TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/index.vue
  31. 488 247
      TEAMModelOS/Controllers/Analysis/AnalysisController.cs
  32. 2 0
      TEAMModelOS/Controllers/Analysis/ClassAys.cs
  33. 2 0
      TEAMModelOS/Controllers/Analysis/StudentAys.cs

+ 15 - 13
TEAMModelOS/ClientApp/src/components/student-analysis/total/BaseKnowledgeDetail.vue

@@ -193,8 +193,9 @@
             },
 
             doRender(data) {
+				console.log(data)
                 this.x = data.pointList
-                this.y = data.stupercent.grade.map(item => (Number(item) * 100).toFixed(0))
+                this.y = data.stupercent.grade.map(item => (Number(item)).toFixed(2))
                 this.drawLine()
             }
         },
@@ -219,21 +220,22 @@
             // 获取最新散点图数据
             getKnowledgeData() {
 				let curSubjectIndex = this.$store.state.totalAnalysis.analysisJson.subjects.map(i => i.name).indexOf(this.$store.state.totalAnalysis.currentSubject)
-                return this.echartsId === 'knowDetailBar' ? this.$store.state.totalAnalysis.analysisJson.pointLevelKey[curSubjectIndex].pointKey : 
+                let curJson = this.echartsId === 'knowDetailBar' ? this.$store.state.totalAnalysis.analysisJson.pointLevelKey[curSubjectIndex].pointKey : 
 				this.$store.state.totalAnalysis.analysisJson.pointLevelKey[curSubjectIndex].levelKey
+				if(this.echartsId !== 'knowDetailBar'){
+					let transArr = ["知识", "理解", "应用", "分析", "综合", "评鉴"]
+					curJson.pointList = curJson.pointList.map((i,index) => transArr[index])
+					for(let key in curJson.classpercent){
+						if(!isNaN(key)){
+							let newKey = transArr[+key - 1]
+							curJson.classpercent[newKey] = curJson.classpercent[key]
+							curJson.stupercent[newKey] = curJson.stupercent[key]
+						}
+					}
+				}
+				return curJson
             }
         },
-        watch: {
-            getKnowledgeData: {
-                deep: true,
-                handler(val) {
-                    if (val) {
-                        this.doRender(val)
-                    }
-                }
-
-            }
-        }
     }
 </script>
 

+ 2 - 2
TEAMModelOS/ClientApp/src/components/student-analysis/total/BaseLevelPie.vue

@@ -28,7 +28,7 @@
                     calculable: true,
                     roseType: true,
                     series: {
-                        name: that.$t('totalAnalysis.ka_title1'),
+                        name: that.$t('totalAnalysis.le_title1'),
                         type: 'pie',
                         radius: [40, 150],
                         center: ['45%', 190],
@@ -48,7 +48,7 @@
         mounted() {
             if (this.getPieData) {
                 let pointList = this.getPieData.pointList
-                let valList = this.getPieData.fper
+                let valList = this.getPieData.per
                 let arr = []
                 pointList.forEach((item, index) => {
                     let o = {}

+ 1 - 1
TEAMModelOS/ClientApp/src/components/student-analysis/total/BaseLevelRadar.vue

@@ -27,7 +27,7 @@
                 var option = {
                     tooltip: {
                         formatter: function(params) {
-                            var results = params.marker + '知识点占比情况<br>'
+                            var results = params.marker + '认知层次占比情况<br>'
                             for (var i = 0; i < params.value.length; i++) {
                                 results += indicator[i].name + ':' + params.value[i] + '%<br>'
                             }

+ 17 - 15
TEAMModelOS/ClientApp/src/components/student-analysis/total/BaseRadar.vue

@@ -120,15 +120,14 @@
             },
 
             doRender(data) {
-                let list = data
                 let indicator = []
-                list.pointList.forEach(item => {
+                data.pointList.forEach(item => {
                     indicator.push({
                         name: item,
                         max: 100
                     })
                 })
-                this.drawLine(indicator, list.stupercent.grade.map(item => (Number(item) * 100).toFixed(0)))
+                this.drawLine(indicator, data.stupercent.grade.map(item => (Number(item)).toFixed(2)))
             }
         },
         mounted() {
@@ -140,18 +139,21 @@
         computed: {
             // 获取最新雷达图数据
             getKnowledgeData() {
-                return this.echartsId === 'knowRadar' ? this.$store.state.totalAnalysis.analysisJson.pointKey : this.$store.state.totalAnalysis.analysisJson.levelKey
-            }
-        },
-        watch: {
-            getKnowledgeData: {
-                deep: true,
-                handler(val) {
-                    if (val) {
-                        this.doRender(val)
-                    }
-                }
-
+				let curSubjectIndex = this.$store.state.totalAnalysis.analysisJson.subjects.map(i => i.name).indexOf(this.$store.state.totalAnalysis.currentSubject)
+				let curJson = this.echartsId === 'knowRadar' ? this.$store.state.totalAnalysis.analysisJson.pointLevelKey[curSubjectIndex].pointKey : 
+				this.$store.state.totalAnalysis.analysisJson.pointLevelKey[curSubjectIndex].levelKey
+				if(this.echartsId !== 'knowRadar'){
+					let transArr = ["知识", "理解", "应用", "分析", "综合", "评鉴"]
+					curJson.pointList = curJson.pointList.map((i,index) => transArr[index])
+					for(let key in curJson.classpercent){
+						if(!isNaN(key)){
+							let newKey = transArr[+key - 1]
+							curJson.classpercent[newKey] = curJson.classpercent[key]
+							curJson.stupercent[newKey] = curJson.stupercent[key]
+						}
+					}
+				}
+				return curJson
             }
         }
     }

+ 28 - 2
TEAMModelOS/ClientApp/src/locale/lang/zh-CN/evaluation.js

@@ -57,6 +57,8 @@ export default {
 	deleteItem:'删除',
 	editItem:'编辑',
 	confirm:'确认',
+	deleteSuc:'删除成功',
+	deleteFail:'删除失败',
 	newExercise:{
 		newSchoolItem:'新建校本题目',
 		newPrivateItem:'新建个人题目',
@@ -66,11 +68,12 @@ export default {
 		chooseSubject:'选择科目',
 		gradePlaceholder:'不选择则默认选中全部年级',
 		diff:'题目难度',
-		field:'关联认知层次',
+		field:'关联认知层次', 
 		knowledge:'关联知识点',
 		choosePoint:'选择知识点',
 		type:'选择题型',
 		stem:'题干',
+		option:'选项',
 		singleOption:'单选选项',
 		multipleOption:'多选选项',
 		trueAnswer:'正确答案',
@@ -83,6 +86,29 @@ export default {
 		chooseContent:'选择内容',
 		normalResource:'一般资源',
 		mediaResource:'影片资源',
-		linkTip:'请输入正确的链接地址(如:https://www.baidu.com)'
+		linkTip:'请输入正确的链接地址(如:https://www.baidu.com)',
+		childList:'小题列表',
+		addChild:'添加小题',
+		save:'保存',
+		cancel:'取消',
+		composeTip:'综合题的知识点请绑定在小题上!',
+		noSchoolTip:'您当前未加入学校,无法选择知识点!',
+		uploadErrorTip:'试题文件上传失败,请稍后重试!',
+		unCompleteTip:'请将题目填写完整!',
+		typeChangeTip:'暂不支持更换题型!',
+		modalTip:'温馨提示',
+		unSaveTip:'确认放弃保存当前试题并前往?',
+		answerTitle:'参考答案',
+		contentRelate:'内容关联'
+	},
+	paperList:{
+		usePeriod:'适用学段',
+		useGrade:'适用年级',
+		itemCount:'题量',
+		paperAnalysis:'试卷分析',
+		totalScore:'总分',
+		score:'分',
+		paperErrorTip:'获取试卷数据失败!',
+		confirmDelete:'确认删除该试卷吗?'
 	}
 }

+ 32 - 6
TEAMModelOS/ClientApp/src/locale/lang/zh-TW/evaluation.js

@@ -33,11 +33,11 @@ export default {
 	connector: '連線題',
 	correct: '改錯題',
 	compose: '綜合題',
-	diff1:'容易',
-	diff2:'較易',
-	diff3:'一般',
-	diff4:'較難',
-	diff5:'困難',
+	diff1: '容易',
+	diff2: '較易',
+	diff3: '一般',
+	diff4: '較難',
+	diff5: '困難',
 	level1: '知識',
 	level2: '理解',
 	level3: '應用',
@@ -57,6 +57,8 @@ export default {
 	deleteItem: '删除',
 	editItem: '編輯',
 	confirm: '確認',
+	deleteSuc: '删除成功',
+	deleteFail: '删除失敗',
 	newExercise: {
 		newSchoolItem: '新建校本題目',
 		newPrivateItem: '新建個人題目',
@@ -71,6 +73,7 @@ export default {
 		choosePoint: '選擇知識點',
 		type: '選擇題型',
 		stem: '題幹',
+		option: '選項',
 		singleOption: '單選選項',
 		multipleOption: '多選選項',
 		trueAnswer: '正確答案',
@@ -83,6 +86,29 @@ export default {
 		chooseContent: '選擇內容',
 		normalResource: '一般資源',
 		mediaResource: '影片資源',
-		linkTip: '請輸入正確的連結位址(如:https://www.baidu.com)'
+		linkTip: '請輸入正確的連結位址(如:https://www.baidu.com)',
+		childList: '小題清單',
+		addChild: '添加小題',
+		save: '保存',
+		cancel: '取消',
+		composeTip: '綜合題的知識點請綁定在小題上!',
+		noSchoolTip: '您當前未加入學校,無法選擇知識點!',
+		uploadErrorTip: '試題文件上傳失敗,請稍後重試!',
+		unCompleteTip: '請將題目填寫完整!',
+		typeChangeTip: '暫不支持更換題型!',
+		modalTip: '溫馨提示',
+		unSaveTip: '確認放弃保存當前試題並前往?',
+		answerTitle: '參考答案',
+		contentRelate: '內容關聯'
+	},
+	paperList: {
+		usePeriod: '適用學段',
+		useGrade: '適用年級',
+		itemCount: '題量',
+		paperAnalysis: '試卷分析',
+		totalScore: '總分',
+		score: '分',
+		paperErrorTip: '獲取試卷數據失敗!',
+		confirmDelete: '確認删除該試卷嗎?'
 	}
 }

+ 36 - 0
TEAMModelOS/ClientApp/src/store/module/totalAnalysis.js

@@ -40,6 +40,42 @@ export default {
 		
 		// 更新最新学情分析数据
 		updateAnalysisJson(state,val){
+			let pointLevelKey = []
+			if(!val) return
+			/* 对知识点模块和认知层次模块进行数据格式化 */
+			val.subjects.forEach((subject,subjectIndex) => {
+				pointLevelKey.push({
+					subjectId:subject.id,
+					levelKey:{
+						level:val.fieldName[subjectIndex].Value,
+						pointList:val.fieldName[subjectIndex].Value,
+						per:val.fieldPer[subjectIndex].Value,
+						wrong:{
+							datas:val.fieldwrong[subjectIndex].Value,
+							keys:val.wrongKey
+						},
+						stupercent:tools.getLevelPercent(val,subjectIndex).stuResult,
+						classpercent:tools.getLevelPercent(val,subjectIndex).classResult
+					},
+					pointKey:{
+						level:val.knowName[subjectIndex].Value,
+						pointList:val.knowName[subjectIndex].Value,
+						per:val.knowPer[subjectIndex].Value,
+						wrong:{
+							datas:val.wrong[subjectIndex].Value,
+							keys:val.wrongKey
+						},
+						stupercent:tools.getKnowPercent(val,subjectIndex).stuResult,
+						classpercent:tools.getKnowPercent(val,subjectIndex).classResult
+					}
+				})
+			})
+			val.pointLevelKey = pointLevelKey
+			console.log('转换后的AnalysisJson',val)
+			state.analysisJson = val
+		},
+		
+		clearAnalysis(state,val){
 			state.analysisJson = val
 		},
 

+ 0 - 6
TEAMModelOS/ClientApp/src/utils/MathJax.js

@@ -2,13 +2,10 @@
 
 let isMathjaxConfig = false // 用于标识是否配置
 const initMathjaxConfig = () => {
-	console.log(window.MathJax)
 	if (!window.MathJax) {
 		return
 	}
-	console.log('MathJax配置')
 	window.MathJax.Hub.Config({
-		skipStartupTypeset: true,
 		showProcessingMessages: false, // 关闭js加载过程信息
 		messageStyle: 'none', // 不显示信息
 		tex: {
@@ -34,13 +31,10 @@ const initMathjaxConfig = () => {
 			showMathMenu: true
 		}
 	})
-	console.log('MathJax配置')
-	console.log(window.MathJax.Hub)
 	isMathjaxConfig = true // 配置完成,改为true
 }
 
 const MathQueue = function(elementId) {
-	console.log('进来了', elementId)
 	if (!window.MathJax) {
 		return
 	}

+ 3 - 1
TEAMModelOS/ClientApp/src/utils/blobTool.js

@@ -157,7 +157,8 @@ export default class BlobTool {
                         {
                             url: this.blobUrl + '/' + this.container + '/' + blobName,
                             blob: '/' + blobName,
-                            name: blobName.substring(JsFn.findChartIndex(blobName, '/', 0) + 1),
+                            // name: blobName.substring(JsFn.findChartIndex(blobName, '/', 0) + 1),
+                            name: blobName.substring(blobName.lastIndexOf('/') + 1),
                             size: blobItem.value.properties.contentLength,
                             createTime: blobItem.value.properties.createdOn.getTime(),
                             extension: info.ex,
@@ -332,6 +333,7 @@ export default class BlobTool {
                 sasString = this.sasString
             }
             if (blobs && blobs.blobList) {
+				console.log(blobs)
                 let count = 0
                 blobs.blobList.forEach(blobItem => {
                     let newUrl = targetFolder + blobItem.name

+ 85 - 1
TEAMModelOS/ClientApp/src/utils/public.js

@@ -612,5 +612,89 @@ export default {
 			}
 		}
 		return true;
-	}
+	},
+	
+	getLevelStuPercent(val,subjectIndex,index){
+		let result = []
+		val.students.forEach(stu => {
+			result.push([
+				stu.id,
+				stu.className,
+				stu.no || '-',
+				val.fScores[subjectIndex].Value[index],
+				stu.subjects[subjectIndex].fieldPoint[index],
+				(stu.subjects[subjectIndex].fieldPoint[index] / val.fScores[subjectIndex].Value[index]).toFixed(2)
+			])
+		})
+		return result
+	},
+	
+	getLevelClassPercent(val,subjectIndex,index){
+		let result = []
+		val.classes.forEach(classItem => {
+			result.push(classItem.subjects[subjectIndex].field[index])
+		})
+		return result
+	},
+	
+	getLevelPercent(val,subjectIndex){
+		let stuResult = {}
+		let classResult = {}
+		val.fieldName[subjectIndex].Value.forEach((item,index) => {
+			stuResult[item] = this.getLevelStuPercent(val,subjectIndex,index)
+			classResult[item] = this.getLevelClassPercent(val,subjectIndex,index)
+		})
+		stuResult.grade = val.fieldAllPer[subjectIndex].Value
+		stuResult.keys = val.knowKey
+		classResult.keys = val.knowkey
+		classResult.className = []
+		let obj = {
+			stuResult:stuResult,
+			classResult:classResult
+		}
+		return obj
+	},
+	
+	/* 学情知识点模块数据转换 */
+	getKnowStuPercent(val,subjectIndex,index){
+		let result = []
+		val.students.forEach(stu => {
+			result.push([
+				stu.id,
+				stu.className,
+				stu.no || '-',
+				val.kScores[subjectIndex].Value[index],
+				stu.subjects[subjectIndex].point[index],
+				(stu.subjects[subjectIndex].point[index] / val.kScores[subjectIndex].Value[index]).toFixed(2)
+			])
+		})
+		return result
+	},
+	
+	getKnowClassPercent(val,subjectIndex,index){
+		let result = []
+		val.classes.forEach(classItem => {
+			result.push(classItem.subjects[subjectIndex].point[index])
+		})
+		return result
+	},
+	
+	getKnowPercent(val,subjectIndex){
+		let stuResult = {}
+		let classResult = {}
+		val.knowName[subjectIndex].Value.forEach((item,index) => {
+			stuResult[item] = this.getKnowStuPercent(val,subjectIndex,index)
+			classResult[item] = this.getKnowClassPercent(val,subjectIndex,index)
+		})
+		stuResult.grade = val.knowAllper[subjectIndex].Value
+		stuResult.keys = val.knowKey
+		classResult.keys = val.knowkey
+		classResult.className = []
+		let obj = {
+			stuResult:stuResult,
+			classResult:classResult
+		}
+		return obj
+	},
+
 }

+ 17 - 41
TEAMModelOS/ClientApp/src/view/evaluation/bank/TestPaperList.vue

@@ -6,7 +6,7 @@
 		<!-- 空数据展示 -->
 		<div v-if="paperList.length === 0" class="no-data-text">
 			<img src="@/assets/icon/no_data.svg" width="120" />
-			<span style="margin-top:15px;color:#808080">暂无数据</span>
+			<span style="margin-top:15px;color:#808080">{{$t('evaluation.noData')}}</span>
 		</div>
 
 		<!-- 试卷列表页面 -->
@@ -19,10 +19,10 @@
 						<span style="margin-left: 8px;">{{ paper.name }}</span>
 					</div>
 					<div class="paper-item-info">
-						<span class="info-item" v-if="isSchool">适用学段:<span class="info-bold">{{ getPeriodName(paper.periodId) }}</span></span>
-						<span class="info-item" v-if="isSchool">适用年级:<span class="info-bold" v-for="(grade,gIndex) in paper.gradeIds" :key="gIndex">{{ getGradeName(paper.periodId,grade) }}
+						<span class="info-item" v-if="isSchool">{{$t('evaluation.paperList.usePeriod')}}:<span class="info-bold">{{ getPeriodName(paper.periodId) }}</span></span>
+						<span class="info-item" v-if="isSchool">{{$t('evaluation.paperList.useGrade')}}:<span class="info-bold" v-for="(grade,gIndex) in paper.gradeIds" :key="gIndex">{{ getGradeName(paper.periodId,grade) }}
 								<span v-show="gIndex !== paper.gradeIds.length - 1"> / </span></span></span>
-						<span class="info-item">题量:<span class="info-bold">{{ paper.scoring ? paper.scoring.length : 0 }}</span></span>
+						<span class="info-item">{{$t('evaluation.paperList.itemCount')}}:<span class="info-bold">{{ paper.scoring ? paper.scoring.length : 0 }}</span></span>
 						<!-- <span class="info-item">难度系数:<span class="info-bold">{{ paper.item ? handleDiffCalc(paper.item) : 0 }}</span></span> -->
 					</div>
 					<div class="paper-item-tools">
@@ -32,11 +32,11 @@
 						</span> -->
 						<span class="paper-item-tools-edit" @click.stop="goToPaper(paper)" v-if="($access.can('admin.*||exercise-upd') || !isSchool)">
 							<Icon type="ios-create" />
-							<span>编辑</span>
+							<span>{{$t('evaluation.editItem')}}</span>
 						</span>
 						<span class="paper-item-tools-delete" @click.stop="onDeletePaper(paper)" v-if="($access.can('admin.*||exercise-upd') || !isSchool)">
 							<Icon type="md-trash" />
-							<span>删除</span>
+							<span>{{$t('evaluation.deleteItem')}}</span>
 						</span>
 					</div>
 				</div>
@@ -52,8 +52,8 @@
 					</div>
 					
 					<div class="pl-review-wrap-right">
-						<h2>试卷分析</h2>
-						<p style="margin-bottom: 20px;margin-top: 10px;">(总分:{{ evaluationInfo.score }} 分)</p>
+						<h2>{{$t('evaluation.paperList.paperAnalysis')}}</h2>
+						<p style="margin-bottom: 20px;margin-top: 10px;">({{$t('evaluation.paperList.totalScore')}}:{{ evaluationInfo.score }} {{$t('evaluation.paperList.score')}})</p>
 						<BaseTypePie :echartsData="evaluationInfo"></BaseTypePie>
 						<BaseObjectivePie :echartsData="evaluationInfo"></BaseObjectivePie>
 						<BaseDiffPie :echartsData="evaluationInfo"></BaseDiffPie>
@@ -146,7 +146,7 @@
 					this.dataLoading = false
 				} catch (e) {
 					this.dataLoading = false
-					this.$Message.error('获取试卷数据失败!')
+					this.$Message.error(this.$t('evaluation.paperList.paperErrorTip'))
 				}
 			},
 			
@@ -198,7 +198,7 @@
 					}, 1000)
 				}).catch(err => {
 					setTimeout(() => {
-						this.$Message.error('试卷数据获取失败')
+						this.$Message.error(this.$t('evaluation.paperList.paperErrorTip'))
 						that.dataLoading = false
 					}, 1000)
 				})
@@ -223,7 +223,7 @@
 						}
 					})
 				} catch (e) {
-					this.$Message.error('获取试卷数据失败')
+					this.$Message.error(this.$t('evaluation.paperList.paperErrorTip'))
 					this.dataLoading = false
 				}
 
@@ -235,10 +235,8 @@
 			 */
 			onDeletePaper(item) {
 				this.$Modal.confirm({
-					title: '提示',
-					content: '<p>确认删除该试卷吗?</p>',
-					okText: '确认',
-					cancelText: '取消',
+					title: this.$t('evaluation.newExercise.modalTip'),
+					content: this.$t('evaluation.paperList.confirmDelete'),
 					onOk: async () => {
 						this.dataLoading = true
 						this.$api.learnActivity.DeleteExamPaper({
@@ -248,15 +246,15 @@
 						}).then(async res => {
 							if (!res.error) {
 								this.deleteBlobPrefix(item).then(r => {
-									this.$Message.success('删除成功')
+									this.$Message.success(this.$t('evaluation.deleteSuc'))
 									this.doFilter()
 								})
 							} else {
-								this.$Message.warning('删除失败,错误代码:' + res.error.code + ',错误信息:' + res.error.message)
+								this.$Message.warning(this.$t('evaluation.deleteFail'))
 							}
 						}).catch(err => {
 							console.log(err)
-							this.$Message.warning('删除失败')
+							this.$Message.warning(this.$t('evaluation.deleteFail'))
 						})
 					}
 				})
@@ -323,28 +321,6 @@
 				})
 			},
 
-			// 导入试题
-			uploadSuccess(response, file, fileList) {
-				let that = this
-				this.importLoading = true
-				if (response.error === null) {
-					let requestData = {
-						htmlString: response.result.data.HtmlString
-					}
-					this.$api.SaveAnalyzeHtml(requestData).then(res => {
-						if (res.error === null) {
-							setTimeout(function() {
-								that.$Message.success('文件上传解析成功!')
-								that.exerciseList = res.result.data
-								that.importLoading = false
-							}, 1000)
-						}
-					})
-				} else {
-					this.$Message.error('对不起,文档解析失败!')
-				}
-			},
-
 			/**
 			 * 根据SubjectCode换取SubjectName
 			 * @param code
@@ -359,7 +335,7 @@
 			 */
 			getGradeName(periodId, code) {
 				return this.$store.state.user.schoolProfile.school_base ? this.$store.state.user.schoolProfile.school_base.period.filter(i => i.id === periodId)[0].grades.filter(j =>
-					j.id === code)[0].name : '暂无'
+					j.id === code)[0].name : ''
 			},
 
 			/**

+ 7 - 3
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseChild.vue

@@ -105,14 +105,16 @@
 		},
 
 		mounted() {
-			
+			this.$nextTick(()=>{
+				this.$MathJax.MathQueue(this.$refs.childRef);
+			})
 		},
 
 		watch: {
 			children:{
 				handler(n){
 					this.$nextTick(()=>{
-						// window.MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
+						this.$MathJax.MathQueue(this.$refs.childRef);
 					})
 				}
 			},
@@ -125,7 +127,9 @@
 
 	}
 </script>
-
+<style lang="less" scoped>
+	@import "../index/CommonExercise.less";
+</style>
 <style lang="less" scoped>
 	.child-wrap{
 		.child-item{

+ 6 - 0
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseExerciseList.vue

@@ -633,6 +633,12 @@
 					}
 				})
 				return arr.indexOf(type)
+			},
+			
+			doRenderMathJax(){
+				this.$nextTick(() => {
+					this.$MathJax.MathQueue(this.$refs.mathJaxContainer);
+				})
 			}
 
 

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

@@ -73,7 +73,7 @@
         created() {
             this.uploadUrl = window.location.origin  + '/import/upload-word'
 			this.curLang = localStorage.getItem('local')
-			this.hostName = this.$store.state.privateSas.url || 'https://teammodelstorage.blob.core.chinacloudapi.cn'
+			this.hostName = this.$store.state.privateSas ? this.$store.state.privateSas.url : 'https://teammodelstorage.blob.core.chinacloudapi.cn'
         },
         methods: {
 

+ 10 - 10
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseRepair.vue

@@ -1,15 +1,15 @@
 <template>
 	<div class="repair-wrap">
 		<Tabs :animated="false" name="repairTab">
-			<TabPane label="外部资源" tab="repairTab">
-				<Button type="info" @click="onAddLink('normal')" v-show="datas.filter(i => i.type !== 'file').length === 0">添加链接</Button>
+			<TabPane :label="$t('evaluation.newExercise.outRepair')" tab="repairTab">
+				<Button type="info" @click="onAddLink('normal')" v-show="datas.filter(i => i.type !== 'file').length === 0">{{$t('evaluation.newExercise.addLink')}}</Button>
 				<div class="repair-link-wrap">
 					<div class="repair-link-wrap-item" v-for="(item,index) in datas.filter(i => i.type !== 'file')" :key="index">
 							<div class="repair-link-wrap-item-box">
 								<Input v-model="item.blobUrl" @on-change="onInputChange">
 								<Select v-model="item.type" slot="prepend" style="width: 120px">
-									<Option value="normal"><Icon type="ios-link" size="18"/>一般资源</Option>
-									<Option value="video"><Icon type="ios-videocam" size="18"/>影片资源</Option>
+									<Option value="normal"><Icon type="ios-link" size="18"/>{{$t('evaluation.newExercise.normalResource')}}</Option>
+									<Option value="video"><Icon type="ios-videocam" size="18"/>{{$t('evaluation.newExercise.mediaResource')}}</Option>
 								</Select>
 								</Input>
 								<span class="flex-row-center" style="margin-left: 10px;">
@@ -17,12 +17,12 @@
 									<Icon type="md-close" color="#ff0000" size="24" @click="onDeleteLink(item)"/>
 								</span>
 							</div>
-							<p class="error-tip" v-show="!isURL(item.blobUrl)">请输入正确的链接地址 (如:https://www.baidu.com)</p>
+							<p class="error-tip" v-show="!isURL(item.blobUrl)">{{$t('evaluation.newExercise.linkTip')}}</p>
 					</div>
 				</div>
 			</TabPane>
-			<TabPane label="站内资源" tab="repairTab">
-				<Button type="info" @click="isRelatedContent = true">选择内容</Button>
+			<TabPane :label="$t('evaluation.newExercise.innerRepair')" tab="repairTab">
+				<Button type="info" @click="isRelatedContent = true">{{$t('evaluation.newExercise.chooseContent')}}</Button>
 				<div class="repair-link-wrap-item" v-for="(item,index) in datas.filter(i => i.type === 'file')" :key="index">
 						<div class="repair-link-wrap-item-box">
 							<Input v-model="item.blobUrl" @on-change="onInputChange"/>
@@ -31,21 +31,21 @@
 								<Icon type="md-close" color="#ff0000" size="24" @click="onDeleteLink(item)"/>
 							</span>
 						</div>
-						<p class="error-tip" v-show="!isURL(item.blobUrl)">请输入正确的链接地址 (如:https://www.baidu.com)</p>
+						<p class="error-tip" v-show="!isURL(item.blobUrl)">{{$t('evaluation.newExercise.linkTip')}}</p>
 				</div>
 			</TabPane>
 		</Tabs>
 		
 		<!-- 关联内容弹窗 -->
 		<Modal v-model="isRelatedContent" width="880" footer-hide class="relate-modal related-modal">
-		    <div class="modal-header" slot="header">内容关联</div>
+		    <div class="modal-header" slot="header">{{$t('evaluation.newExercise.contentRelate')}}</div>
 		    <NewChooseContent :showSyllabus="isFalse"
 		                   :showOther="isFalse"
 		                   :showQuestion="isFalse"
 						   ref="chooseContentRef"
 		                   @on-file-change="onSelectFile"></NewChooseContent>
 		
-		    <Button class="modal-btn" :loading="isLoading" @click="onConfirmRelate">确认</Button>
+		    <Button class="modal-btn" :loading="isLoading" @click="onConfirmRelate">{{$t('evaluation.confirm')}}</Button>
 		</Modal>
 	</div>
 </template>

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

@@ -50,7 +50,7 @@
 						<span class="exercise-item-point-close">
 							<Icon type="md-close" @click="onDeletePoint(index)" /></span>
 					</span>
-					<span class="exercise-item-point-modify" @click="selectPointsModal = true">修改</span>
+					<span class="exercise-item-point-modify" @click="selectPointsModal = true">{{ $t('evaluation.newExercise.modify') }}</span>
 				</div>
 			</div>
 		</div>
@@ -95,30 +95,29 @@
 
 		<!-- 小题展示区域 -->
 		<div class="child-list-wrap" v-show="exersicesType === 'compose' && childList.length">
-			<IconText :text="'小题列表'" :color="'#00b8ff'" :icon="'md-list'"></IconText>
+			<IconText :text="$t('evaluation.newExercise.childList')" :color="'#00b8ff'" :icon="'md-list'"></IconText>
 			<BaseChildList :childList="childList"></BaseChildList>
 		</div>
 
 		<div class="save-wrap display-flex">
-			<Button type="info" @click="onAddChild" style="margin-right: 10px" v-show="exersicesType === 'compose'">添加小题</Button>
-			<Button type="success" @click="getContent(exersicesType)" :loading="saveLoading">保存</Button>
+			<Button type="info" @click="onAddChild" style="margin-right: 10px" v-show="exersicesType === 'compose'">{{ $t('evaluation.newExercise.addChild')}}</Button>
+			<Button type="success" @click="getContent(exersicesType)" :loading="saveLoading">{{ $t('evaluation.newExercise.save') }}</Button>
 		</div>
 
-		<Button type="text" @click="backToBank" class="btn-back-to-bank" icon="md-arrow-round-back" style="margin-left: 10px">返回题库</Button>
+		<Button type="text" @click="backToBank" class="btn-back-to-bank" icon="md-arrow-round-back" style="margin-left: 10px">{{ $t('evaluation.newExercise.backToBank')}}</Button>
 
 		<Modal v-model="selectPointsModal" :title="$t('evaluation.newExercise.choosePoint')" ref="pointRef" width="600px" class="related-point-modal" style="z-index: 99999">
 			<BasePoints v-if="selectPointsModal" :period="schoolInfo.period[exercisePeriod].id" :subject="subjectList[exerciseSubject].id"
 			 @onCheckChange="onCheckChange" :points="exercisePoints" :scope="curScope"></BasePoints>
-			<!--<CreateNewChild v-if="isLoadModal" ref="newChild" :isChildEdit="isChildEdit" :editItem="editChild"></CreateNewChild>-->
 			<div slot="footer">
-				<Button type="text" @click="selectPointsModal = false">取消</Button>
-				<Button type="primary" @click="selectPointsModal = false">确定</Button>
+				<Button type="text" @click="selectPointsModal = false">{{ $t('evaluation.newExercise.cancel') }}</Button>
+				<Button type="primary" @click="selectPointsModal = false">{{ $t('evaluation.newExercise.addChild') }}</Button>
 			</div>
 		</Modal>
 
 		<!-- 添加小题弹窗 -->
 		<Modal v-model="addComposeChildModal" width="1080" footer-hide class="">
-			<div class="modal-header" slot="header">添加小题</div>
+			<div class="modal-header" slot="header">{{ $t('evaluation.newExercise.addChild') }}</div>
 			<BaseCreateChild @addFinish="onAddChildFinish" ref="createAddChild" v-if="addComposeChildModal" :curPeriodIndex="exercisePeriod"
 			 :curSubjectIndex="exerciseSubject"></BaseCreateChild>
 		</Modal>
@@ -230,12 +229,12 @@
 			onSelectPoints() {
 				if (this.hasSchool) {
 					if(this.exersicesType === 'compose'){
-						this.$Message.warning('综合题的知识点请绑定在小题上!')
+						this.$Message.warning(this.$t('evaluation.newExercise.composeTip'))
 					}else{
 						this.selectPointsModal = true
 					}
 				} else {
-					this.$Message.warning('您当前未加入学校,无法选择知识点!')
+					this.$Message.warning(this.$t('evaluation.newExercise.noSchoolTip'))
 				}
 			},
 
@@ -420,14 +419,14 @@
 								this.saveLoading = false;
 							});
 						} else {
-							this.$Message.error("试题文件上传失败,请稍后重试!");
+							this.$Message.error(this.$t('evaluation.newExercise.uploadErrorTip'));
 						}
 					} catch (e) {
 						this.$Message.error(e.spaceError);
 					}
 				} else {
 					console.log(exerciseItem);
-					this.$Message.warning("请将题目填写完整!");
+					this.$Message.warning(this.$t('evaluation.newExercise.unCompleteTip'));
 					this.saveLoading = false;
 				}
 			},
@@ -467,7 +466,7 @@
 										r(res.itemInfo)
 									});
 								} else {
-									this.$Message.error("试题文件上传失败,请稍后重试!");
+									this.$Message.error(this.$t('evaluation.newExercise.uploadErrorTip'));
 								}
 							} catch (e) {
 								this.$Message.error(e.spaceError);
@@ -547,7 +546,7 @@
 			// 题目类型转换
 			typeChange(val) {
 				if (this.isEdit) {
-					this.$Message.warning("暂不支持更换题型!");
+					this.$Message.warning(this.$t('evaluation.newExercise.typeChangeTip'));
 				} else {
 					this.exersicesType = val;
 					this.childList = [];
@@ -699,8 +698,8 @@
 				next()
 			} else {
 				this.$Modal.confirm({
-					title: '温馨提示',
-					content: '<p>确认放弃保存当前试题并前往?</p>',
+					title: this.$t('evaluation.newExercise.modalTip'),
+					content: this.$t('evaluation.newExercise.unSaveTip'),
 					onOk: () => {
 						next();
 					}

+ 1 - 0
TEAMModelOS/ClientApp/src/view/evaluation/index/TestPaper.vue

@@ -274,6 +274,7 @@
 				this.viewModel = this.viewModel === 'type' ? 'list' : 'type'
 				this.$refs.exList.viewModel = this.viewModel
 				this.$refs.exList.collapseList = []
+				this.$refs.exList.doRenderMathJax()
 				this.$emit('onViewModelChange',this.viewModel)
 			},
 

+ 2 - 2
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseCompletion.vue

@@ -1,13 +1,13 @@
 <template>
 	<div>
 		<div class="exersices-content">
-			<IconText :text="'填空题题干'" :color="'#2d8cf0'" :icon="'ios-create'" style="margin-bottom:15px;"></IconText>
+			<IconText :text="$t('evaluation.complete') + $t('evaluation.newExercise.stem')" :color="'#2d8cf0'" :icon="'ios-create'" style="margin-bottom:15px;"></IconText>
 			<div>
 				<div ref="editor" style="text-align:left"></div>
 			</div>
 		</div>
 		<div class="exersices-option">
-			<IconText :text="'参考答案'" :color="'#FF871C'" :icon="'md-reorder'"></IconText>
+			<IconText :text="$t('evaluation.newExercise.answerTitle')" :color="'#FF871C'" :icon="'md-reorder'"></IconText>
 			<div style="margin-top:15px;">
 				<div ref="answerEditor" style="text-align:left"></div>
 			</div>

+ 1 - 1
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseCompose.vue

@@ -1,7 +1,7 @@
 <template>
 	<div>
 		<div class="exersices-content">
-			<IconText :text="'综合题题干'" :color="'#2d8cf0'" :icon="'ios-create'" style="margin-bottom:15px;"></IconText>
+			<IconText :text="$t('evaluation.compose') + $t('evaluation.newExercise.stem')" :color="'#2d8cf0'" :icon="'ios-create'" style="margin-bottom:15px;"></IconText>
 			<div>
 				<div ref="editor" style="text-align:left"></div>
 			</div>

+ 2 - 2
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseConnector.vue

@@ -1,13 +1,13 @@
 <template>
 	<div>
 		<div class="exersices-content">
-			<IconText :text="'连线题题干'" :color="'#2d8cf0'" :icon="'ios-create'" style="margin-bottom:15px;"></IconText>
+			<IconText :text="$t('evaluation.corrector') + $t('evaluation.newExercise.stem')" :color="'#2d8cf0'" :icon="'ios-create'" style="margin-bottom:15px;"></IconText>
 			<div>
 				<div ref="editor" style="text-align:left"></div>
 			</div>
 		</div>
 		<div class="exersices-option">
-			<IconText :text="'参考答案'" :color="'#FF871C'" :icon="'md-reorder'"></IconText>
+			<IconText :text="$t('evaluation.newExercise.answerTitle')" :color="'#FF871C'" :icon="'md-reorder'"></IconText>
 			<div style="margin-top:15px;">
 				<div ref="answerEditor" style="text-align:left"></div>
 			</div>

+ 2 - 2
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseCorrect.vue

@@ -1,13 +1,13 @@
 <template>
 	<div>
 		<div class="exersices-content">
-			<IconText :text="'改错题题干'" :color="'#2d8cf0'" :icon="'ios-create'" style="margin-bottom:15px;"></IconText>
+			<IconText :text="$t('evaluation.correct') + $t('evaluation.newExercise.stem')" :color="'#2d8cf0'" :icon="'ios-create'" style="margin-bottom:15px;"></IconText>
 			<div>
 				<div ref="editor" style="text-align:left"></div>
 			</div>
 		</div>
 		<div class="exersices-option">
-			<IconText :text="'参考答案'" :color="'#FF871C'" :icon="'md-reorder'"></IconText>
+			<IconText :text="$t('evaluation.newExercise.answerTitle')" :color="'#FF871C'" :icon="'md-reorder'"></IconText>
 			<div style="margin-top:15px;">
 				<div ref="answerEditor" style="text-align:left"></div>
 			</div>

+ 4 - 4
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseJudge.vue

@@ -1,16 +1,16 @@
 <template>
 	<div>
 		<div class="exersices-content">
-			<IconText :text="'判断题题干'" :color="'#2d8cf0'" :icon="'ios-create'" style="margin-bottom:15px;"></IconText>
+			<IconText :text="$t('evaluation.judge') + $t('evaluation.newExercise.stem')" :color="'#2d8cf0'" :icon="'ios-create'" style="margin-bottom:15px;"></IconText>
 			<div>
 				<div ref="editor" style="text-align:left"></div>
 			</div>
 		</div>
 		<div class="exersices-option">
-			<IconText :text="'选项'" :color="'#FF871C'" :icon="'md-reorder'"></IconText>
+			<IconText :text="$t('evaluation.newExercise.option')" :color="'#FF871C'" :icon="'md-reorder'"></IconText>
 			<RadioGroup v-model="trueAnswer" type="button" size="large">
-				<Radio label="A">正确</Radio>
-				<Radio label="B">错误</Radio>
+				<Radio label="A">{{$t('evaluation.isTrue')}}</Radio>
+				<Radio label="B">{{$t('evaluation.isFalse')}}</Radio>
 			</RadioGroup>
 		</div>
 	</div>

+ 4 - 4
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseMultiple.vue

@@ -1,21 +1,21 @@
 <template>
 	<div>
 		<div class="exersices-content">
-			<IconText :text="'多选题题干'" :color="'#2d8cf0'" :icon="'ios-create'" style="margin-bottom:15px;"></IconText>
+			<IconText :text="$t('evaluation.multiple') + $t('evaluation.newExercise.stem')" :color="'#2d8cf0'" :icon="'ios-create'" style="margin-bottom:15px;"></IconText>
 			<div>
 				<div ref="singleEditor" style="text-align:left"></div>
 			</div>
 		</div>
 		<div class="exersices-option" ref="optionRefs">
-			<IconText :text="'多选选项'" :color="'#FF871C'" :icon="'md-reorder'"></IconText>
+			<IconText :text="$t('evaluation.newExercise.multipleOption')" :color="'#FF871C'" :icon="'md-reorder'"></IconText>
 			<div v-for="(item,index) in options" :key="index" :ref="'optionBox' + index" :class="'editor-wrap-'+item" style="margin-top:10px;display:flex">
 				<span class="fl-center option-delete" @click="deleteOption(index,item)"><Icon type="md-remove-circle" /></span>
 				<span class="fl-center option-order" :ref="'optionOrder' + index" :data-index="index">{{ renderIndex(index) }}</span>
 				<div :ref="'singleOption'+index" style="text-align:left" class="option-editor" @click="optionClick(item)"></div>
-				<span :class="['fl-center', 'option-setting', trueArr.indexOf(index) > -1 ? 'option-true':'']" @click="settingAnswer(index)">{{ trueArr.indexOf(index) > -1  ? '正确答案' :'设为答案' }}</span>
+				<span :class="['fl-center', 'option-setting', trueArr.indexOf(index) > -1 ? 'option-true':'']" @click="settingAnswer(index)">{{ trueArr.indexOf(index) > -1  ? $t('evaluation.newExercise.trueAnswer') :$t('evaluation.newExercise.setAnswer') }}</span>
 
 			</div>
-			<p class="option-add"><span @click="addOption()">+ 添加选项 </span><span style="color:rgb(60,196,82);margin-left:15px;font-weight:bold">正确答案:{{ multipleAnswers.join('') }}</span></p>
+			<p class="option-add"><span @click="addOption()">+ {{$t('evaluation.newExercise.addOption')}} </span><span style="color:rgb(60,196,82);margin-left:15px;font-weight:bold">{{$t('evaluation.newExercise.trueAnswer')}}:{{ multipleAnswers.join('') }}</span></p>
 		</div>
 	</div>
 </template>

+ 4 - 4
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseSingle.vue

@@ -1,23 +1,23 @@
 <template>
 	<div>
 		<div class="exersices-content">
-			<IconText :text="'单选题题干'" :color="'#2d8cf0'" :icon="'ios-create'" style="margin-bottom:15px;"></IconText>
+			<IconText :text="$t('evaluation.single') + $t('evaluation.newExercise.stem')" :color="'#2d8cf0'" :icon="'ios-create'" style="margin-bottom:15px;"></IconText>
 			<div>
 				<div ref="singleEditor" style="text-align:left"></div>
 			</div>
 		</div>
 		<div class="exersices-option" ref="optionRefs">
-			<IconText :text="'单选选项'" :color="'#FF871C'" :icon="'md-reorder'"></IconText>
+			<IconText :text="$t('evaluation.newExercise.singleOption')" :color="'#FF871C'" :icon="'md-reorder'"></IconText>
 			<div v-for="(item,index) in options" :key="index" :ref="'optionBox' + index" :class="'editor-wrap-'+item" style="margin-top:10px;display:flex">
 				<span class="fl-center option-delete" @click="deleteOption(index,item)">
 					<Icon type="md-remove-circle" /></span>
 				<span class="fl-center option-order" :ref="'optionOrder' + index" :data-index="index">{{ renderIndex(index) }}</span>
 				<!-- <span class="fl-center option-order">{{String.fromCharCode(64 + parseInt(index+1))}}</span> -->
 				<div :ref="'singleOption'+index" style="text-align:left" class="option-editor" @click="optionClick(item)"></div>
-				<span :class="['fl-center', 'option-setting', optionTrueIndex === index ? 'option-true':'']" @click="settingAnswer(index)">{{ optionTrueIndex === index ? '正确答案' :'设为答案' }}</span>
+				<span :class="['fl-center', 'option-setting', optionTrueIndex === index ? 'option-true':'']" @click="settingAnswer(index)">{{ optionTrueIndex === index ? $t('evaluation.newExercise.trueAnswer') :$t('evaluation.newExercise.setAnswer') }}</span>
 
 			</div>
-			<p class="option-add"><span @click="addOption()">+ 添加选项 </span><span style="color:rgb(60,196,82);margin-left:15px;font-weight:bold">正确答案:{{ renderIndex(trueIndex) }}</span></p>
+			<p class="option-add"><span @click="addOption()">+ {{$t('evaluation.newExercise.addOption')}} </span><span style="color:rgb(60,196,82);margin-left:15px;font-weight:bold">{{ $t('evaluation.newExercise.trueAnswer') }}:{{ renderIndex(trueIndex) }}</span></p>
 		</div>
 	</div>
 </template>

+ 2 - 2
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseSubjective.vue

@@ -1,13 +1,13 @@
 <template>
 	<div>
 		<div class="exersices-content">
-			<IconText :text="'问答题题干'" :color="'#2d8cf0'" :icon="'ios-create'" style="margin-bottom:15px;"></IconText>
+			<IconText :text="$t('evaluation.subjective') + $t('evaluation.newExercise.stem')" :color="'#2d8cf0'" :icon="'ios-create'" style="margin-bottom:15px;"></IconText>
 			<div>
 				<div ref="editor" style="text-align:left"></div>
 			</div>
 		</div>
 		<div class="exersices-option">
-			<IconText :text="'参考答案'" :color="'#FF871C'" :icon="'md-reorder'"></IconText>
+			<IconText :text="$t('evaluation.newExercise.answerTitle')" :color="'#FF871C'" :icon="'md-reorder'"></IconText>
 			<div style="margin-top:15px;">
 				<div ref="answerEditor" style="text-align:left"></div>
 			</div>

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

@@ -171,7 +171,7 @@
 						name:classItem.className,
 						entryNum:classItem.lineCount,
 						totalNum:classItem.stuCount,
-						overAverageRate:((classItem.lineCount / classItem.stuCount) * 100).toFixed(2),
+						overAverageRate:classItem.stuCount > 0 ? ((classItem.lineCount / classItem.stuCount) * 100).toFixed(2) : 0.00,
 					})
 				})
 				let rateRanks = result.sort((a, b) => { return Number(a.overAverageRate) - Number(b.overAverageRate) })

+ 2 - 2
TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/KnowledgeAnalysis/KnowledgeAnalysis.vue

@@ -71,7 +71,7 @@
                         key: 'gradeRate',
                         sortable: true,
                         renderType: function(h, params) {
-                            return h('span', (Number(params.row.gradeRate) * 100).toFixed(2) + '%')
+                            return h('span', (Number(params.row.gradeRate)).toFixed(2) + '%')
                         },
                         width: 150
                     }
@@ -92,7 +92,7 @@
 				        sortable: 'custom',
 				        key: item.className,
 				        render: (h, params) => {
-				            return h('span', ((Number(origin[params.row.name][index])) * 100).toFixed(2) + '%')
+				            return h('span', ((Number(origin[params.row.name][index]))).toFixed(2) + '%')
 				        },
 				        minWidth: 150
 				    }

+ 4 - 4
TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/LevelAnalysis/LevelAnalysis.vue

@@ -56,7 +56,7 @@
                         key: 'gradeRate',
                         sortable: true,
                         renderType: function(h, params) {
-                            return h('span', (Number(params.row.gradeRate) * 100).toFixed(2) + '%')
+                            return h('span', (Number(params.row.gradeRate)).toFixed(2) + '%')
                         },
                         width: 150
                     }
@@ -76,7 +76,7 @@
             	        sortable: 'custom',
             	        key: item.className,
             	        render: (h, params) => {
-            	            return h('span', ((Number(origin[params.row.name][index])) * 100).toFixed(2) + '%')
+            	            return h('span', ((Number(origin[params.row.name][index]))).toFixed(2) + '%')
             	        },
             	        minWidth: 150
             	    }
@@ -108,7 +108,6 @@
         },
         mounted() {
             if (this.getLevelData) {
-				console.log(this.getLevelData)
                 this.doRender(this.getLevelData)
             }
         },
@@ -121,9 +120,10 @@
 				let transArr = ["知识", "理解", "应用", "分析", "综合", "评鉴"]
 				levelJson.pointList = levelJson.pointList.map((i,index) => transArr[index])
 				for(let key in levelJson.classpercent){
-					if(key !== 'className'){
+					if(!isNaN(key)){
 						let newKey = transArr[+key - 1]
 						levelJson.classpercent[newKey] = levelJson.classpercent[key]
+						levelJson.stupercent[newKey] = levelJson.stupercent[key]
 					}
 				}
 				return levelJson

+ 7 - 2
TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/LevelAnalysis/ScoreDetails.vue

@@ -78,7 +78,7 @@
                         title: this.$t('totalAnalysis.ka_table_text8'),
                         key: 'persent',
                         renderType: function(h, params) {
-                            return h('span', (Number(params.row.persent) * 100).toFixed(0) + '%')
+                            return h('span', (Number(params.row.persent)).toFixed(2) + '%')
                         },
                         sortable: 'custom',
                         minWidth: 100
@@ -175,6 +175,10 @@
                 let origin = data.wrong
                 let keys = origin.keys
                 let datas = origin.datas
+				console.log(datas)
+				datas.forEach((i,index) => {
+					i[0] = this.transArr[index]
+				})
                 this.numData = this.$tools.jsonTransform({ datas: datas, keys: keys })
             }
 
@@ -195,9 +199,10 @@
                 let transArr = ["知识", "理解", "应用", "分析", "综合", "评鉴"]
                 levelJson.pointList = levelJson.pointList.map((i,index) => transArr[index])
                 for(let key in levelJson.classpercent){
-                	if(key !== 'className'){
+                	if(!isNaN(key)){
                 		let newKey = transArr[+key - 1]
                 		levelJson.classpercent[newKey] = levelJson.classpercent[key]
+                		levelJson.stupercent[newKey] = levelJson.stupercent[key]
                 	}
                 }
                 return levelJson

+ 1 - 0
TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/index.vue

@@ -223,6 +223,7 @@
 			
 			// 查看更多评测列表
 			goEvaluationList() {
+				this.$store.commit('clearAnalysis',null)
 				this.$router.push({
 					name: 'totalIndex',
 					params: {

+ 488 - 247
TEAMModelOS/Controllers/Analysis/AnalysisController.cs

@@ -91,11 +91,44 @@ namespace TEAMModelOS.Controllers.Analysis
                 "knowledge",
                 "examScoreRate"
             };
+            List<string> knowkey = new List<string>
+            {
+                "id",
+                "className",
+                "seatNO",
+                "point",
+                "anwPoint",
+                "persent"
+            };
+            List<string> keynowWrong = new List<string>
+            {
+                "name",
+                "point",
+                "itemNO",
+                "persent",
+                "wrong",
+                "rhw",
+                "rlw"
+            };
             ExamInfo info = null;
             double ipoint = 0;          
             List<KeyValuePair<string, List<List<string>>>> subjectPaperDatas = new List<KeyValuePair<string, List<List<string>>>>();
             List<Dictionary<string, object>> valuePairs = new List<Dictionary<string, object>>();            
             List<KeyValuePair<string, List<KeyValuePair<string, List<double>>>>> classSubjectPaperDatas = new List<KeyValuePair<string, List<KeyValuePair<string, List<double>>>>>();
+            List<KeyValuePair<string, List<string>>> knowNameDatas = new List<KeyValuePair<string, List<string>>>();
+            List<KeyValuePair<string, List<string>>> knowPerDatas = new List<KeyValuePair<string, List<string>>>();
+            List<KeyValuePair<string, List<double>>> knowAllPerDatas = new List<KeyValuePair<string, List<double>>>();
+            List<KeyValuePair<string, List<double>>> knowScoreDatas = new List<KeyValuePair<string, List<double>>>();
+            List<KeyValuePair<string, List<List<string>>>> wrongDatas = new List<KeyValuePair<string, List<List<string>>>>();
+            List<KeyValuePair<string, List<KeyValuePair<string,  List<double> >>>> stuPerDatas = new List<KeyValuePair<string, List<KeyValuePair<string,  List<double >>>>>();
+            //声明认知层次变量
+            List<KeyValuePair<string, List<int>>> fieldNameDatas = new List<KeyValuePair<string, List<int>>>();
+            List<KeyValuePair<string, List<string>>> fieldPerDatas = new List<KeyValuePair<string, List<string>>>();
+            List<KeyValuePair<string, List<double>>> fieldAllPerDatas = new List<KeyValuePair<string, List<double>>>();
+            List<KeyValuePair<string, List<double>>> fieldScoreDatas = new List<KeyValuePair<string, List<double>>>();
+            List<KeyValuePair<string, List<List<string>>>> fieldwrongDatas = new List<KeyValuePair<string, List<List<string>>>>();
+            List<KeyValuePair<string, List<KeyValuePair<string, List<double>>>>> fieldStuPerDatas = new List<KeyValuePair<string, List<KeyValuePair<string, List<double>>>>>();
+
             //获取进线标准以及踩线分数
             int touch = 0;
             int income = 0;
@@ -177,6 +210,8 @@ namespace TEAMModelOS.Controllers.Analysis
                 foreach (ExamResult examResult in examResults)
                 {
                     (KeyValuePair<string, List<List<string>>> subjectData, KeyValuePair<string, List<KeyValuePair<string, List<double>>>> classSubjectData , Dictionary<string, List<double>> gscore) =DoExerciseScatteres(examResult, paperKey);
+                    (KeyValuePair<string, List<string>> knowName , KeyValuePair<string, List<string>> knowPer, KeyValuePair<string, List<double>> knowAllPer, KeyValuePair<string, List<double>> kScore, KeyValuePair<string, List<List<string>>> wrong, KeyValuePair<string, List<KeyValuePair<string,  List<double>>>> stuPer)  = DoKnowledgePoint(examResult, info, keynowWrong);
+                    (KeyValuePair<string, List<int>> fieldName, KeyValuePair<string, List<string>> fieldPer, KeyValuePair<string, List<double>> fieldAllPer, KeyValuePair<string, List<double>> fScore, KeyValuePair<string, List<List<string>>> fieldWrong, KeyValuePair<string, List<KeyValuePair<string, List<double>>>> fieldStuPer) = DoLevel(examResult, info, keynowWrong);
                     gscores.Add(new KeyValuePair<string, Dictionary<string, List<double>>>(examResult.subjectId, gscore));
 /*                    Dictionary<string, dynamic> gpoint = new Dictionary<string, dynamic>();
                     Dictionary<string, dynamic> glevel = new Dictionary<string, dynamic>();*/
@@ -184,9 +219,22 @@ namespace TEAMModelOS.Controllers.Analysis
                     subjectPaperDatas.Add(subjectData);
                     classSubjectPaperDatas.Add(classSubjectData);
                     subjectScatter.Add(DoSubjectScatter(examResult));
-                    gpointList.Add("subjectId", examResult.subjectId);
-                    gpointList.Add("pointKey", DoKnowledgePoint(examResult, info));
-                    gpointList.Add("levelKey", DoLevel(examResult, info));
+                    knowNameDatas.Add(knowName);
+                    knowPerDatas.Add(knowPer);
+                    knowAllPerDatas.Add(knowAllPer);
+                    knowScoreDatas.Add(kScore);
+                    wrongDatas.Add(wrong);
+                    stuPerDatas.Add(stuPer);
+
+                    fieldNameDatas.Add(fieldName);
+                    fieldPerDatas.Add(fieldPer);
+                    fieldAllPerDatas.Add(fieldAllPer);
+                    fieldScoreDatas.Add(fScore);
+                    fieldwrongDatas.Add(fieldWrong);
+                    fieldStuPerDatas.Add(fieldStuPer);
+                    //gpointList.Add("subjectId", examResult.subjectId);
+                    //gpointList.Add("pointKey", DoKnowledgePoint(examResult, info));
+                    //gpointList.Add("levelKey", DoLevel(examResult, info));
                     valuePairs.Add(gpointList);
                     //获取一张试卷的满分
                     paperScore.Add(examResult.subjectId, examResult.paper.point.Sum());
@@ -224,7 +272,9 @@ namespace TEAMModelOS.Controllers.Analysis
                             StudentSubject subject = new StudentSubject
                             {
                                 id = examResult.subjectId,
-                                name = info.subjects.Where(x => x.id == examResult.subjectId).FirstOrDefault().name
+                                name = info.subjects.Where(x => x.id == examResult.subjectId).FirstOrDefault().name,
+                                point = stuPerDatas.Where(x => x.Key == examResult.subjectId).SelectMany(va=>va.Value).Where(stu=>stu.Key==stuid).Select(pi => pi.Value).First(),
+                                fieldPoint = fieldStuPerDatas.Where(x => x.Key == examResult.subjectId).SelectMany(va => va.Value).Where(stu => stu.Key == stuid).Select(pi => pi.Value).First()
                             };
                             subject.score = score;
                             student.subjects.Add(subject);
@@ -273,10 +323,22 @@ namespace TEAMModelOS.Controllers.Analysis
                     //计算标准差
                     //总平均分
                     double totalAverage = 0;
-                    totalAverage = classTotal / stuCount;
+                    totalAverage =  stuCount > 0 ? classTotal*1.0 / stuCount : 0;
+                    //totalAverage = classTotal / stuCount;
                     //获取整个班级 科目的分数情况
                     List<KeyValuePair<string, double>> keyValues = new List<KeyValuePair<string, double>>();
                     List<string> studentIds = new List<string>();
+                    List<KeyValuePair<string, List<double>>> pointClassTotal = new List<KeyValuePair<string, List<double>>>();
+                    List<KeyValuePair<string, List<double>>> fieldClassTotal = new List<KeyValuePair<string, List<double>>>();
+                    subjectTotal.Keys.ToList().ForEach(sub => {
+                        var points = new List<double>();
+                        var fields = new List<double>();
+                        knowNameDatas.Where(su => su.Key == sub).First().Value.ForEach(x => { points.Add(0); });
+                        fieldNameDatas.Where(su => su.Key == sub).First().Value.ForEach(x => { fields.Add(0); });
+                        pointClassTotal.Add(new KeyValuePair<string, List<double>>(sub, points));
+                        fieldClassTotal.Add(new KeyValuePair<string, List<double>>(sub, fields));
+
+                    });
                     classStudents.ForEach(x => {
                         studentIds.Add(x.id);
                         x.classId = classId;
@@ -293,22 +355,37 @@ namespace TEAMModelOS.Controllers.Analysis
                         }
                         //班级全科的pr
                         int index = stuTotals.IndexOf(x.total);
-                        double CPR = 100 - (100 * (index + 1) - 50) / stuCount;
+                        double CPR = stuCount > 0 ? 100 - (100 * (index + 1) - 50) / stuCount : 0;
+                        //double CPR = 100 - (100 * (index + 1) - 50) / stuCount;
                         x.cpr = CPR;
                         x.csort = index + 1;
                         //班级单科的pr
                         x.subjects.ForEach(y=> {
+                            //y.point
+                           
                             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);
-                            double CPR = 100 - (100 * (index + 1) - 50) / stuCount;
+                            double CPR  = stuCount > 0 ? 100 - (100 * (index + 1) - 50) / stuCount : 0;
+                            //double CPR = 100 - (100 * (index + 1) - 50) / stuCount;
                             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));
+                            var pintTalt= pointClassTotal.Where(su => su.Key == y.id).Select(pint=> pint.Value).First();
+                            for (int i = 0; i < y.point.Count; i++) {
+                                 pintTalt[i] = pintTalt[i] + y.point[i];
+                            }
+                            var fieldTalt = fieldClassTotal.Where(su => su.Key == y.id).Select(pint => pint.Value).First();
+                            for (int i = 0; i < y.fieldPoint.Count; i++)
+                            {
+                                fieldTalt[i] = fieldTalt[i] + y.fieldPoint[i];
+                            }
+
                         });
-                    });                   
-                    var pow = Math.Pow(powSum / stuCount, 0.5);
+                    });
+                    var pow = stuCount > 0 ? Math.Pow(powSum / stuCount, 0.5) : 0;
+                    //var pow = Math.Pow(powSum / stuCount, 0.5);
                     ClassAys classAys = new ClassAys
                     {
                         gradeId = classroom.gradeId,
@@ -330,9 +407,24 @@ namespace TEAMModelOS.Controllers.Analysis
                                 passCount += 1;
                             }
                         });
-                        double passPercent = Math.Round(passCount * 1.0 / stuCount,2) ;
-                        double average = Math.Round(subScore.Sum() * 1.0 / stuCount,2) ;
-                        classAys.subjects.Add(new AysSubject { 
+                        double passPercent = stuCount > 0 ? Math.Round(passCount * 1.0 / stuCount, 2) : 0;
+                        //double passPercent = Math.Round(passCount * 1.0 / stuCount,2) ;
+                        double average = stuCount > 0 ? Math.Round(subScore.Sum() * 1.0 / stuCount, 2) : 0;
+                        //double average = Math.Round(subScore.Sum() * 1.0 / stuCount,2) ;
+                        List<double> tt = new List<double>();
+                        List<double> fieldPoints = new List<double>();
+                        var pp = pointClassTotal.Where(su => su.Key == key).Select(pint => pint.Value).First();
+                        pp.ForEach(s => {
+
+                            tt.Add(stuCount > 0 ? Math.Round(s* 1.0 / stuCount, 2) : 0) ;
+                        });
+                        var ff = fieldClassTotal.Where(su => su.Key == key).Select(pint => pint.Value).First();
+                        ff.ForEach(s => {
+                            fieldPoints.Add(stuCount > 0 ? Math.Round(s * 1.0 / stuCount, 2) : 0);
+                        });
+                        classAys.subjects.Add(new AysSubject {
+                            point = tt,
+                            field = fieldPoints,
                             id = key, 
                             passPercent= passPercent, 
                             passCount= passCount, 
@@ -365,7 +457,8 @@ namespace TEAMModelOS.Controllers.Analysis
                         var AysSubject = clases.SelectMany(c=>c.subjects).Where(x => x.id.Equals(key)).Select(x => x).ToList();
                         var passCount= AysSubject.Select(x => x.passCount).Sum();
                         var average =Math.Round(AysSubject.Select(x => x.average).Sum() * 1.0 / classCount);
-                        var passPercent = Math.Round(passCount * 1.0 / stu.Count,2);
+                        var passPercent = stu.Count > 0 ? Math.Round(passCount * 1.0 / stu.Count, 2) : 0;
+                        //var passPercent = Math.Round(passCount * 1.0 / stu.Count,2);
                         AysSubject subject = new AysSubject  { 
                             id=key,
                             passCount= passCount, 
@@ -385,7 +478,8 @@ namespace TEAMModelOS.Controllers.Analysis
                     studentAys.ForEach(x => {
                         //年级全科的pr
                         int index = stuGradeTotal.IndexOf(x.total);
-                        double GPR = 100 - (100 * (index + 1) - 50) / stuCount;
+                        double GPR = stuCount > 0 ? 100 - (100 * (index + 1) - 50) / stuCount : 0;
+                       //double GPR = 100 - (100 * (index + 1) - 50) / stuCount;
                         x.gpr = GPR;
                         x.gsort = index + 1;
                         //年级单科的pr
@@ -393,7 +487,8 @@ namespace TEAMModelOS.Controllers.Analysis
                             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;
+                            double GPR = stuCount > 0 ? 100 - (100 * (index + 1) - 50) / stuCount : 0;
+                            //double GPR = 100 - (100 * (index + 1) - 50) / stuCount;
                             y.gpr = GPR;
                             y.gsort = index + 1;
                         });
@@ -413,11 +508,34 @@ namespace TEAMModelOS.Controllers.Analysis
                     });
                 });
             }
-            catch (Exception ex) { 
-            
+            catch (Exception ex) {
+                BadRequest(ex.StackTrace);
             }
             var sub = info.subjects.Select(x => new { id = x.id, name = x.name });
-            return Ok(new { students, classes, grades , paper= subjectPaperDatas, subjects=sub, scatterKey = scatterKey,paperKey=paperKey, pointLevelKey = valuePairs, ipoint = ipoint,touchScore = touch});
+            return Ok(new { students,
+                classes,
+                grades,
+                paper = subjectPaperDatas,
+                subjects = sub,
+                scatterKey = scatterKey,
+                paperKey = paperKey,
+                pointLevelKey = valuePairs,
+                ipoint = ipoint,
+                touchScore = touch,
+                knowKey = knowkey,
+                wrongKey = keynowWrong,
+                wrong = wrongDatas,
+                knowName = knowNameDatas,
+                knowPer = knowPerDatas,
+                knowAllper = knowAllPerDatas,
+                fieldwrong = fieldwrongDatas,
+                fieldName = fieldNameDatas,
+                fieldPer = fieldPerDatas,
+                fieldAllPer = fieldAllPerDatas,
+                kScores = knowScoreDatas,
+                fScores = fieldScoreDatas
+
+            });
         }
 
         private static (KeyValuePair<string,List<List<string>>>, KeyValuePair<string, List<KeyValuePair<string, List<double>>>>,   Dictionary<string, List<double>>) DoExerciseScatteres(ExamResult e,  List<string > paperKey) 
@@ -479,7 +597,8 @@ namespace TEAMModelOS.Controllers.Analysis
                     }
                     foreach (int p in answerCount)
                     {
-                        var t = Math.Round(p * 1.0 / peopleCount * 100,2);
+                        var t = peopleCount > 0 ? Math.Round(p * 1.0 / peopleCount * 100, 2) : 0;
+                        //var t = Math.Round(p * 1.0 / peopleCount * 100,2);
                         persent.Add(t);
                     }
                     classdatas.Add(new KeyValuePair<string, List<double>>(c.id, persent));
@@ -523,7 +642,8 @@ namespace TEAMModelOS.Controllers.Analysis
                 }
                 foreach (int p in examAnswer)
                 {
-                    var t = Math.Round(p * 1.0 / Qnum * 100,2);
+                    var t = Qnum > 0 ? Math.Round(p * 1.0 / Qnum * 100, 2) : 0;
+                    //var t = Math.Round(p * 1.0 / Qnum * 100,2);
                     examPersent.Add(t.ToString());
                 }
                 for (int k = 0; k < e.paper.point.Count; k++)
@@ -711,7 +831,7 @@ namespace TEAMModelOS.Controllers.Analysis
             }
             return default;
         }
-        private Dictionary<string, dynamic> DoKnowledgePoint(ExamResult exam, ExamInfo info)
+        private static (KeyValuePair<string, List<string>>, KeyValuePair<string, List<string>> , KeyValuePair<string, List<double>>, KeyValuePair<string, List<double>>, KeyValuePair<string, List<List<string>>>, KeyValuePair<string, List<KeyValuePair<string,  List<double >>>>) DoKnowledgePoint(ExamResult exam, ExamInfo info,List<string> keynowWrong)
         {
             HashSet<string> knowledge = new HashSet<string>();
             HashSet<string> area = new HashSet<string>();
@@ -720,36 +840,15 @@ namespace TEAMModelOS.Controllers.Analysis
             List<ClassRange> classes = new List<ClassRange>();
             List<string> ids = new List<string>();
 
+            List < KeyValuePair<string, List<double> > >datas = new List<KeyValuePair<string, List<double >>>();
             //求单个知识点所占分数
             List<string> per = new List<string>();
             List<string> gper = new List<string>();
             List<string> knowPer = new List<string>();
-            List<Dictionary<string, double>> eper = new List<Dictionary<string, double>>();
-            Dictionary<string, object> knowledgeALL = new Dictionary<string, object>();
-            Dictionary<string, object> knowledgeMap = new Dictionary<string, object>();
-            Dictionary<string, object> classMap = new Dictionary<string, object>();
+
             Dictionary<string, object> wrongMap = new Dictionary<string, object>();
-            HashSet<string> className = new HashSet<string>();
             List<List<string>> wrongPersent = new List<List<string>>();
-            List<string> key = new List<string>
-            {
-                "id",
-                "className",
-                "seatNO",
-                "point",
-                "anwPoint",
-                "persent"
-            };
-            List<string> keyWrong = new List<string>
-            {
-                "name",
-                "point",
-                "itemNO",
-                "persent",
-                "wrong",
-                "rhw",
-                "rlw"
-            };
+            
             //定位试卷信息
             int index = 0;
                 foreach (ExamSubject subject in info.subjects)
@@ -774,7 +873,7 @@ namespace TEAMModelOS.Controllers.Analysis
                 });
             }
             else {
-                return knowledgeALL;
+                return (default, default, default,default, default,default);
             }
             if (info.papers[index].field != null && info.papers[index].field.Count > 0)
             {
@@ -784,7 +883,7 @@ namespace TEAMModelOS.Controllers.Analysis
                 });
             }
             else {
-                return knowledgeALL;
+                return (default, default, default, default, default, default);
             }
                 
                 double Qnum = 0;
@@ -847,13 +946,13 @@ namespace TEAMModelOS.Controllers.Analysis
                 {
                     total += grade.Sum();
                 }
-                foreach (string id in ids)
+               /* foreach (string id in ids)
                 {
                     if (!id.Equals("0"))
                     {
                         Qnum++;
                     }
-                }
+                }*/
                 //试卷总分
                 double TotalPoint = point.Sum();
                 //计算认知层次占比
@@ -877,33 +976,61 @@ namespace TEAMModelOS.Controllers.Analysis
                     double fieldPersent = fieldPoint / TotalPoint;
                     fper.Add(fieldPersent.ToString("0.00"));
                 }
-               
-                for (int k = 0; k < knowledgeName.Count; k++)
-                {
-                    List<string> knowledgeClass = new List<string>();
-                    List<List<string>> stuPersent = new List<List<string>>();
+            List<double> knowScore = new List<double>();
+            //得分率
+            List<double> Score = new List<double>();
+            //分值
+            List<double> kScore = new List<double>();
+            for (int k = 0; k < knowledgeName.Count; k++)
+                {                  
                     double OnePoint = 0;
-                    //获取每个知识点占有多少分值
-                    double ePoint = 0;
-                    double anwGPoint = 0;
-                    double poG = 0;
-                    int m = 0;
                     List<string> valuew = new List<string>();
                     List<string> itemNo = new List<string>();
-                    keyWrong.ForEach(x =>
-                    {
-                        valuew.Add("-");
-                    });
-                    int wrongCount = 0;
-                    valuew[0] = knowledgeName[k];
-                    int n = 0;
-                    info.papers[index].knowledge.ForEach(kno =>
+                keynowWrong.ForEach(x =>
+                {
+                    valuew.Add("-");
+                });
+                valuew[0] = knowledgeName[k];
+                int n = 0;
+                int wrong = 0;
+                int rhwC = 0;
+                int rhlC = 0;
+                int scoreCount = 0;
+                //所有学生该知识点得分
+                double anwGPoint = 0;
+                //知识点分值
+                double gPoint = 0;
+                info.papers[index].knowledge.ForEach(kno =>
                     {
                         if (kno.Contains(knowledgeName[k]))
                         {
                             OnePoint += point[n];
                             itemNo.Add((n + 1).ToString());
-
+                            //处理单个知识点错题人数
+                            foreach (string id in exam.studentIds) {
+                                int index = exam.studentIds.IndexOf(id);
+                                if (exam.studentScores[index][n] == 0)
+                                {
+                                    wrong++;
+                                    if (exam.studentScores[index].Sum() >= rhw)
+                                    {
+                                        rhwC++;
+                                        continue;
+                                    }
+                                    if (exam.studentScores[index].Sum() <= rhl)
+                                    {
+                                        rhlC++;
+                                        continue;
+                                    }
+                                    continue;
+                                }
+                                else
+                                {
+                                    scoreCount++;
+                                }
+                                anwGPoint += exam.studentScores[index][n];
+                            }
+                            gPoint += point[n];
                         }
                         valuew[1] = OnePoint.ToString();
                         string itemNos = "";
@@ -920,159 +1047,63 @@ namespace TEAMModelOS.Controllers.Analysis
                             valuew[2] = itemNos;
                         }
                         n++;
-                    });
-
-
-
-                    int rhwC = 0;
-                    int rhlC = 0;
-                    foreach (string id in ids)
-                    {
-                        if (id.Equals("0") || result[m].Sum() == 0)
-                        {
-                            m++;
-                            continue;
-                        }
-                        List<string> values = new List<string>();
-                        key.ForEach(x =>
-                        {
-                            values.Add("-");
-                        });
-                        /*                        foreach (OldStudent info in students)
-                                                {
-                                                    if (info.studentId.Equals(id))
-                                                    {
-                                                        values[2] = info.seatNo.ToString();
-                                                        break;
-                                                    }
-                                                }*/
-                        //List<string> stu = new List<string>();
-                        values[0] = id;
-                        values[1] = "-";
-                        //List<List<string>> stuItem = new List<List<string>>();
-                        int statuCount = 0;
-                        info.papers[index].knowledge.ForEach(kno => {
-                            int sno = 0;
-                            double anwPoint = 0;
-                            double po = 0;
-                            if (kno.Contains(knowledgeName[k]))
-                            {
-                                //当前认知层次在该题占比多少
-                                ePoint = 1;
-                                anwPoint += result[m][sno] * ePoint;
-                                //所有学生单个认知层次得分情况
-                                anwGPoint += result[m][sno] * ePoint;
-                                po += point[sno] * ePoint;
-                                //认知层次所占分数
-                                poG += point[sno] * ePoint;
-                                if (result[m][sno] == 0 && statuCount == 0)
-                                {
-                                    statuCount++;
-                                    wrongCount++;
-                                    if (result[m].Sum() >= rhw)
-                                    {
-                                        rhwC++;
-                                    }
-                                    if (result[m].Sum() <= rhl)
-                                    {
-                                        rhlC++;
-                                    }
-                                }
-                                if (po == 0)
-                                {
-                                    values[3] = "0";
-                                    values[4] = "0";
-                                    values[5] = "0";
-                                }
-                                else
-                                {
-                                    double stuPser = anwPoint / po;
-                                    values[3] = po.ToString();
-                                    values[4] = anwPoint.ToString();
-                                    values[5] = stuPser.ToString("0.00");
-                                }
-                            }
-                        });
-                        stuPersent.Add(values);
-                        m++;
-                    }
-                    //AchievementService.ReName(stuPersent, ids, classes, students);
-                    double knowPser = 0;
-                    if (poG == 0)
-                    {
-                        knowPer.Add("0");
-                    }
-                    else
-                    {
-                        knowPser = anwGPoint / poG;
-                        knowPer.Add(knowPser.ToString("0.00"));
-                    }
-
+                 });
+                kScore.Add(gPoint);
+                Score.Add(anwGPoint);
+                knowScore.Add(OnePoint);                                 
                     //错题关系表
-                    valuew[3] = knowPser.ToString("0.00");
-                    valuew[4] = wrongCount.ToString();
+                    valuew[3] = (exam.studentIds.Count > 0 ? Math.Round(scoreCount * 1.0 / exam.studentIds.Count, 2) : 0).ToString();
+                    valuew[4] = wrong.ToString();
                     valuew[5] = rhwC.ToString();
                     valuew[6] = rhlC.ToString();
                     wrongPersent.Add(valuew);
-                    knowledgeMap.Add(knowledgeName[k], stuPersent);
-
-                    //知识点占比
-                    double persent = OnePoint / TotalPoint;
-                    foreach (ClassRange classRange in exam.classes)
-                    {
-                        List<string> classPoints = new List<string>();
-                        //初始化班级得分                   
-                        double anwCPoint = 0;
-                        double cpo = 0;
-                        for (int stuIndex = classRange.range[0]; stuIndex < classRange.range[1]; stuIndex++)
-                        {
-
-                            if (result[stuIndex].Sum() == 0) continue;
-                            info.papers[index].knowledge.ForEach(kno => {
-                                int x = 0;
-                                if (kno.Contains(knowledgeName[k]))
-                                {
-                                    //当前认知层次在该题占比多少
-                                    ePoint = 1;
-                                    anwCPoint += result[stuIndex][x] * ePoint;
-                                    cpo += point[x] * ePoint;
-                                }
-                            });
-
-                        }
-                        if (cpo == 0)
-                        {
-                            //double classPser = anwCPoint / cpo;
-                            knowledgeClass.Add("0");
-                        }
-                        else
+                //知识点占比
+                double persent = OnePoint / TotalPoint;
+                per.Add(persent.ToString("0.00"));
+                
+            }
+            //本次考试知识点占比
+            List<double> allPer = new List<double>();
+            foreach (double sc in Score)
+            {
+                allPer.Add(exam.studentIds.Count > 0 ? Math.Round(sc * 1.0 / exam.studentIds.Count,2) : 0);
+            }
+            int stuNo = 0;
+            exam.studentIds.ForEach(e => {
+               
+                //values.Add(e);
+              
+               
+                List<double> valueKnow = new List<double>();
+                foreach (string know in knowledge) {
+                    double anwPoint = 0;
+                    double itemPersent = 0;
+                    int sno = 0;
+                    info.papers[index].knowledge.ForEach(kno => {
+                        if (kno.Contains(know))
                         {
-                            double classPser = anwCPoint / cpo;
-                            knowledgeClass.Add(classPser.ToString("0.00"));
+                            //当前知识点在该题占比多少
+                            itemPersent = 1 / Convert.ToDouble(kno.Count);
+                            anwPoint += result[stuNo][sno] * itemPersent;                            
                         }
-
-                    }
-                    classMap.Add(knowledgeName[k], knowledgeClass);
-                    per.Add(persent.ToString("0.00"));
-
-                }
-                knowledgeMap.Add("grade", knowPer);
-                knowledgeMap.Add("keys", key);
-                classMap.Add("className", className);
-                wrongMap.Add("keys", keyWrong);
-                wrongMap.Add("datas", wrongPersent);
-                knowledgeALL.Add("pointList", knowledgeName);
-                knowledgeALL.Add("per", per);
-                knowledgeALL.Add("level", areaName);
-                knowledgeALL.Add("fper", fper);
-                knowledgeALL.Add("stupercent", knowledgeMap);
-                knowledgeALL.Add("classpercent", classMap);
-                knowledgeALL.Add("wrong", wrongMap);
-                //keyValues.Add(knowledgeALL);
-                return knowledgeALL;
+                        sno++;
+                    });
+                    valueKnow.Add(anwPoint);
+                }                
+                KeyValuePair<string, List<double> > keyValue = new KeyValuePair<string, List<double> >(e, valueKnow);
+                datas.Add(keyValue);
+                stuNo++;
+            });
+            KeyValuePair<string, List<string>> key1 = new KeyValuePair<string, List<string>>(exam.subjectId,knowledgeName);
+            KeyValuePair<string, List<string>> key2 = new KeyValuePair<string, List<string>>(exam.subjectId,per);
+            KeyValuePair<string, List<double>> key3 = new KeyValuePair<string, List<double>>(exam.subjectId, allPer);
+            KeyValuePair<string, List<double>> key4 = new KeyValuePair<string, List<double>>(exam.subjectId, kScore);
+            KeyValuePair<string, List<List<string>>> keyValue = new KeyValuePair<string, List<List<string>>>(exam.subjectId, wrongPersent);
+            KeyValuePair<string, List<KeyValuePair<string, List<double>>>>  valuePair = new KeyValuePair<string, List<KeyValuePair<string,  List<double> >>>(exam.subjectId, datas);
+            return (key1,key2, key3, key4, keyValue, valuePair);
         }
 
-        private Dictionary<string, dynamic> DoLevel(ExamResult exam, ExamInfo info)
+        /*private Dictionary<string, dynamic> DoLevel(ExamResult exam, ExamInfo info)
         {
             HashSet<string> knowledge = new HashSet<string>();
             HashSet<string> area = new HashSet<string>();
@@ -1092,25 +1123,7 @@ namespace TEAMModelOS.Controllers.Analysis
             Dictionary<string, object> wrongMap = new Dictionary<string, object>();
             HashSet<string> className = new HashSet<string>();
             List<List<string>> wrongPersent = new List<List<string>>();
-            List<string> key = new List<string>
-            {
-                "id",
-                "className",
-                "seatNO",
-                "point",
-                "anwPoint",
-                "persent"
-            };
-            List<string> keyWrong = new List<string>
-            {
-                "name",
-                "point",
-                "itemNO",
-                "persent",
-                "wrong",
-                "rhw",
-                "rlw"
-            };
+
             //定位试卷信息
             int index = 0;
             foreach (ExamSubject subject in info.subjects)
@@ -1270,14 +1283,14 @@ namespace TEAMModelOS.Controllers.Analysis
                     {
                         values.Add("-");
                     });
-                    /*                        foreach (OldStudent info in students)
+                    *//*                        foreach (OldStudent info in students)
                                             {
                                                 if (info.studentId.Equals(id))
                                                 {
                                                     values[2] = info.seatNo.ToString();
                                                     break;
                                                 }
-                                            }*/
+                                            }*//*
                     //List<string> stu = new List<string>();
                     values[0] = id;
                     values[1] = "-";
@@ -1388,19 +1401,247 @@ namespace TEAMModelOS.Controllers.Analysis
                 per.Add(persent.ToString("0.00"));
 
             }
-            knowledgeMap.Add("grade", knowPer);
-            knowledgeMap.Add("keys", key);
-            classMap.Add("className", className);
-            wrongMap.Add("keys", keyWrong);
-            wrongMap.Add("datas", wrongPersent);
-            knowledgeALL.Add("pointList", knowledgeName);
-            knowledgeALL.Add("per", per);
-            knowledgeALL.Add("level", areaName);
-            knowledgeALL.Add("fper", fper);
-            knowledgeALL.Add("stupercent", knowledgeMap);
-            knowledgeALL.Add("classpercent", classMap);
-            knowledgeALL.Add("wrong", wrongMap);
             return knowledgeALL;
+        }*/
+
+        private static (KeyValuePair<string, List<int>>, KeyValuePair<string, List<string>>, KeyValuePair<string, List<double>>, KeyValuePair<string, List<double>>, KeyValuePair<string, List<List<string>>>, KeyValuePair<string, List<KeyValuePair<string, List<double>>>>) DoLevel(ExamResult exam, ExamInfo info, List<string> keynowWrong)
+        {
+/*            HashSet<string> knowledge = new HashSet<string>();
+            HashSet<string> area = new HashSet<string>();*/
+            List<double> point = new List<double>();
+            List<List<double>> result = new List<List<double>>();
+            List<ClassRange> classes = new List<ClassRange>();
+            List<string> ids = new List<string>();
+
+            List<KeyValuePair<string, List<double>>> datas = new List<KeyValuePair<string, List<double>>>();
+            //求单个知识点所占分数
+            List<string> per = new List<string>();
+            List<string> gper = new List<string>();
+            List<string> knowPer = new List<string>();
+
+            //Dictionary<string, object> wrongMap = new Dictionary<string, object>();
+            List<List<string>> wrongPersent = new List<List<string>>();
+
+            List<int> knowledgeName = new List<int>();
+
+            List<int> areaName = new List<int>();
+
+            //定位试卷信息
+            int index = 0;
+            foreach (ExamSubject subject in info.subjects)
+            {
+                if (subject.id.Equals(exam.subjectId))
+                {
+                    break;
+                }
+                else
+                {
+                    index++;
+                }
+            }
+            knowledgeName.Add(1);
+            knowledgeName.Add(2);
+            knowledgeName.Add(3);
+            knowledgeName.Add(4);
+            knowledgeName.Add(5);
+            knowledgeName.Add(6);
+            areaName.Add(1);
+            areaName.Add(2);
+            areaName.Add(3);
+            areaName.Add(4);
+            areaName.Add(5);
+            areaName.Add(6);
+
+            double Qnum = 0;
+            point = info.papers[index].point;
+            result = exam.studentScores;
+            classes = exam.classes;
+            ids = exam.studentIds;
+            //确定高分组 低分组人数
+            List<List<double>> re = exam.studentScores;
+            List<double> resultSum = new List<double>();
+            foreach (List<double> data in re)
+            {
+                resultSum.Add(data.Sum());
+            }
+            //确定高分组 最低分数
+            resultSum.Sort(delegate (double s1, double s2) { return s2.CompareTo(s1); });
+            for (int i = resultSum.Count - 1; i >= 0; i--)
+            {
+                if (resultSum[i] == 0)
+                {
+                    resultSum.Remove(resultSum[i]);
+                }
+            }
+            double rhwCount = resultSum.Count * 0.27;
+            double rhw = resultSum[int.Parse(rhwCount.ToString("0"))];
+            //确定低分组 最高分数
+            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"))];
+
+
+
+
+            //初始化年级总分
+            double total = 0;
+            //处理年级单个知识点得分率
+            foreach (List<double> grade in result)
+            {
+                total += grade.Sum();
+            }
+            foreach (string id in ids)
+            {
+                if (!id.Equals("0"))
+                {
+                    Qnum++;
+                }
+            }
+            //试卷总分
+            double TotalPoint = point.Sum();
+            //计算认知层次占比
+
+            List<string> fper = new List<string>();
+            for (int a = 0; a < areaName.Count; a++)
+            {
+                double fieldPoint = 0;
+                int no = 0;
+                info.papers[index].field.ForEach(f =>
+                {
+                    if (f == areaName[a])
+                    {
+                        fieldPoint += point[no];
+                    }
+                    no++;
+                });
+                double fieldPersent = fieldPoint / TotalPoint;
+                fper.Add(fieldPersent.ToString("0.00"));
+            }
+            List<double> knowScore = new List<double>();
+            //得分率
+            List<double> Score = new List<double>();
+            //分值
+            List<double> kScore = new List<double>();
+            for (int k = 0; k < knowledgeName.Count; k++)
+            {
+                double OnePoint = 0;
+                List<string> valuew = new List<string>();
+                List<string> itemNo = new List<string>();
+                keynowWrong.ForEach(x =>
+                {
+                    valuew.Add("-");
+                });
+                valuew[0] = knowledgeName[k].ToString();
+                int n = 0;
+                int wrong = 0;
+                int rhwC = 0;
+                int rhlC = 0;
+                int scoreCount = 0;
+                //所有认知层次得分
+                double anwGPoint = 0;
+                double gPoint = 0;
+                info.papers[index].field.ForEach(kno =>
+                {
+                    if (kno == knowledgeName[k])
+                    {
+                        OnePoint += point[n];
+                        itemNo.Add((n + 1).ToString());
+                        //处理单个知识点错题人数
+                        foreach (string id in exam.studentIds)
+                        {
+                            int index = exam.studentIds.IndexOf(id);
+                            if (exam.studentScores[index][n] == 0)
+                            {
+                                wrong++;
+                                if (exam.studentScores[index].Sum() >= rhw)
+                                {
+                                    rhwC++;
+                                    continue;
+                                }
+                                if (exam.studentScores[index].Sum() <= rhl)
+                                {
+                                    rhlC++;
+                                    continue;
+                                }
+                                continue;
+                            }
+                            else {
+                                scoreCount++;
+                            }
+                            anwGPoint += exam.studentScores[index][n];
+                        }
+                        gPoint += point[n];
+                    }
+                    valuew[1] = OnePoint.ToString();
+                    string itemNos = "";
+                    if (itemNo.Count > 0)
+                    {
+                        foreach (string np in itemNo)
+                        {
+                            itemNos += np + ",";
+                        }
+                        valuew[2] = itemNos[0..^1];
+                    }
+                    else
+                    {
+                        valuew[2] = itemNos;
+                    }
+                    n++;
+                });
+                Score.Add(anwGPoint);
+                kScore.Add(gPoint);
+                knowScore.Add(OnePoint);
+                //错题关系表
+                
+                valuew[3] = (exam.studentIds.Count > 0 ? Math.Round(scoreCount * 1.0 / exam.studentIds.Count, 2) : 0).ToString() ;
+                valuew[4] = wrong.ToString();
+                valuew[5] = rhwC.ToString();
+                valuew[6] = rhlC.ToString();
+                wrongPersent.Add(valuew);
+                //认知层次占比
+                double persent = OnePoint / TotalPoint;
+                per.Add(persent.ToString("0.00"));
+            }
+            //本次考试知识点占比
+            List<double> allPer = new List<double>();
+            foreach (double sc in Score)
+            {
+                allPer.Add(exam.studentIds.Count > 0 ? Math.Round(sc * 1.0 / exam.studentIds.Count, 2) :0);
+            }
+            int stuNo = 0;
+            exam.studentIds.ForEach(e => {
+
+                //values.Add(e);
+
+
+                List<double> valueKnow = new List<double>();
+                foreach (int know in knowledgeName)
+                {
+                    double anwPoint = 0;
+                    double itemPersent = 0;
+                    int sno = 0;
+                    info.papers[index].field.ForEach(kno => {
+                        if (kno == know)
+                        {
+                            //当前知识点在该题占比多少
+                            itemPersent = 1;
+                            anwPoint += result[stuNo][sno] * itemPersent;
+                        }
+                        sno++;
+                    });
+                    valueKnow.Add(anwPoint);
+                }
+                KeyValuePair<string, List<double>> keyValue = new KeyValuePair<string, List<double>>(e, valueKnow);
+                datas.Add(keyValue);
+                stuNo++;
+            });
+            KeyValuePair<string, List<int>> key1 = new KeyValuePair<string, List<int>>(exam.subjectId, knowledgeName);
+            KeyValuePair<string, List<string>> key2 = new KeyValuePair<string, List<string>>(exam.subjectId, per);
+            KeyValuePair<string, List<double>> key3 = new KeyValuePair<string, List<double>>(exam.subjectId, allPer);
+            KeyValuePair<string, List<double>> key4 = new KeyValuePair<string, List<double>>(exam.subjectId, kScore);
+            KeyValuePair<string, List<List<string>>> keyValue = new KeyValuePair<string, List<List<string>>>(exam.subjectId, wrongPersent);
+            KeyValuePair<string, List<KeyValuePair<string, List<double>>>> valuePair = new KeyValuePair<string, List<KeyValuePair<string, List<double>>>>(exam.subjectId, datas);
+            return (key1, key2, key3, key4,keyValue, valuePair);
         }
 
     }

+ 2 - 0
TEAMModelOS/Controllers/Analysis/ClassAys.cs

@@ -24,6 +24,8 @@ namespace TEAMModelOS.Controllers.Analysis
     }
     public class AysSubject
     {
+        public List<double> point { get; set; }
+        public List<double> field { get; set; }
         public int passCount { get; set; }
         public string name { get; set; }
         public string id { get; set; }

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

@@ -22,6 +22,8 @@ namespace TEAMModelOS.Controllers.Analysis
        
     }
     public class StudentSubject{
+        public List<double> point { get; set; }
+        public List<double> fieldPoint { get; set; }
         public List<string> scatter { get; set; }
         public string id { get; set; }
         public string name { get; set; }