소스 검색

Merge branch 'develop' of http://52.130.252.100:10000/TEAMMODEL/TEAMModelOS into develop

CrazyIter_Bin 1 년 전
부모
커밋
4165298310

+ 4 - 4
TEAMModelOS.FunctionV4/CosmosDB/TriggerArt.cs

@@ -251,10 +251,10 @@ namespace TEAMModelOS.FunctionV4.CosmosDB
                             {
                                 await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-艺术评测going{e.Message}\n{e.StackTrace}", GroupNames.醍摩豆服務運維群組);
                             }
-                           /* finally {
+                            finally {
                                 string pkey = string.Format("{0}{1}{2}", art.code, "-", "pending");
                                 await table.DeleteSingle<ChangeRecord>(pkey, tdata.id);
-                            }*/
+                            }
                             
 
                             break;
@@ -797,11 +797,11 @@ namespace TEAMModelOS.FunctionV4.CosmosDB
                             } catch (Exception e) {
                                 await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-艺术评测finish{e.Message}\n{e.StackTrace}", GroupNames.醍摩豆服務運維群組);
                             }
-                           /* finally
+                            finally
                             {
                                 string pk = string.Format("{0}{1}{2}", art.code, "-", "going");
                                 await table.DeleteSingle<ChangeRecord>(pk, tdata.id);
-                            }*/
+                            }
                             
 
                             break;

+ 4 - 4
TEAMModelOS.FunctionV4/CosmosDB/TriggerExam.cs

@@ -398,9 +398,9 @@ namespace TEAMModelOS.FunctionV4
                             finally
                             {
                                 try {
-                                    /*//新增serviceBus 消息释放后处理table
+                                    //新增serviceBus 消息释放后处理table
                                     string pkey = string.Format("{0}{1}{2}", info.code, "-", "pending");
-                                    await table.DeleteSingle<ChangeRecord>(pkey, data.id);*/
+                                    await table.DeleteSingle<ChangeRecord>(pkey, data.id);
                                     // 发送信息通知
                                     var messageEnd = new ServiceBusMessage(new { id = data.id, progress = "finish", code = data.code }.ToJsonString());
                                     messageEnd.ApplicationProperties.Add("name", "Exam");
@@ -556,11 +556,11 @@ namespace TEAMModelOS.FunctionV4
                             {
                                 await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-{info.id}-评测finish状态异常{e.Message}\n{e.StackTrace}\n", GroupNames.醍摩豆服務運維群組);
                             }
-                           /* finally {
+                            finally {
                                 //新增serviceBus 消息释放后处理table
                                 string pk = string.Format("{0}{1}{2}", info.code, "-", "going");
                                 await table.DeleteSingle<ChangeRecord>(pk, data.id);
-                            }*/
+                            }
                             break;
                     }
                 }

+ 4 - 4
TEAMModelOS.FunctionV4/CosmosDB/TriggerHomework.cs

@@ -139,10 +139,10 @@ namespace TEAMModelOS.FunctionV4
                             } catch (Exception e) {
                                 await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}研修作业活动going{e.Message}\n{e.StackTrace}", GroupNames.醍摩豆服務運維群組);
                             }
-                            /*finally {
+                            finally {
                                 string pkey = string.Format("{0}{1}{2}", work.code, "-", "pending");
                                 await table.DeleteSingle<ChangeRecord>(pkey, tdata.id);
-                            }*/
+                            }
                             
                             
                             //if (bustasks.IsNotEmpty())
@@ -176,10 +176,10 @@ namespace TEAMModelOS.FunctionV4
                             } catch (Exception e) {
                                 await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}研修作业活动finish{e.Message}\n{e.StackTrace}", GroupNames.醍摩豆服務運維群組);
 
-                            } /*finally {
+                            } finally {
                                 string pk = string.Format("{0}{1}{2}", work.code, "-", "going");
                                 await table.DeleteSingle<ChangeRecord>(pk, tdata.id);
-                            }*/
+                            }
                             
                                                 
                             break;

+ 4 - 4
TEAMModelOS.FunctionV4/CosmosDB/TriggerStudy.cs

@@ -222,10 +222,10 @@ namespace TEAMModelOS.FunctionV4
                             {
                                 await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}研修活动异常-going {ex.Message}\n{ex.StackTrace}{tdata.ToJsonString()}{input}", GroupNames.醍摩豆服務運維群組);
                             }
-                            /*finally {
+                            finally {
                                 string pk = string.Format("{0}{1}{2}", study.code, "-", "pending");
                                 await table.DeleteSingle<ChangeRecord>(pk, tdata.id);
-                            }*/
+                            }
                            
                             break;
                         case "finish":
@@ -257,10 +257,10 @@ namespace TEAMModelOS.FunctionV4
                             {
                                 await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}研修活动异常-finish {e.Message}\n{e.StackTrace}{tdata.ToJsonString()}{input}", GroupNames.醍摩豆服務運維群組);
                             }
-                           /* finally {
+                            finally {
                                 string pk = string.Format("{0}{1}{2}", study.code, "-", "going");
                                 await table.DeleteSingle<ChangeRecord>(pk, tdata.id);
-                            }*/
+                            }
                             break;
                     }
                 }

+ 4 - 4
TEAMModelOS.FunctionV4/CosmosDB/TriggerSurvey.cs

@@ -300,8 +300,8 @@ namespace TEAMModelOS.FunctionV4
 #endif                           
                             var messageSurveyEnd = new ServiceBusMessage(new { id = tdata.id, progress = "finish", code = tdata.code }.ToJsonString());
                             messageSurveyEnd.ApplicationProperties.Add("name", "Survey");
