Browse Source

Merge branch 'develop5.0-tmd' of http://106.12.23.251:10000/TEAMMODEL/TEAMModelOS into develop5.0-tmd

CrazyIter_Bin 4 years ago
parent
commit
29f716a7ba

+ 24 - 6
TEAMModelOS/ClientApp/src/components/syllabus/DragTree.vue

@@ -10,6 +10,13 @@
 						<!-- {{data.id}} -->
 						<Icon type="md-cube" color="#00c38d" :title="$t('syllabus.tree.hasResource')" v-if="data.rnodes && data.rnodes.length" />
 						<Icon type="md-git-compare" color="#00c38d" :title="$t('syllabus.tree.hasCoEdit')" v-if="hasEditAuth(data) && isSchool" />
+						<Tooltip placement="right">
+							<Icon type="md-information-circle" color="#8a8a8a" size="18" v-if="hasEditAuth(data) && isSchool"/>
+							<div slot="content">
+								<p>{{ $t('syllabus.latestId') }}:{{ getNameById(data.creatorId) }}</p>
+								<p>{{ $t('syllabus.latestTime') }}:{{ $tools.formatTime(data.updateTime) }}</p>
+							</div>
+						</Tooltip>
 					</span>
 					<span class="custom-tree-tools" v-if="inShareView && isFirstLevel(data)">
 						<Icon type="md-copy" style="margin-right: 5px;" size="16" />
@@ -20,8 +27,8 @@
 					<span class="custom-tree-tools" v-if="((hasEditAuth(data) || $access.can('admin.*|Syllabus_Edit')) && !inShareView)">
 						<Icon type="md-create" size="16" :title="$t('syllabus.tree.edit')" @click="onEditItem(node,data,$event)" />
 						<Icon type="md-add" size="16" :title="$t('syllabus.tree.add')" @click="onAddNode(node,data,$event)" />
-						<Icon type="md-remove" size="16" :title="$t('syllabus.tree.remove')" @click="remove(node,data)" v-if="!isFirstLevel(data) ||  (canDeleteChapter(data) && isFirstLevel(data))"/>
-						<Icon type="md-share" v-if="isFirstLevel(data) && canDeleteChapter(data)" :title="isSchool ? $t('syllabus.tree.coEdit') : $t('syllabus.tree.share')"
+						<Icon type="md-remove" size="16" :title="$t('syllabus.tree.remove')" @click="remove(node,data)" v-if="!isFirstLevel(data) ||  (canDeleteChapter && isFirstLevel(data))"/>
+						<Icon type="md-share" v-if="isFirstLevel(data) && canDeleteChapter" :title="isSchool ? $t('syllabus.tree.coEdit') : $t('syllabus.tree.share')"
 							@click="doShare(data)" />
 					</span>
 				</span>
@@ -613,6 +620,8 @@
 				this.nodeInfo.parent = node.parent.data.title || this.volume.name
 				this.nodeInfo.title = node.data.title
 				this.nodeInfo.id = node.data.id
+				this.nodeInfo.creatorId = this.$store.state.userInfo.TEAMModelId
+				node.creatorId = this.$store.state.userInfo.TEAMModelId
 				this.curNode = node
 			},
 			/* 根据节点获取它所在的章节信息 */
@@ -632,6 +641,7 @@
 				}
 				if (this.isEditItem) {
 					this.currentEditData.title = this.nodeInfo.title
+					this.currentEditData.creatorId = this.$store.state.userInfo.TEAMModelId
 				} else {
 					let newChild = Object.assign({}, this.nodeInfo) // 创建新节点
 					let parentNode = this.currentParentData
@@ -698,6 +708,11 @@
 					return data.pid === this.volume.id
 				}
 			},
+			getNameById(){
+				return id => {
+					return this.$parent.teacherList.length && id ? this.$parent.teacherList.find(i => i.id === id).name : ''
+				}
+			},
 			// 判断当前用户是否有当前节点的编辑权限(如果父节点有权限则下面的子节点相应都有操作权限)
 			hasEditAuth(){
 				return nodeData => {
@@ -705,14 +720,13 @@
 					// 判断是否为一级节点,如果是二级节点则需要拿对应的一级节点去做判断
 					let chapterId = nodeData.pid === this.volume.id ? nodeData.id : this.getChapterIdById(nodeData.id)
 					let chapterNode = this.treeDatas.find(i => i.id === chapterId)
-					return this.volume.creatorId === userId || (chapterNode && chapterNode.auth && chapterNode.auth.length && chapterNode.auth.map(i => i.tmdid).includes(userId))
+					return this.$access.can('admin.*|Syllabus_Edit') || this.volume.auth.map(i => i.tmdid).includes(userId) || (chapterNode && chapterNode.auth && chapterNode.auth.length && chapterNode.auth.map(i => i.tmdid).includes(userId))
 				}
 			},
 			// 判断当前用户是否可以删除当前章节
 			canDeleteChapter(){
-				return nodeData => {
-					return nodeData.creatorId === this.$store.state.userInfo.TEAMModelId
-				}
+				let userId = this.$store.state.userInfo.TEAMModelId
+				return this.$access.can('admin.*|Syllabus_Edit') || this.volume.auth.map(i => i.tmdid).includes(userId)
 			},
 			curCode() {
 				return this.isSchool ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId
@@ -814,4 +828,8 @@
 		top: 20px;
 		width: 12px;
 	}
+	
+	.tree /deep/ .ivu-tooltip-popper{
+		font-size: 12px !important;
+	}
 </style>

+ 1 - 0
TEAMModelOS/ClientApp/src/locale/lang/zh-CN/knowledge.js

