Browse Source

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

zhouj1203@hotmail.com 4 years ago
parent
commit
3375b3681d

+ 3 - 1
TEAMModelOS/ClientApp/src/locale/lang/zh-CN/teachermgmt.js

@@ -102,7 +102,9 @@ export default {
         'scboard-read': '查看校园分析',
         'schoolAc': '校园活动',
         'schoolAc-read': '查看校园活动',
-        'schoolAc-upd':'发布校园活动'
+        'schoolAc-upd':'发布校园活动',
+        'schoolEvaluation':'模拟评测数据',
+        'mock-eva':'一键模拟评测作答和评分数据'
     },
     modal:{
         text1: '此帐号权限已变更,是否要给此帐号更加合适的职称',

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

@@ -133,17 +133,6 @@
 				this.$refs.chooseContentRef.clickTab('content')
 			}
 		},
-
-		watch: {
-			datas:{
-				handler(n,o){
-					// console.log('监听到资源',n)
-				},
-				deep:true,
-				immediate:true
-			}
-		}
-
 	}
 </script>
 

+ 5 - 1
TEAMModelOS/ClientApp/src/view/evaluation/index/CreateExercises.vue

@@ -228,7 +228,11 @@
 
 			onSelectPoints() {
 				if (this.hasSchool) {
-					this.selectPointsModal = true
+					if(this.exersicesType === 'compose'){
+						this.$Message.warning('综合题的知识点请绑定在小题上!')
+					}else{
+						this.selectPointsModal = true
+					}
 				} else {
 					this.$Message.warning('您当前未加入学校,无法选择知识点!')
 				}

+ 4 - 2
TEAMModelOS/ClientApp/src/view/knowledge-point/index/Index.vue

@@ -603,9 +603,10 @@
 						let that = this
 						this.isLoading = true
 						this.$api.knowledge.DeleteSchoolPoint({
+							code:data.code.replace('Knowledge-',''),
 							id: data.id
 						}).then(res => {
-							if (res.knowledges) {
+							if (!res.error) {
 								console.log(this.blockList)
 								console.log(this.originBlockList)
 								console.log(data)
@@ -640,9 +641,10 @@
 					onOk: () => {
 						this.isLoadPoints = true
 						this.$api.knowledge.DeleteSchoolPoint({
+							code:data.code.replace('Knowledge-',''),
 							id: data.id
 						}).then(res => {
-							if (!res.error && res.knowledges) {
+							if (!res.error) {
 								this.$Message.success('删除成功')
 								this.originPointList.splice(this.originPointList.indexOf(data), 1)
 								if (!this.isShowPoints) this.currentBlock.points.splice(this.currentBlock.points.indexOf(data.id), 1)

+ 36 - 3
TEAMModelOS/ClientApp/src/view/learnactivity/MgtSchoolEva.vue

@@ -60,12 +60,12 @@
                 <div class="evaluation-detail-bar">
                     <span :class="curBarIndex == 0 ? 'evalustion-bar-item line-bottom-active line-bottom':'evalustion-bar-item line-bottom'" @click="selectBar(0)">评测数据</span>
                     <span :class="curBarIndex == 1 ? 'evalustion-bar-item line-bottom-active line-bottom':'evalustion-bar-item line-bottom'" @click="selectBar(1)">评测试卷</span>
-                    <div style="float:right;">
+                    <div style="float:right;" v-if="$access.ability('admin','mock-eva').validateAll">
                         <Tooltip content="此功能仅用于展示情景快速模拟学生作答数据,且学生作答为随机生成,仅供参考!!!" :max-width="240">
-                            <Button type="success" size="small" class="mock-stu-answer" @click="mockAnswer">一键作答</Button>
+                            <Button type="success" size="small" :loading="answerLoading" class="mock-stu-answer" @click="mockAnswer">一键作答</Button>
                         </Tooltip>
                         <Tooltip content="此功能仅用于展示情景快速模拟教师评分数据,且分数为随机生成,仅供参考!!!" :max-width="240">
-                            <Button type="warning" size="small" class="mock-tea-scoring" @click="mockScoring">一键评分</Button>
+                            <Button type="warning" size="small" :loading="scoreLoading" class="mock-tea-scoring" @click="mockScoring">一键评分</Button>
                         </Tooltip>
                     </div>
                 </div>
@@ -109,8 +109,11 @@ export default {
         TestPaper,
         Scoring
     },
+    inject:['reload'],
     data() {
         return {
+            answerLoading: false,
+            scoreLoading: false,
             split1: 0.2,
             scope: '',//school 校本 private 个人
             showBack: false,
@@ -146,16 +149,46 @@ export default {
     methods: {
         // 模拟教师评分数据
         mockScoring() {
+            this.scoreLoading = true
             this.$api.learnActivity.mockScoring({
                 id: this.evaListShow[this.curEvaIndex].id,
                 code: this.evaListShow[this.curEvaIndex].code.replace('Exam-', '')
+            }).then(
+                res => {
+                    setTimeout(() => {
+                        this.$Message.success('模拟成功')
+                    }, 500)
+                },
+                err => {
+                    this.$Message.error('模拟失败')
+                }
+            ).finally(() => {
+                setTimeout(() => {
+                    this.scoreLoading = false
+                    this.reload()
+                }, 500)
             })
         },
         // 模拟学生作答数据
         mockAnswer() {
+            this.answerLoading = true
             this.$api.learnActivity.mockAnswer({
                 id: this.evaListShow[this.curEvaIndex].id,
                 code: this.evaListShow[this.curEvaIndex].code.replace('Exam-', '')
+            }).then(
+                res => {
+                    setTimeout(() => {
+                        this.$Message.success('模拟成功')
+                    }, 500)
+                },
+                err => {
+                    this.$Message.error('模拟失败')
+                }
+            ).finally(() => {
+                setTimeout(() => {
+                    this.answerLoading = false
+                    this.reload()
+                }, 500)
             })
         },
         handleEnd(index) {

+ 1 - 1
TEAMModelOS/ClientApp/src/view/learnactivity/PaperScore.vue

@@ -141,7 +141,7 @@
                                                 </div>
                                                 <!-- 其余题型答案 -->
                                                 <div v-else>
-                                                    <span :class="[ item.type === 'complete' ? 'item-answer-item':'']" v-for="(answer,index) in item.answer" :key="index">{{answer}}</span>
+                                                    <span v-for="(answer,index) in item.answer" :key="index" v-html="answer"></span>
                                                 </div>
                                             </div>
                                         </div>

+ 29 - 1
TEAMModelOS/Controllers/Item/ItemController.cs

@@ -610,8 +610,36 @@ namespace TEAMModelOS.Controllers
                             itemInfos.Remove(itemInfo);
                         }
                     }
+                   
+                    List<ItemInfo> restItem = new List<ItemInfo>();
+                    //处理综合题问题
+                    foreach (var item in retnInfos) {
+                        if (!string.IsNullOrWhiteSpace(item.pid))
+                        {
+                            if (item.scope == "school")
+                            {
+                                var iteme = await client.GetContainer("TEAMModelOS", "School").ReadItemAsync<ItemInfo>(item.id, new PartitionKey(item.code));
+                                if (iteme != null) {
+                                    restItem.Add(iteme.Value);
+                                }
+                               
+                            }
+                            else if (item.scope == "private") {
+                                var iteme = await client.GetContainer("TEAMModelOS", "Teacher").ReadItemAsync<ItemInfo>(item.id, new PartitionKey(item.code));
+                                if (iteme != null)
+                                {
+                                    restItem.Add(iteme.Value);
+                                }
+                            }
+                        }
+                        else {
+                            restItem.Add(item);
+                        }
+                    }
                     List<List<ItemInfo>> listInfo = new List<List<ItemInfo>>();
-                    foreach (IGrouping<string, ItemInfo> group in retnInfos.GroupBy(c => c.type))
+                    //处理综合题id重复
+                    restItem = restItem.Where((x, i) => restItem.FindIndex(z => z.id == x.id) == i).ToList();
+                    foreach (IGrouping<string, ItemInfo> group in restItem.GroupBy(c => c.type))
                     {
                         Dictionary<string, object> dictInfo = new Dictionary<string, object>();
                         listInfo.Add(group.ToList());

+ 1 - 0
TEAMModelOS/Controllers/knowledge/KnowledgeController.cs

@@ -288,6 +288,7 @@ namespace TEAMModelOS.Controllers
                 if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 await client.GetContainer("TEAMModelOS", "School").DeleteItemStreamAsync(id.ToString(), new PartitionKey($"Knowledge-{code}"));
+                return Ok(id);
             } catch (Exception ex) {
                 await _dingDing.SendBotMsg($"knowledge,{_option.Location},delete()\n{ex.Message}", GroupNames.醍摩豆服務運維群組);
                 return BadRequest();

+ 1 - 1
TEAMModelOS/TEAMModelOS.csproj

@@ -7,7 +7,7 @@
     <PackageReference Include="Caching.CSRedis" Version="3.6.50" />
     <PackageReference Include="CSRedisCore" Version="3.6.5" />
     <PackageReference Include="DotNetZip" Version="1.15.0" />
-    <PackageReference Include="HTEXLib" Version="2.1.7" />
+    <PackageReference Include="HTEXLib" Version="2.2.2" />
     <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.6" />
       <PackageReference Include="VueCliMiddleware" Version="3.1.2" />  </ItemGroup>
   <PropertyGroup>