-                           /* string pkey = string.Format("{0}{1}{2}", survey.code, "-", "pending");
-                            await table.DeleteSingle<ChangeRecord>(pkey, tdata.id);*/
+                            string pkey = string.Format("{0}{1}{2}", survey.code, "-", "pending");
+                            await table.DeleteSingle<ChangeRecord>(pkey, tdata.id);
                             if (changeRecords.Count > 0)
                             {
                                 long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync(Environment.GetEnvironmentVariable("Azure:ServiceBus:ActiveTask"), messageSurveyEnd, DateTimeOffset.FromUnixTimeMilliseconds(tdata.endTime));
@@ -475,8 +475,8 @@ namespace TEAMModelOS.FunctionV4
                                 _azureRedis.GetRedisClient(8).KeyDelete($"Survey:Submit:{survey.id}");
                                 break;
                             }
-                            /*string pk = string.Format("{0}{1}{2}", survey.code, "-", "going");
-                            await table.DeleteSingle<ChangeRecord>(pk, tdata.id);*/
+                            string pk = string.Format("{0}{1}{2}", survey.code, "-", "going");
+                            await table.DeleteSingle<ChangeRecord>(pk, tdata.id);
                             //更新结束状态
                             //data.progress = "finish";
                             //if (survey.scope .Equals("school"))

+ 4 - 4
TEAMModelOS.FunctionV4/CosmosDB/TriggerVote.cs

@@ -304,8 +304,8 @@ namespace TEAMModelOS.FunctionV4
                             #endregion
                             var messageVoteEnd = new ServiceBusMessage(new { id = tdata.id, progress = "finish", code = tdata.code }.ToJsonString());
                             messageVoteEnd.ApplicationProperties.Add("name", "Vote");
-                           /* string pk = string.Format("{0}{1}{2}", vote.code, "-", "pending");
-                            await table.DeleteSingle<ChangeRecord>(pk, tdata.id);*/
+                            string pk = string.Format("{0}{1}{2}", vote.code, "-", "pending");
+                            await table.DeleteSingle<ChangeRecord>(pk, tdata.id);
                             if (voteRecords.Count > 0)
                             {
                                 long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync(Environment.GetEnvironmentVariable("Azure:ServiceBus:ActiveTask"), messageVoteEnd, DateTimeOffset.FromUnixTimeMilliseconds(tdata.endTime));
@@ -398,8 +398,8 @@ namespace TEAMModelOS.FunctionV4
                                 break;
                             }
                             await Task.WhenAll(tasks);
-                          /*  string pkey = string.Format("{0}{1}{2}", vote.code, "-", "going");
-                            await table.DeleteSingle<ChangeRecord>(pkey, tdata.id);*/
+                            string pkey = string.Format("{0}{1}{2}", vote.code, "-", "going");
+                            await table.DeleteSingle<ChangeRecord>(pkey, tdata.id);
                             break;
                     }
                 }

+ 80 - 9
TEAMModelOS.SDK/Models/Service/Third/ThirdService.cs

@@ -884,7 +884,7 @@ namespace TEAMModelOS.SDK.Models
         }
 
 
-        public static async Task<string> CreateMoofenExam(IHttpClientFactory _httpClient, JsonElement json)
+        public static async Task<string> CreateMoofenExam(IHttpClientFactory _httpClient, JsonElement json,DingDing _ding)
         {
             string content = string.Empty;
             try {
@@ -928,10 +928,9 @@ namespace TEAMModelOS.SDK.Models
                 dict.Add("signKey", "TMD");
                 var keys = dict.Keys.OrderBy(x => x);
                 var parmas = string.Join("&", keys.Select(x => $"{x}={dict[x]}"));
-                var signtime = DateTimeOffset.UtcNow.GetGMTTime(8).ToUnixTimeSeconds();
-                parmas = $"{parmas}&signtime={signtime}";
-                string sign = Md5Hash.Encrypt(parmas);
-                dict.Add("signtime", $"{signtime}");
+                //var signtime = DateTimeOffset.UtcNow.GetGMTTime(8).ToUnixTimeSeconds();
+                //parmas = $"{parmas}&signtime={signtime}";
+                string sign = Md5Hash.Encrypt(parmas);                
                 dict.Add("sign", $"{sign}");
                 dict.Remove("signKey");
                 //var pkeys = dict.Keys;
@@ -940,13 +939,13 @@ namespace TEAMModelOS.SDK.Models
                 var httpClient = _httpClient.CreateClient();
                 var request = new HttpRequestMessage
                 {
-                     Method = new HttpMethod("POST"),
+                    Method = new HttpMethod("POST"),
                     RequestUri = new Uri(url),
-                    Content = new FormUrlEncodedContent(dict)
+                    Content = new StringContent(JsonConvert.SerializeObject(dict))
                 };
                 // 设置请求头中的Content-Type
                 //  httpClient.DefaultRequestHeaders.Add("Content-Type", "application/x-www-form-urlencoded");
-                var mediaTypeHeader = new MediaTypeHeaderValue("application/x-www-form-urlencoded")
+                var mediaTypeHeader = new MediaTypeHeaderValue("application/json")
                 {
                     CharSet = "UTF-8"
                 };
@@ -963,11 +962,73 @@ namespace TEAMModelOS.SDK.Models
 
                 }
             } catch (Exception e) {
-                return "";
+                await _ding.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")},ThirdService/CreateMoofenExam()\n{e.Message}\n{e.StackTrace}", GroupNames.成都开发測試群組);
             }
             return "";
         }
 