@@ -1,4 +1,5 @@
 export default {
+	colorTip:'* 绿色背景代表所选知识点,蓝色背景代表知识块关联的知识点',
     subject: '学科',
     label: '名称',
     blockP: '请输入知识块名称',

+ 8 - 1
TEAMModelOS/ClientApp/src/locale/lang/zh-CN/syllabus.js

@@ -27,7 +27,14 @@ export default{
 	addVolume:'新增册别',
 	grade:'年级',
 	semester:'学期',
-	name:'名称',
+	name:'名称', 
+	canEdit:'可共编',
+	authorsTitle:'授权教师',
+	noAuth:'暂无授权教师信息',
+	authors:'授权教师(多选)',
+	latestId:'最近修改人',
+	latestTime:'最近修改时间',
+	place4:'选择授权册别管理权限的教师...',
 	place2:'非必填,默认由年级+科目+学期组成...',
 	place3:'填写册别名称',
 	confirm:'确认',

+ 1 - 0
TEAMModelOS/ClientApp/src/locale/lang/zh-TW/knowledge.js

@@ -1,4 +1,5 @@
 export default {
+	colorTip:'*綠色背景代表所選知識點,藍色背景代表知識塊關聯的知識點',
     subject: '學科',
     label: '名稱',
     blockP: '請輸入知識塊名稱',

+ 7 - 0
TEAMModelOS/ClientApp/src/locale/lang/zh-TW/syllabus.js

@@ -28,6 +28,13 @@ export default {
 	grade: '年級',
 	semester: '學期',
 	name: '名稱',
+	canEdit:'可共編',
+	authorsTitle:'授權教師',
+	noAuth:'暫無授權教師資訊',
+	latestId:'最近修改人',
+	latestTime:'最近修改時間',
+	authors:'授權教師(多選)',
+	place4:'選擇授權册別管理許可權的教師…',
 	place2: '非必填,默認由年級+科目+學期組成…',
 	place3: '填寫册別名稱',
 	confirm: '確認',

+ 18 - 18
TEAMModelOS/ClientApp/src/view/evaluation/bank/ExerciseList.vue

@@ -14,54 +14,54 @@
 			<div class="filter-item" v-show="isShowSchoolBank || (filterOrigin === schoolCode)">
 				<span class="filter-title">{{$t('evaluation.filter.period')}}:</span>
 				<RadioGroup v-model="filterPeriod" type="button" @on-change="filterPeriodChange">
-					<Radio v-for="(item, index) in periodList" :key="index" :label="index">{{ item.name }}<span class="filter-count">({{ periodCountArr.length ? periodCountArr[index] : 0 }})</span></Radio>
+					<Radio v-for="(item, index) in periodList" :key="index" :label="index">{{ item.name }}<span class="filter-count" v-if="filterOrigin === schoolCode">({{ periodCountArr.length ? periodCountArr[index] : 0 }})</span></Radio>
 				</RadioGroup>
 			</div>
 			<div class="filter-item" v-show="isShowSchoolBank || (filterOrigin === schoolCode)">
 				<span class="filter-title">{{$t('evaluation.filter.grade')}}:</span>
 				<CheckboxGroup v-model="filterGrade" border @on-change="filterGradeChange">
 					<Checkbox lable="all">{{$t('evaluation.filter.all')}}</Checkbox>
-					<Checkbox v-for="(item, index) in gradeList" :key="index" :label="index">{{ item }} <span class="filter-count">({{ gradeCountArr.length ? gradeCountArr[index] : 0 }})</span></Checkbox>
+					<Checkbox v-for="(item, index) in gradeList" :key="index" :label="index">{{ item }} <span class="filter-count" v-if="filterOrigin === schoolCode">({{ gradeCountArr.length ? gradeCountArr[index] : 0 }})</span></Checkbox>
 				</CheckboxGroup>
 			</div>
 			<div class="filter-item" v-show="isShowSchoolBank || (filterOrigin === schoolCode)">
 				<span class="filter-title">{{$t('evaluation.filter.subject')}}:</span>
 				<CheckboxGroup v-model="filterSubject" border @on-change="filterSubjectChange">
 					<Checkbox lable="all">{{$t('evaluation.filter.all')}}</Checkbox>
-					<Checkbox v-for="(item, index) in subjectList" :key="index" :label="item.id">{{ item.name }}<span class="filter-count">({{ subjectCountArr.length ? subjectCountArr[index] : 0 }})</span></Checkbox>
+					<Checkbox v-for="(item, index) in subjectList" :key="index" :label="item.id">{{ item.name }}<span class="filter-count" v-if="filterOrigin === schoolCode">({{ subjectCountArr.length ? subjectCountArr[index] : 0 }})</span></Checkbox>
 				</CheckboxGroup>
 			</div>
 			<div class="filter-item">
 				<span class="filter-title">{{$t('evaluation.filter.type')}}:</span>
 				<CheckboxGroup v-model="filterType" border @on-change="filterTypeChange">
 					<Checkbox label="all">{{$t('evaluation.filter.all')}}</Checkbox>
-					<Checkbox label="single">{{$t('evaluation.single')}}<span class="filter-count">({{ typeCountArr.length ? typeCountArr[0] : 0 }})</span></Checkbox>
-					<Checkbox label="multiple">{{$t('evaluation.multiple')}}<span class="filter-count">({{ typeCountArr.length ? typeCountArr[1] : 0 }})</span></Checkbox>
-					<Checkbox label="judge">{{$t('evaluation.judge')}}<span class="filter-count">({{ typeCountArr.length ? typeCountArr[2] : 0 }})</span></Checkbox>
-					<Checkbox label="complete">{{$t('evaluation.complete')}}<span class="filter-count">({{ typeCountArr.length ? typeCountArr[3] : 0 }})</span></Checkbox>
-					<Checkbox label="subjective">{{$t('evaluation.subjective')}}<span class="filter-count">({{ typeCountArr.length ? typeCountArr[4] : 0 }})</span></Checkbox>
-					<Checkbox label="connector">{{$t('evaluation.connector')}}<span class="filter-count">({{ typeCountArr.length ? typeCountArr[5] : 0 }})</span></Checkbox>
-					<Checkbox label="correct">{{$t('evaluation.correct')}}<span class="filter-count">({{ typeCountArr.length ? typeCountArr[6] : 0 }})</span></Checkbox>
-					<Checkbox label="compose">{{$t('evaluation.compose')}}<span class="filter-count">({{ typeCountArr.length ? typeCountArr[7] : 0 }})</span></Checkbox>
+					<Checkbox label="single">{{$t('evaluation.single')}}<span class="filter-count" v-if="filterOrigin === schoolCode">({{ typeCountArr.length ? typeCountArr[0] : 0 }})</span></Checkbox>
+					<Checkbox label="multiple">{{$t('evaluation.multiple')}}<span class="filter-count" v-if="filterOrigin === schoolCode">({{ typeCountArr.length ? typeCountArr[1] : 0 }})</span></Checkbox>
+					<Checkbox label="judge">{{$t('evaluation.judge')}}<span class="filter-count" v-if="filterOrigin === schoolCode">({{ typeCountArr.length ? typeCountArr[2] : 0 }})</span></Checkbox>
+					<Checkbox label="complete">{{$t('evaluation.complete')}}<span class="filter-count" v-if="filterOrigin === schoolCode">({{ typeCountArr.length ? typeCountArr[3] : 0 }})</span></Checkbox>
+					<Checkbox label="subjective">{{$t('evaluation.subjective')}}<span class="filter-count" v-if="filterOrigin === schoolCode">({{ typeCountArr.length ? typeCountArr[4] : 0 }})</span></Checkbox>
+					<Checkbox label="connector">{{$t('evaluation.connector')}}<span class="filter-count" v-if="filterOrigin === schoolCode">({{ typeCountArr.length ? typeCountArr[5] : 0 }})</span></Checkbox>
+					<Checkbox label="correct">{{$t('evaluation.correct')}}<span class="filter-count" v-if="filterOrigin === schoolCode">({{ typeCountArr.length ? typeCountArr[6] : 0 }})</span></Checkbox>
+					<Checkbox label="compose">{{$t('evaluation.compose')}}<span class="filter-count" v-if="filterOrigin === schoolCode">({{ typeCountArr.length ? typeCountArr[7] : 0 }})</span></Checkbox>
 				</CheckboxGroup>
 			</div>
 			<div class="filter-item">
 				<span class="filter-title">{{$t('evaluation.filter.diff')}}:</span>
 				<CheckboxGroup v-model="filterDiff" border @on-change="filterDiffChange">
 					<Checkbox label="all">{{$t('evaluation.filter.all')}}</Checkbox>
-					<Checkbox v-for="(item, index) in exersicesDiff" :key="index" :label="index + 1">{{ item }}<span class="filter-count">({{ levelCountArr.length ? levelCountArr[index] : 0 }})</span></Checkbox>
+					<Checkbox v-for="(item, index) in exersicesDiff" :key="index" :label="index + 1">{{ item }}<span class="filter-count" v-if="filterOrigin === schoolCode">({{ levelCountArr.length ? levelCountArr[index] : 0 }})</span></Checkbox>
 				</CheckboxGroup>
 			</div>
 			<div class="filter-item">
 				<span class="filter-title">{{$t('evaluation.filter.level')}}:</span>
 				<CheckboxGroup v-model="filterField" border @on-change="filterFieldChange">
 					<Checkbox label="all">{{$t('evaluation.filter.all')}}</Checkbox>
-					<Checkbox :label="1">{{$t('evaluation.level1')}}<span class="filter-count">({{ fieldCountArr.length ? fieldCountArr[0] : 0 }})</span></Checkbox>
-					<Checkbox :label="2">{{$t('evaluation.level2')}}<span class="filter-count">({{ fieldCountArr.length ? fieldCountArr[1] : 0 }})</span></Checkbox>
-					<Checkbox :label="3">{{$t('evaluation.level3')}}<span class="filter-count">({{ fieldCountArr.length ? fieldCountArr[2] : 0 }})</span></Checkbox>
-					<Checkbox :label="4">{{$t('evaluation.level4')}}<span class="filter-count">({{ fieldCountArr.length ? fieldCountArr[3] : 0 }})</span></Checkbox>
-					<Checkbox :label="5">{{$t('evaluation.level5')}}<span class="filter-count">({{ fieldCountArr.length ? fieldCountArr[4] : 0 }})</span></Checkbox>
-					<Checkbox :label="6">{{$t('evaluation.level6')}}<span class="filter-count">({{ fieldCountArr.length ? fieldCountArr[5] : 0 }})</span></Checkbox>
+					<Checkbox :label="1">{{$t('evaluation.level1')}}<span class="filter-count" v-if="filterOrigin === schoolCode">({{ fieldCountArr.length ? fieldCountArr[0] : 0 }})</span></Checkbox>
+					<Checkbox :label="2">{{$t('evaluation.level2')}}<span class="filter-count" v-if="filterOrigin === schoolCode">({{ fieldCountArr.length ? fieldCountArr[1] : 0 }})</span></Checkbox>
+					<Checkbox :label="3">{{$t('evaluation.level3')}}<span class="filter-count" v-if="filterOrigin === schoolCode">({{ fieldCountArr.length ? fieldCountArr[2] : 0 }})</span></Checkbox>
+					<Checkbox :label="4">{{$t('evaluation.level4')}}<span class="filter-count" v-if="filterOrigin === schoolCode">({{ fieldCountArr.length ? fieldCountArr[3] : 0 }})</span></Checkbox>
+					<Checkbox :label="5">{{$t('evaluation.level5')}}<span class="filter-count" v-if="filterOrigin === schoolCode">({{ fieldCountArr.length ? fieldCountArr[4] : 0 }})</span></Checkbox>
+					<Checkbox :label="6">{{$t('evaluation.level6')}}<span class="filter-count" v-if="filterOrigin === schoolCode">({{ fieldCountArr.length ? fieldCountArr[5] : 0 }})</span></Checkbox>
 				</CheckboxGroup>
 			</div>
 			<div class="filter-item">

+ 11 - 11
TEAMModelOS/ClientApp/src/view/knowledge-point/index/Index.less

@@ -2,16 +2,16 @@
 @borderColor: #444444;
 @primary-textColor:#e0e0e0; //文本主颜色
 @second-textColor:#a5a5a5; //文本副级颜色
-@primary-fontSize:16px;
-@second-fontSize:14px;
-@title-fontSize:18px;
+@primary-fontSize:14px;
+@second-fontSize:12px;
+@title-fontSize:16px;
 
 .new-syllabus {
 
 
     &-container {
         height: 100%;
-        background: @main-bgColor;
+        // background: @main-bgColor;
     }
 
     &-header {
@@ -24,10 +24,11 @@
         z-index: 1;
 
         .school-tools {
-            font-size: var(--font-size-normal);
-            margin-right: 30px;
-            margin-top: 13px;
-            float: right;
+            position: absolute;
+            right: 20px;
+            background-color: #1fb06d;
+            color: #fff;
+            border: none;
         }
 
         .school-tools .ivu-icon {
@@ -120,7 +121,7 @@
                     }
 
                     &-info {
-                        padding: 1px 0;
+                        margin-top: 5px;
                         font-size: @second-fontSize;
                         color: @second-textColor;
 
@@ -205,7 +206,6 @@
 
         .ns-col3 {
             width: 66%;
-            background: #2c2c2cd6;
 
 
             .btn-compose-block {
@@ -218,7 +218,7 @@
             .points-wrap {
                 display: flex;
                 flex-wrap: wrap;
-                padding-top: 20px;
+                padding-top: 5px;
 
                 .point-item {
                     position: relative;

+ 123 - 45
TEAMModelOS/ClientApp/src/view/knowledge-point/index/Index.vue

@@ -6,14 +6,14 @@
 	<div class="new-syllabus-container">
 		<Loading :top="200" bgColor="rgba(103, 103, 103, 0.27)" type="1" v-if="isLoading"></Loading>
 		<!-- 课纲头部 切换来源以及选择学段 -->
-		<div class="new-syllabus-header common-save-btn">
+		<div class="new-syllabus-header">
 			<div class="new-syllabus-select">
-				<span>{{$t("knowledge.period")}}:</span>
-				<Select ref="periodSelect" v-model="currentPeriodIndex" style="width:100px;" @on-change="onPeriodChange">
+				<!-- <span>{{$t("knowledge.period")}}:</span> -->
+				<Select ref="periodSelect" v-model="currentPeriodIndex" style="width:200px;" @on-change="onPeriodChange" @on-select="onPeriodSelect">
 					<Option v-for="(item,index) in periodList" :value="index" :key="index">{{ item.name }}</Option>
 				</Select>
 			</div>
-			<Button v-if="$access.ability('admin','schoolSetting-upd').validateAll" :disabled="!updated"  class="school-tools ivu-btn ivu-btn-default" icon="ios-albums-outline" @click="saveData()">{{$t('schoolBaseInfo.saveInfo')}}</Button>
+			<Button type="success" v-if="$access.ability('admin','schoolSetting-upd').validateAll && updated"  class="school-tools ivu-btn ivu-btn-default" icon="ios-albums-outline" @click="saveData()">{{$t('schoolBaseInfo.saveInfo')}}</Button>
 		</div>
 		<!-- 主体内容 -->
 		<div class="new-syllabus-content">
@@ -74,6 +74,7 @@
 							<EmptyData :top="100"></EmptyData>
 						</div>
 						<div v-else>
+							<p style="font-size: 12px;font-weight: 400;margin-left: 10px;margin-top: 10px;color: #888686;">{{$t("knowledge.colorTip")}}</p>
 							<draggable class="points-wrap" tag="div" v-model="pointList" v-bind="dragOptions">
 								<transition-group type="transition" :name="!drag ? 'flip-list' : null" class="points-wrap">
 									<div v-for="(item,index) in pointList" :key="index" :class="['point-item', isBlockPoint(item) ? 'block-point-item' : '' , isChecked(item) ? 'point-item-active' : '']"
@@ -251,7 +252,8 @@ import { json } from 'd3'
 				pointIndex: null,
 				pointDatas: {},
 				updated: false,
-				setCount: false
+				setCount: false,
+				prePeriodIndex:0
 			}
 		},
 		components: {
@@ -450,56 +452,130 @@ import { json } from 'd3'
 				}
 				this.handleSubjectTap(0)
 			},
+			
+			onPeriodSelect(){
+				this.prePeriodIndex = this.currentPeriodIndex
+			},
 
 			// 学段切换处理
 			onPeriodChange(index) {
 				this.$nextTick(() => {
-					this.preSelectVal = this.$refs.periodSelect.value
-					if (this.hasModify) {
-						this.handleConfirmSave({}, '3')
-					} else {
-						let that = this
-						this.isLoadSubject = true
-						this.activePeriodIndex = index
-						this.currentParams.periodId = this.originData.period[index].id
-						this.subjectList = this.periodList[index].subjects // 切换学段后更新 学科 列表
-						this.originSubjectList = this.periodList[index].subjects // 筛选学科源数据
-						if (this.subjectList.length) {
-							this.handleSubjectTap(0)
-							this.initBlockCount()
+					if(this.updated){
+						this.$Modal.confirm({
+							title: this.$t('schoolBaseInfo.saveWarning'),
+							content: this.$t('schoolBaseInfo.ssTips8'),
+							okText: this.$t('schoolBaseInfo.leaveText'),
+							onOk: () => {
+							   this.updated = false
+							   this.preSelectVal = this.$refs.periodSelect.value
+							   if (this.hasModify) {
+							   	this.handleConfirmSave({}, '3')
+							   } else {
+							   	let that = this
+							   	this.isLoadSubject = true
+							   	this.activePeriodIndex = index
+							   	this.currentParams.periodId = this.originData.period[index].id
+							   	this.subjectList = this.periodList[index].subjects // 切换学段后更新 学科 列表
+							   	this.originSubjectList = this.periodList[index].subjects // 筛选学科源数据
+							   	if (this.subjectList.length) {
+							   		this.handleSubjectTap(0)
+							   		this.initBlockCount()
+							   	} else {
+							   		this.pointList = []
+							   		this.originBlockList = []
+							   		this.blockList = []
+							   		this.originPointList = []
+							   	}
+							   	setTimeout(function () {
+							   		that.isLoadSubject = false
+							   	}, 400)
+							   }
+							},
+							onCancel: () => {
+							    this.currentPeriodIndex = this.prePeriodIndex
+							}
+						})
+					}else{
+						this.preSelectVal = this.$refs.periodSelect.value
+						if (this.hasModify) {
+							this.handleConfirmSave({}, '3')
 						} else {
-							this.pointList = []
-							this.originBlockList = []
-							this.blockList = []
-							this.originPointList = []
+							let that = this
+							this.isLoadSubject = true
+							this.activePeriodIndex = index
+							this.currentParams.periodId = this.originData.period[index].id
+							this.subjectList = this.periodList[index].subjects // 切换学段后更新 学科 列表
+							this.originSubjectList = this.periodList[index].subjects // 筛选学科源数据
+							if (this.subjectList.length) {
+								this.handleSubjectTap(0)
+								this.initBlockCount()
+							} else {
+								this.pointList = []
+								this.originBlockList = []
+								this.blockList = []
+								this.originPointList = []
+							}
+							setTimeout(function () {
+								that.isLoadSubject = false
+							}, 400)
 						}
-						setTimeout(function () {
-							that.isLoadSubject = false
-						}, 400)
 					}
+					
 				})
 			},
 
 			// 学科点击事件
 			handleSubjectTap(index) {
-				this.checkedPointList = []
-				this.blockList = []
-				this.originBlockList = []
-				this.pointList = []
-                this.curBlockPoints = []
-				this.originPointList = []
-                this.activeBlockIndex = 0
-				this.schoolParams = {
-					schoolCode: this.originData.id,
-					subjectId: this.subjectList[index].id,
-					period: this.currentParams.periodId
+				if(this.updated){
+					this.$Modal.confirm({
+						title: this.$t('schoolBaseInfo.saveWarning'),
+						content: this.$t('schoolBaseInfo.ssTips8'),
+						okText: this.$t('schoolBaseInfo.leaveText'),
+						onOk: () => {
+						   this.checkedPointList = []
+						   this.blockList = []
+						   this.originBlockList = []
+						   this.pointList = []
+						   this.curBlockPoints = []
+						   this.originPointList = []
+						   this.activeBlockIndex = 0
+						   this.schoolParams = {
+						   	schoolCode: this.originData.id,
+						   	subjectId: this.subjectList[index].id,
+						   	period: this.currentParams.periodId
+						   }
+						   this.currentSubjectIndex = index
+						   this.currentParams.subjectId = this.subjectList[index].id
+						   this.activeSubjectIndex = index
+						   this.isLoadBlocks = true
+						   this.getPointsData()
+						   this.getBlocksData()
+						},
+						onCancel: () => {
+						    return
+						}
+					})
+				}else{
+					this.checkedPointList = []
+					this.blockList = []
+					this.originBlockList = []
+					this.pointList = []
+					this.curBlockPoints = []
+					this.originPointList = []
+					this.activeBlockIndex = 0
+					this.schoolParams = {
+						schoolCode: this.originData.id,
+						subjectId: this.subjectList[index].id,
+						period: this.currentParams.periodId
+					}
+					this.currentSubjectIndex = index
+					this.currentParams.subjectId = this.subjectList[index].id
+					this.activeSubjectIndex = index
+					this.isLoadBlocks = true
+					this.getPointsData()
+					this.getBlocksData()
 				}
-				this.currentSubjectIndex = index
-				this.currentParams.subjectId = this.subjectList[index].id
-				this.activeSubjectIndex = index
-				this.isLoadBlocks = true
-				this.getPointsData()
-				this.getBlocksData()
+				
 			},
 
 			// 知识块点击事件
@@ -879,9 +955,11 @@ import { json } from 'd3'
 <style >
 	.new-syllabus-header .ivu-select-single .ivu-select-selection,
 	.funnel-box .ivu-select-single .ivu-select-selection {
-		background: transparent;
-		color: #fbfbfb;
-		border: 1px solid #424242;
+		width: 140px;
+		background-color: #252525e3 !important;
+		border-radius: 0;
+		border-color: #96969640 !important;
+		color: #D0D0D0;
 	}
 
 	.new-syllabus-header .ivu-select-single .ivu-select-arrow,

+ 2 - 2
TEAMModelOS/ClientApp/src/view/knowledge-point/index/operation/AddBlock.vue

@@ -9,13 +9,13 @@
             </FormItem>-->
             <FormItem :label="$t('knowledge.label')">
                 <Input v-model="formTop.name" :placeholder="$t('knowledge.blockP')" />
-                <vuescroll>
+                <!-- <vuescroll>
                     <ul class="search-list" v-show="filterData.length > 0">
                         <li v-for="(list,index) in filterData">
                             <span>{{list.name}}</span>
                         </li>
                     </ul>
-                </vuescroll>
+                </vuescroll> -->
             </FormItem>
             <FormItem>
                 <Button @click="handleSubmit" :loading="isLoading">{{$t("knowledge.confirm")}}</Button>

+ 4 - 0
TEAMModelOS/ClientApp/src/view/syllabus/Syllabus.less

@@ -136,6 +136,10 @@
 						border-radius: 4px;
 						zoom: 0.9;
 					}
+					
+					.status-coedit{
+						background-color: #006f3c;
+					}
 					&-info{
 						span{
 							color: #9f9f9f;

+ 162 - 42
TEAMModelOS/ClientApp/src/view/syllabus/Syllabus.vue

@@ -50,11 +50,22 @@
 							:class="['volume-item',activeVolumeIndex === volumeIndex ? 'volume-active' : '']"
 							@click="onVolumeClick(volume,volumeIndex)">
 							<p class="volume-item-name">{{ volume.name }} <span class="status-idDel"
-									v-if="volume.isDel">{{ $t('syllabus.isDel') }}</span> </p>
+									v-if="volume.isDel">{{ $t('syllabus.isDel') }}</span><span class="status-idDel status-coedit"
+									v-if="hasVolumeAuth(volume.auth) && isSchool">{{ $t('syllabus.canEdit') }}</span> </p>
 							<p class="volume-item-info" v-if="isSchool">
 								<span>{{ getGradeName(volume.gradeId) }}</span>
 								<span>|</span>
 								<span>{{ getSemesterName(volume.semesterId) }}</span>
+								<span style="margin: 0 8px;">|</span>
+								<Tooltip placement="bottom">
+									<span>{{ $t('syllabus.authorsTitle') }} {{ volume.auth.length }} </span>
+									<!-- <Icon type="md-information-circle" color="#9e9e9e" /> -->
+									<div slot="content">
+										<p v-if="!volume.auth.length">{{ $t('syllabus.noAuth') }}</p>
+										<p v-else v-for="(item,index) in volume.auth" :key="item.tmdid">
+											{{ item.tmdname }}</p>
+									</div>
+								</Tooltip>
 							</p>
 							<p class="volume-item-info" v-if="inShareView && volume.isDel">
 								<span style="display: flex;align-items: center;"
@@ -82,7 +93,7 @@
 					<span>{{ $t('syllabus.syllabusMenu') }}</span>
 					<span class="syllabus-content-header-tools"
 						v-if="volumeList.length && curVolume.id && !inShareView">
-						<Icon type="md-add" @click="isAddTreeModal = true" v-if="hasSyllabusAuth" />
+						<Icon type="md-add" @click="isAddTreeModal = true" v-if="hasSyllabusAuth || hasVolumeAuth" />
 					</span>
 				</div>
 				<div class="syllabus-tree-box">
@@ -134,7 +145,8 @@
 							<img src="../../assets/source/zip.png" v-else-if="item.type === 'res'" />
 							<img src="../../assets/source/image.png" v-else-if="item.type === 'thum'" />
 							<img src="../../assets/source/unknow.png" v-else="item.type === 'other'" />
-							<span v-html="item.title" style="max-width: 70%;cursor: pointer;" @click="onPreview(item)"></span>
+							<span v-html="item.title" style="max-width: 70%;cursor: pointer;"
+								@click="onPreview(item)"></span>
 							<div class="node-resource-tools">
 								<!-- <div class="node-resource-tool" >
 									<Icon type="md-eye" />
@@ -184,6 +196,12 @@
 								:placeholder="$t('syllabus.place2')"></Input>
 							<Input v-else v-model="addVolumeForm.name" :placeholder="$t('syllabus.place3')"></Input>
 						</FormItem>
+						<FormItem :label="$t('syllabus.authors')">
+							<Select v-model="addVolumeForm.auth" multiple filterable>
+								<Option v-for="(item,index) in teacherList" :value="item.id" :key="index">{{item.name}}
+								</Option>
+							</Select>
+						</FormItem>
 						<FormItem>
 							<Button @click="handleSubmit" :loading="isAddLoading">{{ $t('syllabus.confirm') }}</Button>
 						</FormItem>
@@ -319,6 +337,7 @@
 				myVolumeList: [],
 				questionList: [],
 				allChapterIds: [],
+				teacherList: [],
 				schoolInfo: null,
 				previewFile: {},
 				previewPaper: null,
@@ -344,7 +363,8 @@
 				addVolumeForm: {
 					grade: 0,
 					semester: 0,
-					name: ''
+					name: '',
+					auth: []
 				},
 				nodeInfo: {
 					"id": "",
@@ -357,6 +377,7 @@
 				},
 				modifyIdArr: [],
 				flatArr: [],
+				myCreateChapters:[],
 				isSaveSyllabus: false,
 			}
 		},
@@ -364,6 +385,7 @@
 			this.isSchool = this.$route.name === 'syllabus'
 			this.getSchoolInfo()
 			this.initBlobTool()
+			this.getAllTeacher()
 		},
 		methods: {
 			/* 初始化BLOB对象 */
@@ -388,6 +410,21 @@
 					}
 				});
 			},
+			/* 获取学校所有教师列表 */
+			getAllTeacher() {
+				this.$store.dispatch('user/getSchoolTeacher').then(
+					res => {
+						if (res.code == 0) {
+							this.$Message.error('無法取得使用者資料')
+						} else {
+							this.teacherList = this.$store.state.user.schoolUserList.filter(i => i.status === 'join')
+						}
+					},
+					err => {
+						this.$Message.error('user/setSchoolTeacher API error!')
+					}
+				)
+			},
 			/* 提取富文本内容中的文本 */
 			async getItemSimpleText(item) {
 				try {
@@ -550,7 +587,8 @@
 				this.addVolumeForm = {
 					grade: 0,
 					semester: 0,
-					name: ''
+					name: '',
+					auth:[]
 				}
 				this.isEditVolume = false
 				this.isAddVolumeModal = true
@@ -576,7 +614,8 @@
 				this.addVolumeForm = {
 					grade: this.curVolume.gradeId,
 					semester: this.semesterList.map(i => i.id).indexOf(this.curVolume.semesterId),
-					name: this.curVolume.name
+					name: this.curVolume.name,
+					auth:this.curVolume.auth.length ? this.curVolume.auth.map(i => i.tmdid) : []
 				}
 				this.isEditVolume = true
 				this.isAddVolumeModal = true
@@ -744,12 +783,22 @@
 				this.nodeInfo.creatorId = this.$store.state.userInfo.TEAMModelId
 				// 统一传给树形组件的数据结构
 				this.treeOrigin.push({
-					auth: null,
+					auth: this.isSchool ? [{
+						agree:0,
+						tmdid:this.$store.state.userInfo.TEAMModelId,
+						tmdname:this.$store.state.userInfo.name,
+						type:'coedit'
+					}] : [],
 					id: this.nodeInfo.id,
+					creatorId:this.$store.state.userInfo.TEAMModelId,
 					scope: this.curVolume.scope,
 					trees: [this.nodeInfo],
 					volumeId: this.curVolume.id,
-					rnodes:[]
+					rnodes: []
+				})
+				this.myCreateChapters.push({
+					name:this.nodeInfo.title,
+					id:this.nodeInfo.id
 				})
 				// 只要本地新增的章节 都要记录到修改数据里
 				this.$nextTick(() => {
@@ -760,8 +809,9 @@
 						"pid": "",
 						"title": "",
 						"type": 1,
+						"creatorId":this.$store.state.userInfo.TEAMModelId,
 						"children": [],
-						"rnodes":[]
+						"rnodes": []
 					}
 				})
 				this.hasModify = true;
@@ -786,23 +836,69 @@
 						codeval: this.curCode,
 						volumeId: this.curVolume.id,
 						scope: this.curVolume.scope,
+						creatorId:this.$store.state.userInfo.TEAMModelId,
 						trees: allChapter.find(i => i.id === id) ? [allChapter.find(i => i.id === id)] : []
 					}
 				}) : [];
 				this.allChapterIds = allChapter.map(i => i.id)
+				// 先保存树结构数据
 				this.$api.syllabus.UpsertTree(modifyChapters).then((res) => {
 					if (!res.error && res) {
+						// 然后保存册别的章节ID集合
 						this.handleSubmit().then(result => {
-							this.treeOrigin = res;
-							this.hasModify = false;
-							this.$refs.treeRef && (this.$refs.treeRef.modifyIdArr = [])
-							// this.isEditVolume = false
+							let promiseArr = []
+							if(this.myCreateChapters.length){
+								// 然后如果是自己新增的章节 则需要把自己加入到共编权限内
+								this.myCreateChapters.forEach(i => {
+									if(modifyIdArr.includes(i.id)){
+										promiseArr.push(this.doShareMyself(i.id,i.name))
+									}
+								})
+								Promise.all(promiseArr).then(shareResult => {
+									this.treeOrigin = res;
+									this.hasModify = false;
+									this.$refs.treeRef && (this.$refs.treeRef.modifyIdArr = [])
+								}).catch(err => {
+									this.$Message.error(err)
+								})
+							}
 						})
 					} else {
 						this.$Message.warning(this.$t('syllabus.saveFailTip'));
 					}
 				});
 			},
+			/* 新增的章节 需要把创建者加入到共编数据内 */
+			doShareMyself(id,name){
+				return new Promise((r,j) => {
+					let curVolume = this.curVolume
+					this.$api.syllabus.ShareTree({
+						"school": curVolume.school,
+						"scope": curVolume.scope,
+						"tmdInfo": [
+							{
+								"tmdid": this.$store.state.userInfo.TEAMModelId,
+								"tmdname": this.$store.state.userInfo.name
+							}
+						],
+						"type": 'coedit',
+						"issuer": this.$store.state.userInfo.TEAMModelId,
+						"opt": 'add',
+						"syllabusId": id,
+						"syllabusName":name,
+						"volumeId": curVolume.id,
+						"volumeName": curVolume.name
+					}).then(res => {
+						if(res.code === 200){
+							r(200)
+						}
+					}).catch(err => {
+						this.$Message.error(err)
+						j(err)
+					})
+				})
+				
+			},
 			/* 点击某个节点 */
 			onNodeClick(data) {
 				this.curChapter = this.getChapterByNode(data.node)
@@ -846,7 +942,7 @@
 				if (!/^(http:|https:)/i.test(curLink)) {
 					curLink = "http://" + curLink;
 				}
-				if(!this.isURL(curLink)){
+				if (!this.isURL(curLink)) {
 					this.$Message.warning(this.$t('evaluation.repairResourse.formatErrorTip'))
 					return
 				}
@@ -859,28 +955,39 @@
 					type: 'link',
 					ctnr: ''
 				})
+				this.$refs.treeRef.curData.creatorId = this.$store.state.userInfo.TEAMModelId
 				this.modifyIdArr.push(this.curChapter.data.id)
 				this.hasModify = true
 				this.isShowLinkModal = false
 			},
 			/* 判断是否为正确的链接地址 */
 			isURL(url) {
-			  const strRegex = '^((https|http|ftp)://)?'//(https或http或ftp):// 可有可无
-			  + '(([\\w_!~*\'()\\.&=+$%-]+: )?[\\w_!~*\'()\\.&=+$%-]+@)?' //ftp的user@ 可有可无
-			  + '(([0-9]{1,3}\\.){3}[0-9]{1,3}' // IP形式的URL- 3位数字.3位数字.3位数字.3位数字
-			  + '|' // 允许IP和DOMAIN(域名)
-			  + '(localhost)|'    //匹配localhost
-			  + '([\\w_!~*\'()-]+\\.)*' // 域名- 至少一个[英文或数字_!~*\'()-]加上.
-			  + '\\w+\\.' // 一级域名 -英文或数字 加上.
-			  + '[a-zA-Z]{1,6})' // 顶级域名- 1-6位英文
-			  + '(:[0-9]{1,5})?' // 端口- :80 ,1-5位数字
-			  + '((/?)|' // url无参数结尾 - 斜杆或这没有
-			  + '(/[\\w_!~*\'()\\.;?:@&=+$,%#-]+)+/?)$';//请求参数结尾- 英文或数字和[]内的各种字符
-			  const re = new RegExp(strRegex, 'i'); // 大小写不敏感
-			  if (re.test(encodeURI(url))) {
-			    return true;
-			  }
-			  return false;
+				const strRegex = '^((https|http|ftp)://)?' //(https或http或ftp):// 可有可无
+					+
+					'(([\\w_!~*\'()\\.&=+$%-]+: )?[\\w_!~*\'()\\.&=+$%-]+@)?' //ftp的user@ 可有可无
+					+
+					'(([0-9]{1,3}\\.){3}[0-9]{1,3}' // IP形式的URL- 3位数字.3位数字.3位数字.3位数字
+					+
+					'|' // 允许IP和DOMAIN(域名)
+					+
+					'(localhost)|' //匹配localhost
+					+
+					'([\\w_!~*\'()-]+\\.)*' // 域名- 至少一个[英文或数字_!~*\'()-]加上.
+					+
+					'\\w+\\.' // 一级域名 -英文或数字 加上.
+					+
+					'[a-zA-Z]{1,6})' // 顶级域名- 1-6位英文
+					+
+					'(:[0-9]{1,5})?' // 端口- :80 ,1-5位数字
+					+
+					'((/?)|' // url无参数结尾 - 斜杆或这没有
+					+
+					'(/[\\w_!~*\'()\\.;?:@&=+$,%#-]+)+/?)$'; //请求参数结尾- 英文或数字和[]内的各种字符
+				const re = new RegExp(strRegex, 'i'); // 大小写不敏感
+				if (re.test(encodeURI(url))) {
+					return true;
+				}
+				return false;
 			},
 			/* 点击添加关联内容 */
 			async onAddResource(type) {
@@ -994,7 +1101,7 @@
 						'private')
 					let schoolSas = await this.$tools.getSchoolSas()
 					let schoolBlobTool = new BlobTool(schoolSas.url, schoolSas.name, schoolSas.sas,
-						'school')	
+						'school')
 					let toClient = privateToSchool ? schoolBlobTool : privateBlobTool
 					let fromClient = privateToSchool ? privateBlobTool : schoolBlobTool
 					const itemJsonFile = await this.$evTools.createBlobItem(pItem);
@@ -1023,7 +1130,7 @@
 			onSelectQuestion(val) {
 				return new Promise((r, j) => {
 					let exRef = this.$refs.chooseContentRef.$refs.exListRef
-					let list =  exRef ? exRef.selectItems : []
+					let list = exRef ? exRef.selectItems : []
 					console.log('xxxxx', list)
 					if (!list.length) {
 						r(200)
@@ -1198,7 +1305,7 @@
 			onSelectPaper() {
 				return new Promise(async (r, j) => {
 					let paperRef = this.$refs.chooseContentRef.$refs.paperListRef
-					let list =  paperRef ? paperRef.checkedPaperList : []
+					let list = paperRef ? paperRef.checkedPaperList : []
 					if (!list.length) {
 						r(200)
 					} else {
@@ -1215,7 +1322,8 @@
 								if (schoolPaperList.map(i => i.name).includes(paper.name)) {
 									this.$Modal.confirm({
 										title: '提示',
-										content: this.$t('syllabus.copyTip1') + paper.name +
+										content: this.$t('syllabus.copyTip1') + paper
+											.name +
 											this.$t('syllabus.copyTip2'),
 										onOk: async () => {
 											// 继续进行操作完成试卷覆盖
@@ -1257,7 +1365,7 @@
 									// 拿到试卷的index.json 先完善学段科目年级信息后 去进行上传覆盖操作
 									let indexJsonFile = await this.$tools.getFile(this.$evTools
 										.getBlobHost() + '/' + paper.code.replace('Paper-',
-										'') + paper.blob + '/index.json' + privateSas.sas)
+											'') + paper.blob + '/index.json' + privateSas.sas)
 									let paperIndexJson = JSON.parse(indexJsonFile)
 									paperIndexJson.periodId = this.periodList[this
 										.currentPeriodIndex].id
@@ -1330,6 +1438,7 @@
 					this.isRelateContentModal = false
 					this.hasModify = true
 					this.modifyIdArr.push(this.curChapter.data.id)
+					this.$refs.treeRef.curData.creatorId = this.$store.state.userInfo.TEAMModelId
 				}).catch(err => {
 					console.log(err)
 					this.isRelateLoading = false
@@ -1394,7 +1503,7 @@
 						break;
 					case 'other':
 						this.$Message.warning(this.$t('syllabus.noPreview'))
-						break;	
+						break;
 					case 'doc':
 						let copyLink = JSON.parse(JSON.stringify(item.link))
 						let docSas = ''
@@ -1452,6 +1561,7 @@
 								this.$refs.treeRef.curData.rnodes.splice(index, 1)
 								this.hasModify = true
 								this.modifyIdArr.push(this.curChapter.data.id)
+								this.$refs.treeRef.curData.creatorId = this.$store.state.userInfo.TEAMModelId
 							}).catch(err => {
 								this.$Message.error(err)
 							}).finally(() => {
@@ -1489,9 +1599,13 @@
 			handleSubmit() {
 				return new Promise((r, j) => {
 					this.isAddLoading = true
-					console.log(this.addVolumeForm)
-					console.log(this.curVolume)
 					let addVolumeParams = {
+						"auth": this.addVolumeForm.auth.map(i => {
+							return {
+								tmdid: i,
+								tmdname: this.teacherList.find(j => j.id === i).name
+							}
+						}),
 						"code": this.curCode,
 						"periodId": this.isSchool ? this.periodList[this.currentPeriodIndex].id : null,
 						"subjectId": this.isSchool ? this.subjectList[this.activeSubjectIndex].id : null,
@@ -1523,7 +1637,8 @@
 							this.getVolumeList(true)
 							r(200)
 						} else {
-							this.$Message.warning(res.error === 4 ? this.$t('syllabus.isExistVolume') : res.error);
+							this.$Message.warning(res.error === 4 ? this.$t('syllabus.isExistVolume') : res
+								.error);
 						}
 					}).catch(err => {
 						// this.$Message.error(err);
@@ -1602,6 +1717,11 @@
 					return item.type !== 'item' && item.type !== 'paper' && item.type !== 'link'
 				}
 			},
+			hasVolumeAuth(){
+				return auth => {
+					return this.$access.can('admin.*|Syllabus_Edit') || auth.map(i => i.tmdid).includes(this.$store.state.userInfo.TEAMModelId)
+				}
+			},
 			hasEditAuth() {
 				return nodeData => {
 					if (!nodeData.id) return false
@@ -1610,7 +1730,7 @@
 					let chapterId = nodeData.pid === this.curVolume.id ? nodeData.id : this.getChapterIdById(nodeData
 						.id)
 					let chapterNode = this.treeOrigin.find(i => i.id === chapterId)
-					return this.curVolume.creatorId === userId || (chapterNode.auth && chapterNode.auth.length &&
+					return this.$access.can('admin.*|Syllabus_Edit') || this.curVolume.auth.map(i => i.tmdid).includes(userId) || (chapterNode.auth && chapterNode.auth.length &&
 						chapterNode.auth.map(i => i.tmdid).includes(userId))
 				}
 			},
@@ -1775,14 +1895,14 @@
 		color: #808080;
 	}
 
-	.form-container .ivu-select-single .ivu-select-selection {
+	.form-container .ivu-select-selection {
 		background: #575757;
 		color: #fbfbfb;
 		border-color: transparent;
 		height: 35px;
 	}
 
-	.form-container .ivu-select-single .ivu-select-arrow {
+	.form-container .ivu-select-arrow {
 		color: #fbfbfb;
 	}
 

+ 28 - 14
TEAMModelOS/Controllers/Common/ExamController.cs

@@ -1581,7 +1581,7 @@ namespace TEAMModelOS.Controllers
                 if (!requert.TryGetProperty("count", out JsonElement count)) return BadRequest();
                 if (!requert.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
-                var redisClient = _azureRedis.GetRedisClient(8);
+                //var redisClient = _azureRedis.GetRedisClient(8);
                 List<ExamClassResult> classResults = new();
                 List<SDK.Models.Cosmos.Common.Scoring> recs = new();
                 List<SDK.Models.Cosmos.Common.Scoring> all = new();
@@ -1598,7 +1598,7 @@ namespace TEAMModelOS.Controllers
                     {
                         recs.Add(scoring);
                     }
-                    else if(scoring.tIds.Count < 2) 
+                    else if (scoring.tIds.Count < scoring.marks.Count)
                     {
                         all.Add(scoring);
                     }
@@ -1689,8 +1689,17 @@ namespace TEAMModelOS.Controllers
                         }
                         //随机选取一名学生打分
                         Random random = new Random();
-                        int n = random.Next(all.Count);
-                        SDK.Models.Cosmos.Common.Scoring item = all[n];
+                        SDK.Models.Cosmos.Common.Scoring item = new();
+                        List<SDK.Models.Cosmos.Common.Scoring> notYet = new();
+                        notYet =  all.Where(x => x.tIds.Count < x.marks.Count - 1).ToList();
+                        if (notYet.Count > 0)
+                        {
+                            item = notYet[random.Next(notYet.Count)];
+                        }
+                        else
+                        {
+                            item = all[random.Next(all.Count)];
+                        }
 
                         if (!item.tIds.Contains(tId.ToString()))
                         {
@@ -1834,10 +1843,11 @@ namespace TEAMModelOS.Controllers
                         foreach (SDK.Models.Cosmos.Common.Scoring scoring in attr)
                         {
                             int index = scoring.tIds.IndexOf(tId.GetString());
-                            if (index != -1) {
+                            if (index != -1)
+                            {
                                 scoring.marks[index] = builder.ToString();
                             }
-                            
+
                         }
                     }
                 }
@@ -1849,17 +1859,19 @@ namespace TEAMModelOS.Controllers
                         int tIdIndex = scoring.tIds.IndexOf(tId.GetString());
                         foreach (Item item in scoring.items)
                         {
-                            item.scores[tIdIndex].sc = ssc[itemIndex];
-                            scoring.scores[itemIndex] = ssc[itemIndex];
-                            item.scores[tIdIndex].tmdId = tId.GetString();
-                            itemIndex++;
+                            if (tIdIndex > -1)
+                            {
+                                item.scores[tIdIndex].sc = ssc[itemIndex];
+                                item.scores[tIdIndex].tmdId = tId.GetString();
+                                itemIndex++;
+                            }
+
                         }
-                        
                         await client.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync(scoring, scoring.id, new PartitionKey(scoring.code));
 
                     }
                 }
-
+                //判定阅卷结算的条件
                 if (attr.Count == count.GetInt32())
                 {
                     await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryIterator<ExamClassResult>(
@@ -1875,9 +1887,11 @@ namespace TEAMModelOS.Controllers
                             int index = exam.studentIds.IndexOf(scoring.stuId);
                             //均分
                             int n = 0;
-                            foreach (Item item in scoring.items) {
+                            foreach (Item item in scoring.items)
+                            {
                                 //判定是否仲裁卷
-                                if (!item.flag) {
+                                if (!item.flag)
+                                {
                                     break;
                                 }
                                 double sc = item.scores.Select(x => x.sc).ToList().Aggregate((i, j) => (i + j) / item.scores.Count);