From f6ace280122fa34d4953cc56448653dafcef483c Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Mon, 13 May 2024 15:47:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tiobon.Core.Api/Tiobon.Core.Model.xml | 14 ++- Tiobon.Core.Api/Tiobon.Core.xml | 7 ++ .../View/Ghre/Ghre_Question.Dto.View.cs | 12 ++ Tiobon.Core.Services/CommonServices.cs | 107 +++++++++++++++--- .../Ghre/Ghre_ExamPaperServices.cs | 21 ++-- .../Ghre/Ghre_QuestionServices.cs | 7 +- Tiobon.Core/Tiobon.Core.Model.xml | 10 ++ 7 files changed, 148 insertions(+), 30 deletions(-) diff --git a/Tiobon.Core.Api/Tiobon.Core.Model.xml b/Tiobon.Core.Api/Tiobon.Core.Model.xml index f37b4617..4d784471 100644 --- a/Tiobon.Core.Api/Tiobon.Core.Model.xml +++ b/Tiobon.Core.Api/Tiobon.Core.Model.xml @@ -721,13 +721,17 @@ 试卷配置 (Dto.Base) - + 试卷ID + + 课程ID + + 排序号 @@ -742,9 +746,9 @@ 题目类型 - + - 题目内容 + 题目内容ID @@ -2345,9 +2349,9 @@ 题目类型 - + - 题目内容 + 题目内容ID diff --git a/Tiobon.Core.Api/Tiobon.Core.xml b/Tiobon.Core.Api/Tiobon.Core.xml index 59e15b48..ea731fa5 100644 --- a/Tiobon.Core.Api/Tiobon.Core.xml +++ b/Tiobon.Core.Api/Tiobon.Core.xml @@ -655,6 +655,13 @@ + + + 新增配置数据 + + + + 试卷题目(Controller) diff --git a/Tiobon.Core.Model/View/Ghre/Ghre_Question.Dto.View.cs b/Tiobon.Core.Model/View/Ghre/Ghre_Question.Dto.View.cs index 2a86b471..057bf21b 100644 --- a/Tiobon.Core.Model/View/Ghre/Ghre_Question.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghre/Ghre_Question.Dto.View.cs @@ -32,6 +32,18 @@ namespace Tiobon.Core.Model.Models [Display(Name = "CourseName"), Description("课程名称")] public string CourseName { get; set; } + public long CourseTypeId { get; set; } + public string CourseType { get; set; } + + /// + /// 难易程度 + /// + public string DifficultyLevelLabel { get; set; } + + /// + /// 题目类型 + /// + public string QuestionTypeLabel { get; set; } } } diff --git a/Tiobon.Core.Services/CommonServices.cs b/Tiobon.Core.Services/CommonServices.cs index 8beb81db..099d4a8b 100644 --- a/Tiobon.Core.Services/CommonServices.cs +++ b/Tiobon.Core.Services/CommonServices.cs @@ -1128,22 +1128,18 @@ public partial class CommonServices : BaseServices>, ICommon break; case "ScoreMethod": searchItem = [ - new JProperty("defaultHidden", true), - new JProperty("field","value"), - new JProperty("label","value"), - ]; + new JProperty("defaultHidden", true), + new JProperty("field","value"), + new JProperty("label","value") + ]; TableColumn.Add(searchItem); searchItem = [ new JProperty("field","label"), - new JProperty("label","label"), - ]; + new JProperty("label","label") + ]; TableColumn.Add(searchItem); - - sql = "SELECT Id, CourseNo, CourseName FROM Ghre_Course"; - dt = await Db.Ado.GetDataTableAsync(sql); - item = [ - new JProperty("value","Manual"), + new JProperty("value","Manual"), new JProperty("label","人工评分") ]; DT_TableDataT1.Add(item); @@ -1154,16 +1150,101 @@ public partial class CommonServices : BaseServices>, ICommon DT_TableDataT1.Add(item); item = [ - new JProperty("ListMax",100), + new JProperty("ListMax",100), new JProperty("ListMin",10), new JProperty("PageNum",1), new JProperty("PageSize",99999), - new JProperty("TotalCount",dt.Rows.Count), + new JProperty("TotalCount",2), + new JProperty("UIType","Auto") + ]; + DT_TablePageInfoT1.Add(item); + break; + case "DifficultyLevel": + searchItem = [ + new JProperty("defaultHidden", true), + new JProperty("field","value"), + new JProperty("label","value") + ]; + TableColumn.Add(searchItem); + searchItem = [ + new JProperty("field","label"), + new JProperty("label","label") + ]; + TableColumn.Add(searchItem); + item = [ + new JProperty("value","Easy"), + new JProperty("label","简单") + ]; + DT_TableDataT1.Add(item); + item = [ + new JProperty("value","Normal"), + new JProperty("label","普通") + ]; + DT_TableDataT1.Add(item); + item = [ + new JProperty("value","Hard"), + new JProperty("label","困难") + ]; + DT_TableDataT1.Add(item); + + item = [ + new JProperty("ListMax",100), + new JProperty("ListMin",10), + new JProperty("PageNum",1), + new JProperty("PageSize",99999), + new JProperty("TotalCount",3), new JProperty("UIType","Auto") ]; DT_TablePageInfoT1.Add(item); break; + case "QuestionType": + searchItem = [ + new JProperty("defaultHidden", true), + new JProperty("field","value"), + new JProperty("label","value") + ]; + TableColumn.Add(searchItem); + searchItem = [ + new JProperty("field","label"), + new JProperty("label","label") + ]; + TableColumn.Add(searchItem); + item = [ + new JProperty("value","Single"), + new JProperty("label","单选题") + ]; + DT_TableDataT1.Add(item); + item = [ + new JProperty("value","Multiple"), + new JProperty("label","多选题") + ]; + DT_TableDataT1.Add(item); + item = [ + new JProperty("value","TrueOrFalse"), + new JProperty("label","判断题") + ]; + DT_TableDataT1.Add(item); + item = [ + new JProperty("value","Completion"), + new JProperty("label","填空题") + ]; + DT_TableDataT1.Add(item); + item = [ + new JProperty("value","ShortAnswer"), + new JProperty("label","简答题") + ]; + DT_TableDataT1.Add(item); + item = [ + new JProperty("ListMax",100), + new JProperty("ListMin",10), + new JProperty("PageNum",1), + new JProperty("PageSize",99999), + new JProperty("TotalCount",5), + new JProperty("UIType","Auto") + ]; + DT_TablePageInfoT1.Add(item); + break; } result.JM_TableColumnT1.TableColumn = TableColumn; result.DT_TableDataT1 = DT_TableDataT1; diff --git a/Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs b/Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs index 876322fa..e1c32bb9 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs @@ -78,7 +78,7 @@ namespace Tiobon.Core.Services required = true, multipleSelect = false, editable = true, - dataSource = "api/Common/GetSelect/ScoreMethod" + dataSource = "api/Common/GetSelect/ScoreMethod?FW=DOTNETCORE" }, new DefaultGhre_ExamPaperColumn() { @@ -130,20 +130,20 @@ namespace Tiobon.Core.Services label = "课程名称", field = "CourseId", elementType = "ApiSelect", - required = false, + required = true, multipleSelect = false, editable = true, - dataSource = "api/Common/GetSelect/Ghre_Course" + dataSource = "api/Common/GetSelect/Ghre_Course?FW=DOTNETCORE" }, new DefaultGhre_ExamPaperColumn() { label = "课程场景", field = "CourseSceneId", elementType = "ApiSelect", - required = false, + required = true, multipleSelect = false, editable = true, - dataSource = "api/Common/GetSelect/Ghre_CourseScene" + dataSource = "api/Common/GetSelect/Ghre_CourseScene?FW=DOTNETCORE" } }; #endregion @@ -159,7 +159,8 @@ namespace Tiobon.Core.Services required = true, multipleSelect = false, editable = true, - displayType=1 + displayType=1, + dataSource = "api/Common/GetSelect/Ghre_Course?FW=DOTNETCORE" }, new DefaultGhre_ExamPaperColumn() { @@ -169,7 +170,8 @@ namespace Tiobon.Core.Services required = true, multipleSelect = false, editable = true, - displayType=2 + displayType=2, + dataSource = "api/Common/GetSelect/QuestionType?FW=DOTNETCORE" }, new DefaultGhre_ExamPaperColumn() { @@ -179,7 +181,8 @@ namespace Tiobon.Core.Services required = true, multipleSelect = false, editable = true, - displayType=2 + displayType=2, + dataSource = "api/Common/GetSelect/DifficultyLevel?FW=DOTNETCORE" }, new DefaultGhre_ExamPaperColumn() { @@ -272,7 +275,7 @@ namespace Tiobon.Core.Services baseData.PassScore = null; baseData.RetakeTimes = null; baseData.RemarkSz = null; - baseData.LinkType = null; + baseData.LinkType = "CourseId"; baseData.CourseId = null; baseData.CourseSceneId = null; input.pageData.baseData = baseData; diff --git a/Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs b/Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs index f40c3841..109a4859 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs @@ -133,8 +133,8 @@ public class Ghre_QuestionServices : BaseServices classsIds.Contains(x.Id)); data.ForEach(x => { - x.DifficultyLevel = ConvertDifficultyLevel(x.DifficultyLevel); - x.QuestionType = ConvertQuestionType(x.QuestionType); + x.DifficultyLevelLabel = ConvertDifficultyLevel(x.DifficultyLevel); + x.QuestionTypeLabel = ConvertQuestionType(x.QuestionType); if (x.CourseId != null) { @@ -142,6 +142,7 @@ public class Ghre_QuestionServices : BaseServices a.Id == course.CourseClassId).FirstOrDefault(); x.CourseType = courseClass.ClassName; + x.CourseTypeId = courseClass.Id; } }); @@ -166,7 +167,7 @@ public class Ghre_QuestionServices : BaseServices + + + 难易程度 + + + + + 题目类型 + + 题目答案(Dto.View)