+        public static async Task<List<stuAns>> CreateMoofenExamResult(IHttpClientFactory _httpClient, JsonElement json, DingDing _ding)
+        {
+            string content = string.Empty;
+            List<stuAns> ans = new();
+            try
+            {
+                Dictionary<string, string> dict = new Dictionary<string, string>();
+                if (json.TryGetProperty("examCode", out JsonElement examCode) && !string.IsNullOrWhiteSpace($"{examCode}"))
+                {
+                    dict.Add("examName", $"{examCode}");
+                }                
+                if (json.TryGetProperty("subjects", out JsonElement subjects) && subjects.ValueKind.Equals(JsonValueKind.Array))
+                {
+                    dict.Add("subjects", $"{subjects}");
+                }
+                dict.Add("signKey", "TMD");
+                var keys = dict.Keys.OrderBy(x => x);
+                var parmas = string.Join("&", keys.Select(x => $"{x}={dict[x]}"));
+                //var signtime = DateTimeOffset.UtcNow.GetGMTTime(8).ToUnixTimeSeconds();
+                //parmas = $"{parmas}&signtime={signtime}";
+                string sign = Md5Hash.Encrypt(parmas);
+                dict.Add("sign", $"{sign}");
+                dict.Remove("signKey");
+                //var pkeys = dict.Keys;
+                string url = "https://www.moofen.net/oss/esi/exam/tmodel/result";
+                //parmas = string.Join("&", pkeys.Select(x => $"{x}={dict[x]}"));
+                var httpClient = _httpClient.CreateClient();
+                var request = new HttpRequestMessage
+                {
+                    Method = new HttpMethod("POST"),
+                    RequestUri = new Uri(url),
+                    Content = new StringContent(JsonConvert.SerializeObject(dict))
+                };
+                // 设置请求头中的Content-Type
+                //  httpClient.DefaultRequestHeaders.Add("Content-Type", "application/x-www-form-urlencoded");
+                var mediaTypeHeader = new MediaTypeHeaderValue("application/json")
+                {
+                    CharSet = "UTF-8"
+                };
+                httpClient.Timeout = new TimeSpan(0, 0, 10);
+                request.Content.Headers.ContentType = mediaTypeHeader;
+                HttpResponseMessage response = await _httpClient.CreateClient().SendAsync(request);
+                if (response.StatusCode.Equals(HttpStatusCode.OK))
+                {
+                    content = await response.Content.ReadAsStringAsync();
+
+                    var data = content.ToObject<JsonElement>();
+                    if (data.TryGetProperty("data", out JsonElement _data))
+                    {
+                        ans = _data.ToObject<List<stuAns>>();
+                        return ans;
+                    }
+
+                }
+            }
+            catch (Exception e)
+            {
+                await _ding.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")},ThirdService/CreateMoofenExamResult()\n{e.Message}\n{e.StackTrace}", GroupNames.成都开发測試群組);
+            }
+            return ans;
+        }
+
         /* private class item
          {
              public string questionNo { get; set; }
@@ -988,5 +1049,15 @@ namespace TEAMModelOS.SDK.Models
             public string code { get; set; }
             public double value { get; set; }
         }
+        public class stuAns { 
+            public string stuId { get; set; }
+            public List<moofenAns> scoreData { get; set; } = new List<moofenAns>();
+        }
+        public class moofenAns
+        {
+            public double questionNo { get; set; }
+            public double score  { get; set; }
+            public string answer { get; set; }
+        }
     }
 }

+ 1 - 1
TEAMModelOS/ClientApp/public/lang/en-US.js

@@ -1627,7 +1627,7 @@ const LANG_EN_US = {
             ans: 'Answer',
             tip6: 'Enter the answer',
             tip7: 'Switching will clear the current question data, do you confirm to switch?',
-            tip8: 'Maximum 50 questions!',
+            tip8: 'Maximum 50 questions of this type!',
             tip9: 'Enter the speaking prompt',
             tip10: 'The number of questions cannot be 0!',
             tip11: 'The number of answers for single answer questions does not match the number of questions, please check and retry!',

+ 1 - 1
TEAMModelOS/ClientApp/public/lang/zh-CN.js

@@ -1627,7 +1627,7 @@ const LANG_ZH_CN = {
             tip6:'输入题目答案',
             tip7:'切换模式将会清空当前试题数据,是否确认切换?',
             tip13:'切换模式将会清空当前客观题答案,是否确认切换?',
-            tip8:'最多添加50道试题',
+            tip8:'最多添加50道该类型试题',
             tip9:'输入音频题正确答案',
             tip10:'试题数量不可为空!',
             tip11: '单选题答案数与题目数不一致,请检查后重试!',

+ 1 - 1
TEAMModelOS/ClientApp/public/lang/zh-TW.js

@@ -1629,7 +1629,7 @@ const LANG_ZH_TW = {
             ans: '參考答案',
             tip6: '輸入題目答案',
             tip7: '切換模式將會清除目前試題資料,是否確認切換? ',
-            tip8: '最多增加50個試題',
+            tip8: '最多增加50個當前題型試題',
             tip9: '輸入錄音題文字提示',
             tip10: '試題數量不可為0!',
             tip11: '單選題答案數與題目數不一致,請檢查後重試!',

+ 2 - 2
TEAMModelOS/ClientApp/src/common/BaseQuickPaper.vue

@@ -328,7 +328,7 @@
 			},
 			/* 手动添加试题 */
 			doAddItem(type) {
-				if (this.orderItemsArr.length >= 50) {
+				if (this.orderItemsArr.filter(i => i.type === type).length >= 50) {
 					this.$Message.warning(this.$t("evaluation.quickPaper.tip8"));
 					return;
 				}
@@ -599,7 +599,7 @@
 				}
 				const isLt5M = file.size / 1024 / 1024 < 5;
 				if (!isLt5M) {
-					this.$Message.warning(this.$t('platform.sizeErr') + '5M');
+					this.$Message.warning(this.$t('platform.sizeErr') + ' 5M');
 					return;
 				}
 				let that = this;

+ 1 - 1
TEAMModelOS/ClientApp/src/components/evaluation/ExerciseList.less

@@ -178,7 +178,7 @@
     .item-question-order {
       display: inline-block;
       vertical-align: top;
-      width: 30px;
+      width: 32px;
     }
 
     .item-question-text {

+ 1 - 1
TEAMModelOS/ClientApp/src/components/selflearn/ExerciseList.less

@@ -144,7 +144,7 @@
       .item-question-order {
         display: inline-block;
         vertical-align: top;
-        width: 30px;
+        width: 32px;
       }
       .item-question-text {
         display: inline-block;

+ 116 - 142
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseCreateChild.vue

@@ -9,14 +9,13 @@
 			</div>
 			<div class="exersices-attr my-radio-style">
 				<IconText :text="$t('evaluation.newExercise.knowledge')" :color="'#00b8ff'" :icon="'md-infinite'"></IconText>
-				<Button type="info" style="margin-top: 20px" @click="onSelectPoints" v-if="exercisePoints.length === 0">{{$t('evaluation.newExercise.choosePoint')}}</Button>
+				<Button type="info" style="margin-top: 20px" @click="onSelectPoints" v-if="exercisePoints.length === 0">{{ $t("evaluation.newExercise.choosePoint") }}</Button>
 				<div v-else style="margin-top: 10px">
 					<span v-for="(item, index) in exercisePoints" :key="index" class="exercise-item-point">
 						{{ item }}
-						<span class="exercise-item-point-close">
-							<Icon type="md-close" @click="onDeletePoint(index)" /></span>
+						<span class="exercise-item-point-close"> <Icon type="md-close" @click="onDeletePoint(index)" /></span>
 					</span>
-					<span class="exercise-item-point-modify" @click="selectPointsModal = true">{{ $t('evaluation.newExercise.modify') }}</span>
+					<span class="exercise-item-point-modify" @click="selectPointsModal = true">{{ $t("evaluation.newExercise.modify") }}</span>
 				</div>
 			</div>
 		</div>
@@ -24,34 +23,34 @@
 			<div class="exersices-attr my-radio-style">
 				<IconText :text="$t('evaluation.newExercise.type')" :color="'#00b8ff'" :icon="'md-pricetags'"></IconText>
 				<RadioGroup v-model="exersicesType" type="button" @on-change="typeChange">
-					<Radio label="single" :disabled="isEdit">{{ $t('evaluation.single') }}</Radio>
-					<Radio label="multiple" :disabled="isEdit">{{ $t('evaluation.multiple') }}</Radio>
-					<Radio label="judge" :disabled="isEdit">{{ $t('evaluation.judge') }}</Radio>
-					<Radio label="complete" :disabled="isEdit">{{ $t('evaluation.complete') }}</Radio>
-					<Radio label="subjective" :disabled="isEdit">{{ $t('evaluation.subjective') }}</Radio>
-					<Radio label="connector" :disabled="isEdit">{{ $t('evaluation.connector') }}</Radio>
-					<Radio label="correct" :disabled="isEdit">{{ $t('evaluation.correct') }}</Radio>
+					<Radio label="single" :disabled="isEdit">{{ $t("evaluation.single") }}</Radio>
+					<Radio label="multiple" :disabled="isEdit">{{ $t("evaluation.multiple") }}</Radio>
+					<Radio label="judge" :disabled="isEdit">{{ $t("evaluation.judge") }}</Radio>
+					<Radio label="complete" :disabled="isEdit">{{ $t("evaluation.complete") }}</Radio>
+					<Radio label="subjective" :disabled="isEdit">{{ $t("evaluation.subjective") }}</Radio>
+					<Radio label="connector" :disabled="isEdit">{{ $t("evaluation.connector") }}</Radio>
+					<Radio label="correct" :disabled="isEdit">{{ $t("evaluation.correct") }}</Radio>
 				</RadioGroup>
 			</div>
 			<div class="exersices-attr edit-exersices-attr-diff my-radio-style">
 				<IconText :text="$t('evaluation.newExercise.diff')" :color="'#00b8ff'" :icon="'md-pulse'"></IconText>
 				<RadioGroup v-model="exersicesDiff" type="button">
-					<Radio label="1" @click.native="diffChange($event, '1')">{{$t('evaluation.diff1')}}</Radio>
-					<Radio label="2" @click.native="diffChange($event, '2')">{{$t('evaluation.diff2')}}</Radio>
-					<Radio label="3" @click.native="diffChange($event, '3')">{{$t('evaluation.diff3')}}</Radio>
-					<Radio label="4" @click.native="diffChange($event, '4')">{{$t('evaluation.diff4')}}</Radio>
-					<Radio label="5" @click.native="diffChange($event, '5')">{{$t('evaluation.diff5')}}</Radio>
+					<Radio label="1" @click.native="diffChange($event, '1')">{{ $t("evaluation.diff1") }}</Radio>
+					<Radio label="2" @click.native="diffChange($event, '2')">{{ $t("evaluation.diff2") }}</Radio>
+					<Radio label="3" @click.native="diffChange($event, '3')">{{ $t("evaluation.diff3") }}</Radio>
+					<Radio label="4" @click.native="diffChange($event, '4')">{{ $t("evaluation.diff4") }}</Radio>
+					<Radio label="5" @click.native="diffChange($event, '5')">{{ $t("evaluation.diff5") }}</Radio>
 				</RadioGroup>
 			</div>
 		</div>
 
 		<BaseSingle v-if="exersicesType === 'single'" ref="single" :editInfo="editInfo"></BaseSingle>
 		<BaseMultiple v-else-if="exersicesType === 'multiple'" ref="multiple" :editInfo="editInfo"></BaseMultiple>
-		<BaseJudge v-else-if="exersicesType === 'judge'" ref="judge" :editInfo="editInfo" ></BaseJudge>
-		<BaseCompletion v-else-if="exersicesType === 'complete'" ref="complete" :editInfo="editInfo" ></BaseCompletion>
-		<BaseConnector v-else-if="exersicesType === 'connector'" ref="connector" :editInfo="editInfo" ></BaseConnector>
-		<BaseCorrect v-else-if="exersicesType === 'correct'" ref="correct" :editInfo="editInfo" ></BaseCorrect>
-		<BaseSubjective v-else-if="exersicesType === 'subjective'" ref="subjective" :editInfo="editInfo" ></BaseSubjective>
+		<BaseJudge v-else-if="exersicesType === 'judge'" ref="judge" :editInfo="editInfo"></BaseJudge>
+		<BaseCompletion v-else-if="exersicesType === 'complete'" ref="complete" :editInfo="editInfo"></BaseCompletion>
+		<BaseConnector v-else-if="exersicesType === 'connector'" ref="connector" :editInfo="editInfo"></BaseConnector>
+		<BaseCorrect v-else-if="exersicesType === 'correct'" ref="correct" :editInfo="editInfo"></BaseCorrect>
+		<BaseSubjective v-else-if="exersicesType === 'subjective'" ref="subjective" :editInfo="editInfo"></BaseSubjective>
 
 		<!-- 解析的富文本部分 -->
 		<div class="exersices-analysis child-exercise-analysis">
@@ -68,13 +67,12 @@
 		</div>
 
 		<div class="save-wrap display-flex">
-			<Button type="success" @click="getContent(exersicesType)" :loading="saveLoading">{{ $t('evaluation.newExercise.save') }}</Button>
+			<Button type="success" @click="getContent(exersicesType)" :loading="saveLoading">{{ $t("evaluation.newExercise.save") }}</Button>
 		</div>
 
 		<!-- 选择知识点弹窗 -->
 		<Modal v-model="selectPointsModal" :title="$t('evaluation.newExercise.choosePoint')" width="600px" footer-hide class="related-point-modal" style="z-index: 99999">
-			<BasePoints v-if="selectPointsModal" ref="pointRef" :period="schoolInfo.period[curPeriodIndex].id" :subject="schoolInfo.period[curPeriodIndex].subjects[curSubjectIndex].id"
-			 @onCheckChange="onCheckChange" @onCancel="selectPointsModal = false" :points="exercisePoints" :scope="curScope"></BasePoints>
+			<BasePoints v-if="selectPointsModal" ref="pointRef" :period="schoolInfo.period[curPeriodIndex].id" :subject="schoolInfo.period[curPeriodIndex].subjects[curSubjectIndex].id" @onCheckChange="onCheckChange" @onCancel="selectPointsModal = false" :points="exercisePoints" :scope="curScope"></BasePoints>
 		</Modal>
 	</div>
 </template>
@@ -86,8 +84,8 @@
 	import BaseCompletion from "@/view/evaluation/types/BaseCompletion.vue";
 	import BaseJudge from "@/view/evaluation/types/BaseJudge.vue";
 	import BaseSubjective from "@/view/evaluation/types/BaseSubjective.vue";
-    import BaseCorrect from "@/view/evaluation/types/BaseCorrect.vue";
-    import BaseConnector from "@/view/evaluation/types/BaseConnector.vue";
+	import BaseCorrect from "@/view/evaluation/types/BaseCorrect.vue";
+	import BaseConnector from "@/view/evaluation/types/BaseConnector.vue";
 	import NewChooseContent from "@/components/selflearn/NewChooseContent";
 	import E from "wangeditor";
 	// 默认创建题目模板
@@ -98,9 +96,12 @@
 		answer: [],
 		explain: "",
 		type: "",
+		answerType: "text",
+		useAutoScore: false,
+		answerLang: "en-US"
 	};
 	export default {
-		name:'BaseCreateChild',
+		name: "BaseCreateChild",
 		components: {
 			IconText,
 			BaseSingle,
@@ -110,25 +111,25 @@
 			BaseSubjective,
 			BaseCorrect,
 			BaseConnector,
-			NewChooseContent,
+			NewChooseContent
 		},
 		props: {
 			editItem: {
 				type: Object,
-				default: null,
+				default: null
 			},
 			refId: {
 				type: String,
-				default: "createChild",
+				default: "createChild"
 			},
 			curPeriodIndex: {
 				type: Number,
-				default: 0,
+				default: 0
 			},
 			curSubjectIndex: {
 				type: Number,
-				default: 0,
-			},
+				default: 0
+			}
 		},
 		data() {
 			return {
@@ -141,16 +142,15 @@
 				editInfo: {},
 				schoolInfo: {},
 				saveLoading: false,
-				exersicesType: "single",//single
+				exersicesType: "single", //single
 				exerciseField: 0,
 				exercisePeriod: 0,
 				exerciseGrade: [],
 				exerciseSubject: 0,
 				exerciseScope: 0,
 				exercisePoints: [],
-				scopeList: [this.$t('evaluation.filter.schoolBank'),this.$t('evaluation.filter.privateBank')],
-				fieldList: [this.$t('evaluation.level1'),this.$t('evaluation.level2'),this.$t('evaluation.level3'),
-				this.$t('evaluation.level4'),this.$t('evaluation.level5'),this.$t('evaluation.level6')],
+				scopeList: [this.$t("evaluation.filter.schoolBank"), this.$t("evaluation.filter.privateBank")],
+				fieldList: [this.$t("evaluation.level1"), this.$t("evaluation.level2"), this.$t("evaluation.level3"), this.$t("evaluation.level4"), this.$t("evaluation.level5"), this.$t("evaluation.level6")],
 				periodList: [],
 				gradeList: [],
 				subjectList: [],
@@ -160,12 +160,11 @@
 				stemContent: "",
 				analysisEditor: null,
 				repairEditor: null,
-				curId:''
+				curId: ""
 			};
 		},
 		created() {
 			this.getSchoolInfo();
-			
 		},
 		methods: {
 			getSchoolInfo() {
@@ -180,19 +179,18 @@
 					}
 				});
 			},
-			
-			onSelectPoints(){
-				if(this.hasSchool){
-					console.log(this.schoolInfo)
-					console.log(this.curPeriodIndex)
-					console.log(this.curSubjectIndex)
-					this.selectPointsModal = true
-				}else{
-					this.$Message.warning(this.$t('evaluation.newExercise.noSchoolTip'))
+
+			onSelectPoints() {
+				if (this.hasSchool) {
+					console.log(this.schoolInfo);
+					console.log(this.curPeriodIndex);
+					console.log(this.curSubjectIndex);
+					this.selectPointsModal = true;
+				} else {
+					this.$Message.warning(this.$t("evaluation.newExercise.noSchoolTip"));
 				}
 			},
 
-
 			onSelectFile(val) {
 				this.relateFileList = val.files;
 			},
@@ -203,26 +201,21 @@
 			},
 
 			async getContent(type) {
-				
 				let exerciseItem = this.editInfo && this.editInfo.id ? JSON.parse(JSON.stringify(this.editInfo)) : Object.assign({}, defaultExercise);
 				switch (type) {
 					case "single":
-						this.$refs.single.doSave()
+						this.$refs.single.doSave();
 						exerciseItem.question = this.$refs.single.stemContent;
 						exerciseItem.option = this.checkOptionNull(this.$refs.single.optionsContent) ? this.$refs.single.optionsContent : null;
 						exerciseItem.type = this.exersicesType;
 						exerciseItem.level = +this.exersicesDiff;
 						exerciseItem.explain = this.analysisContent;
-						exerciseItem.answer = [
-							String.fromCharCode(64 + parseInt(this.$refs.single.trueIndex + 1)),
-						];
+						exerciseItem.answer = [String.fromCharCode(64 + parseInt(this.$refs.single.trueIndex + 1))];
 						break;
 					case "multiple":
-					this.$refs.multiple.doSave()
+						this.$refs.multiple.doSave();
 						exerciseItem.question = this.$refs.multiple.stemContent;
-						exerciseItem.option = this.checkOptionNull(this.$refs.multiple.optionsContent) ?
-							this.$refs.multiple.optionsContent :
-							null;
+						exerciseItem.option = this.checkOptionNull(this.$refs.multiple.optionsContent) ? this.$refs.multiple.optionsContent : null;
 						exerciseItem.type = this.exersicesType;
 						exerciseItem.level = +this.exersicesDiff;
 						exerciseItem.explain = this.analysisContent;
@@ -252,6 +245,9 @@
 						exerciseItem.level = +this.exersicesDiff;
 						exerciseItem.explain = this.analysisContent;
 						exerciseItem.answer = [this.$refs.subjective.answerContent];
+						exerciseItem.answerType = this.$refs.subjective.answerType; // 02040301 问答题增加作答类型字段
+						exerciseItem.useAutoScore = this.$refs.subjective.useAutoScore; // 02040301 问答题增加作答类型字段
+						exerciseItem.answerLang = this.$refs.subjective.answerLang; // 02040301 问答题增加作答类型字段
 						break;
 					case "connector":
 						exerciseItem.question = this.$refs.connector.stemContent;
@@ -268,27 +264,22 @@
 						exerciseItem.level = +this.exersicesDiff;
 						exerciseItem.explain = this.analysisContent;
 						exerciseItem.answer = [this.$refs.correct.answerContent];
-						break;		
+						break;
 				}
 				exerciseItem.repair = this.repairContent;
-				exerciseItem.repair = this.formatRepairResource(
-					this.$refs.childRepairRef.datas
-				);
+				exerciseItem.repair = this.formatRepairResource(this.$refs.childRepairRef.datas);
 				exerciseItem.field = this.exerciseField + 1;
 				exerciseItem.knowledge = this.exercisePoints;
 				exerciseItem.children = [];
-				exerciseItem.score = (this.editInfo && this.editInfo.score) ? this.editInfo.score : 0;
-				exerciseItem.code =
-					this.$parent.$parent.exerciseScope === 0 ?
-					this.$store.state.userInfo.TEAMModelId :
-					this.$store.state.userInfo.schoolCode;
+				exerciseItem.score = this.editInfo && this.editInfo.score ? this.editInfo.score : 0;
+				exerciseItem.code = this.$parent.$parent.exerciseScope === 0 ? this.$store.state.userInfo.TEAMModelId : this.$store.state.userInfo.schoolCode;
 
-				let confirmSave = await this.checkContent(exerciseItem)
+				let confirmSave = await this.checkContent(exerciseItem);
 				// 判断获取的数据是否有空数据以及是否为空字符串
 				if (confirmSave) {
 					// this.saveLoading = true
 					exerciseItem.id = this.curId;
-					console.log('编辑后的小题',exerciseItem)
+					console.log("编辑后的小题", exerciseItem);
 					this.$emit("addFinish", exerciseItem);
 				}
 			},
@@ -296,7 +287,7 @@
 			/* 知识点勾选变动事件 */
 			onCheckChange(val, list) {
 				this.exercisePoints = val;
-				this.selectPointsModal = false
+				this.selectPointsModal = false;
 			},
 
 			/**
@@ -311,8 +302,8 @@
 			// 题目类型转换
 			typeChange(val) {
 				if (this.isEdit) {
-					this.$Message.warning(this.$t('evaluation.newExercise.typeChangeTip'));
-				}else {
+					this.$Message.warning(this.$t("evaluation.newExercise.typeChangeTip"));
+				} else {
 					this.exersicesType = val;
 					this.analysisEditor.txt.clear();
 					// this.repairEditor.txt.clear()
@@ -324,13 +315,13 @@
 				if (list.length) {
 					let arr = [];
 					list.forEach((i, index) => {
-						i.blobUrl.forEach(j => {
+						i.blobUrl.forEach((j) => {
 							arr.push({
-								blobUrl:j.url,
-								name:i.name,
-								type:i.type
-							})
-						})
+								blobUrl: j.url,
+								name: i.name,
+								type: i.type
+							});
+						});
 					});
 					return arr;
 				} else {
@@ -343,10 +334,7 @@
 				this.exersicesDiff = +type;
 				e.preventDefault();
 				let colorArr = ["#10abe7", "#E8BE15", "#F19300", "#EB5E00", "#D30000"];
-				let ac = document
-					.getElementById(this.refId)
-					.getElementsByClassName("edit-exersices-attr-diff")[0].children[1]
-					.children;
+				let ac = document.getElementById(this.refId).getElementsByClassName("edit-exersices-attr-diff")[0].children[1].children;
 				for (let i = 0; i < ac.length; i++) {
 					ac[i].style.background = "#fff";
 					ac[i].style.color = "#515a6e";
@@ -374,43 +362,43 @@
 
 			// 排除对象空属性
 			checkContent(Obj) {
-				return new Promise(async (r,j) => {
+				return new Promise(async (r, j) => {
 					let flag = true;
 					let whiteList = this.getWhiteListByType(Obj.type);
 					console.log("富文本获取的原始试题数据", Obj);
 					for (let key in Obj) {
 						if (whiteList.includes(key) && typeof Obj[key] === "string") {
 							if (!this.getSimpleText(Obj[key])) {
-								flag = await this.emptyConfirm(key)
+								flag = await this.emptyConfirm(key);
 								r(flag);
-								return
+								return;
 							}
 						} else {
 							if (whiteList.includes(key) && !Obj[key]) {
-								flag = await this.emptyConfirm(key)
+								flag = await this.emptyConfirm(key);
 								r(flag);
-								return
+								return;
 							}
 						}
 					}
 					r(flag);
-				})
+				});
 			},
-			
+
 			/* 确认是否继续保存 */
 			emptyConfirm(key) {
 				return new Promise((r, j) => {
 					this.$Modal.confirm({
-						title: this.$t('evaluation.newExercise.modalTip'),
-						content: `${ this.$t('evaluation.currentItem') }${ key === 'question' ? this.$t('evaluation.newExercise.stem') : this.$t('evaluation.newExercise.option') }${ this.$t('evaluation.emptyTip1') }`,
+						title: this.$t("evaluation.newExercise.modalTip"),
+						content: `${this.$t("evaluation.currentItem")}${key === "question" ? this.$t("evaluation.newExercise.stem") : this.$t("evaluation.newExercise.option")}${this.$t("evaluation.emptyTip1")}`,
 						onOk: () => {
-							r(true)
+							r(true);
 						},
 						onCancel: () => {
-							r(false)
+							r(false);
 						}
 					});
-				})
+				});
 			},
 
 			// 根据不同题型 给出需要必填选项
@@ -433,44 +421,34 @@
 
 			// 渲染编辑习题内容回显
 			async renderExercise(editItem) {
-				console.log('当前小题', editItem);
+				console.log("当前小题", editItem);
 				this.isEdit = true;
 				this.exersicesDiff = editItem.level.toString() || "0";
-				this.exerciseScope =
-					editItem.code === this.$store.state.userInfo.TEAMModelId ? 0 : 1;
+				this.exerciseScope = editItem.code === this.$store.state.userInfo.TEAMModelId ? 0 : 1;
 				this.exersicesType = editItem.type;
 				this.exercisePoints = editItem.knowledge || editItem.points;
 				if (editItem.level) {
-					let ac = document
-						.getElementById(this.refId)
-						.getElementsByClassName("edit-exersices-attr-diff")[0].children[1]
-						.children;
+					let ac = document.getElementById(this.refId).getElementsByClassName("edit-exersices-attr-diff")[0].children[1].children;
 					for (let i = 0; i < ac.length; i++) {
 						ac[i].style.background = "#fff";
 						ac[i].style.color = "#515a6e";
 					}
 					// 重新渲染题目难度
-					let diffDom = document
-						.getElementById(this.refId)
-						.getElementsByClassName("edit-exersices-attr-diff")[0].children[1]
-						.children[editItem.level - 1];
+					let diffDom = document.getElementById(this.refId).getElementsByClassName("edit-exersices-attr-diff")[0].children[1].children[editItem.level - 1];
 					let colorArr = ["#32CF74", "#E8BE15", "#F19300", "#EB5E00", "#D30000"];
 					diffDom.style.background = colorArr[editItem.level - 1];
 					diffDom.style.color = "#fff";
 				} else {
-					let ac = document
-						.getElementById(this.refId)
-						.getElementsByClassName("edit-exersices-attr-diff")[0].children[1]
-						.children;
+					let ac = document.getElementById(this.refId).getElementsByClassName("edit-exersices-attr-diff")[0].children[1].children;
 					for (let i = 0; i < ac.length; i++) {
 						ac[i].style.background = "#fff";
 						ac[i].style.color = "#515a6e";
 					}
 				}
 
-				let schoolInfo = await this.$store.dispatch('user/getSchoolProfile');
+				let schoolInfo = await this.$store.dispatch("user/getSchoolProfile");
 				this.schoolInfo = schoolInfo.school_base;
-				
+
 				this.stemContent = editItem.question;
 				this.relateFileList = editItem.repair || [];
 				this.optionsContent = editItem.option;
@@ -478,41 +456,41 @@
 				this.analysisEditor.txt.html(editItem.explain);
 				this.editInfo = JSON.parse(JSON.stringify(editItem));
 				this.exerciseField = this.editInfo.field - 1;
-			},
+			}
 		},
 		mounted() {
 			let analysisEditor = new E(this.$refs.analysisEditor);
 			analysisEditor.config.uploadImgShowBase64 = true;
-			analysisEditor.config.onchange = (html) => {
+			(analysisEditor.config.onchange = (html) => {
 				this.analysisContent = html;
-			},
-			this.$editorTools.initMyEditor(analysisEditor,this)
+			}),
+				this.$editorTools.initMyEditor(analysisEditor, this);
 			analysisEditor.create();
 			this.analysisEditor = analysisEditor;
-			
-			this.curId = this.$tools.guid()
+
+			this.curId = this.$tools.guid();
 			if (this.editItem && this.editItem.id) {
 				this.renderExercise(JSON.parse(JSON.stringify(this.editItem)));
 				// 先生成随机ID
-				this.curId = this.editItem.id || this.$tools.guid()
+				this.curId = this.editItem.id || this.$tools.guid();
 			}
-			
-			if(this.isEdit){
-				this.exerciseScope = this.editItem.scope === 'school' ? 1 : 0
-			}else{
-				this.exerciseScope = this.$parent.$parent.exerciseScope
+
+			if (this.isEdit) {
+				this.exerciseScope = this.editItem.scope === "school" ? 1 : 0;
+			} else {
+				this.exerciseScope = this.$parent.$parent.exerciseScope;
 			}
-			console.log(this.exerciseScope)
+			console.log(this.exerciseScope);
 		},
-		computed:{
-			curScope(){
-				return this.exerciseScope === 1 ? 'school' : 'private'
+		computed: {
+			curScope() {
+				return this.exerciseScope === 1 ? "school" : "private";
 			},
 			hasSchool() {
-			  return this.$store.state.userInfo.hasSchool
+				return this.$store.state.userInfo.hasSchool;
 			},
-			isPaperEnv(){
-				return sessionStorage.getItem('editorEnv') && sessionStorage.getItem('editorEnv') !== 'normal'
+			isPaperEnv() {
+				return sessionStorage.getItem("editorEnv") && sessionStorage.getItem("editorEnv") !== "normal";
 			}
 		},
 		watch: {
@@ -522,20 +500,18 @@
 						console.log("要编辑的小题");
 						console.log(newValue);
 						this.renderExercise(JSON.parse(JSON.stringify(newValue)));
-						this.curId = newValue.id || this.$tools.guid()
+						this.curId = newValue.id || this.$tools.guid();
 						// this.$refs.pointRef.doReset()
 					}
-				},
+				}
 				//immediate:true
 			}
-		},
+		}
 	};
 </script>
-<style src="../index/CreateExercises.less" lang="less" scoped>
-</style>
+<style src="../index/CreateExercises.less" lang="less" scoped></style>
 
 <style>
-
 	.related-point-modal .ivu-modal-header-inner {
 		font-weight: bold;
 	}
@@ -552,14 +528,12 @@
 	.exersices-attr .ivu-select-multiple .ivu-select-selection .ivu-select-placeholder {
 		line-height: 38px;
 	}
-	
-	.child-exercise-analysis .w-e-toolbar{
+
+	.child-exercise-analysis .w-e-toolbar {
 		z-index: 0 !important;
 	}
-	
-	.child-exercise-analysis .w-e-text-container{
+
+	.child-exercise-analysis .w-e-text-container {
 		position: unset;
 	}
-	
-	
 </style>

+ 1 - 1
TEAMModelOS/ClientApp/src/view/evaluation/index/CommonExercise.less

@@ -168,7 +168,7 @@
     .item-question-order {
       display: inline-block;
       vertical-align: top;
-      width: 30px;
+      width: 32px;
     }
 
     .item-question-text {

+ 1 - 0
TEAMModelOS/ClientApp/src/view/evaluation/index/CreateExercises.less

@@ -292,6 +292,7 @@ exersices-attr-diff {
     width:100%;
     justify-content:center;
 	margin-bottom: 20px;
+    padding-bottom: 20px;
 }
     .save-wrap .ivu-btn {
            font-size:16px;

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

@@ -242,7 +242,9 @@ export default {
         this.$Message.warning(this.$t('homework.noAttachments'))
         return
       }
-      let curScope = paper.examScope || paper.scope
+      console.error(paper)
+      // let curScope = paper.examScope || paper.scope
+      let curScope = paper.scope // 个人评测使用校本试卷 examScope会是 private 所以改为直接读取 scope
       let blobHost = curScope === 'school' ? JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri : JSON.parse(decodeURIComponent(localStorage.user_profile, "utf-8")).blob_uri
       let sasString = curScope === 'school' ? await this.$tools.getSchoolSas() : await this.$tools.getPrivateSas()
       let fullImgArr = paper.attachments?.map(imgName => blobHost + paper.blob + '/' + imgName + sasString.sas)

+ 2 - 1
TEAMModelOS/ClientApp/src/view/login/Index.vue

@@ -882,7 +882,8 @@ export default {
             let defaultPath = '/home'
             console.error(this.$route.query.target)
             console.error(targetPath)
-            let homePath = targetPath ? (targetPath.includes('home/') ? targetPath : defaultPath) : defaultPath
+            // let homePath = targetPath ? (targetPath.includes('home/') ? targetPath : defaultPath) : defaultPath
+            let homePath = targetPath || defaultPath // 部分跳转URL没有home/这一层
             localStorage.setItem('platform', 'school')
             localStorage.setItem('target_path', '')
             this.$router.push({ path: homePath })