From 1b1308c3c2b12983c300fccc85f5f3a2037ef327 Mon Sep 17 00:00:00 2001 From: mago Date: Thu, 19 Jun 2025 14:33:43 +0800 Subject: [PATCH 1/3] .... --- .../Controllers/QuestionsController.cs | 28 +++++++++---------- .../Implementations/StudentService.cs | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Src/CodeSpirit.ExamApi/Controllers/QuestionsController.cs b/Src/CodeSpirit.ExamApi/Controllers/QuestionsController.cs index d69f801..cd6742d 100644 --- a/Src/CodeSpirit.ExamApi/Controllers/QuestionsController.cs +++ b/Src/CodeSpirit.ExamApi/Controllers/QuestionsController.cs @@ -270,18 +270,25 @@ public class QuestionsController : ApiControllerBase // 使用JObject/JArray构建表单 var formItems = new JArray(); - // 问题标题 - var titleObj = new JObject + var objData = new JObject { - ["type"] = "tpl", - ["tpl"] = "
1. ${content | raw} 
(${score}分)
", ["data"] = new JObject { ["content"] = question.Content, - ["score"] = question.DefaultScore - }, + ["score"] = 1, + ["answer"] = 3, + ["analysis"] = question.Analysis + } + }; + formItems.Add(objData); + // 问题标题 + var titleObj = new JObject + { + ["type"] = "tpl", + ["tpl"] = "
1. ${content | raw} 
(${score}分)
", ["inline"] = false }; + formItems.Add(titleObj); // 根据题目类型添加不同的表单控件 @@ -379,10 +386,6 @@ public class QuestionsController : ApiControllerBase { ["type"] = "tpl", ["tpl"] = "
正确答案:${answer | raw}
", - ["data"] = new JObject - { - ["answer"] = question.CorrectAnswer - }, ["inline"] = false }); @@ -393,10 +396,6 @@ public class QuestionsController : ApiControllerBase { ["type"] = "tpl", ["tpl"] = "
解析:${analysis | raw}
", - ["data"] = new JObject - { - ["analysis"] = question.Analysis - }, ["inline"] = false }); } @@ -411,6 +410,7 @@ public class QuestionsController : ApiControllerBase ["actions"] = new JArray() // 添加空的actions数组,隐藏表单自带的提交按钮 }; + var xx= JsonConvert.SerializeObject(amisConfig); return SuccessResponse(amisConfig); } diff --git a/Src/CodeSpirit.ExamApi/Services/Implementations/StudentService.cs b/Src/CodeSpirit.ExamApi/Services/Implementations/StudentService.cs index d37f5e1..9bad8b2 100644 --- a/Src/CodeSpirit.ExamApi/Services/Implementations/StudentService.cs +++ b/Src/CodeSpirit.ExamApi/Services/Implementations/StudentService.cs @@ -94,7 +94,7 @@ public class StudentService : BaseCRUDIService x.StudentGroups) .ThenInclude(x => x.StudentGroup) - .Where(predicate); + .Where(predicate).OrderByDescending(x=>x.CreatedAt); // 执行分页查询 var totalCount = await query.CountAsync(); -- Gitee From 6671e077aacd7dc3397fc2ccc8e8661ba3a820c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=96=87=E5=BC=BA?= Date: Thu, 19 Jun 2025 14:39:15 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/QuestionsController.cs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/Src/CodeSpirit.ExamApi/Controllers/QuestionsController.cs b/Src/CodeSpirit.ExamApi/Controllers/QuestionsController.cs index cd6742d..ea70a47 100644 --- a/Src/CodeSpirit.ExamApi/Controllers/QuestionsController.cs +++ b/Src/CodeSpirit.ExamApi/Controllers/QuestionsController.cs @@ -269,18 +269,6 @@ public class QuestionsController : ApiControllerBase // 使用JObject/JArray构建表单 var formItems = new JArray(); - - var objData = new JObject - { - ["data"] = new JObject - { - ["content"] = question.Content, - ["score"] = 1, - ["answer"] = 3, - ["analysis"] = question.Analysis - } - }; - formItems.Add(objData); // 问题标题 var titleObj = new JObject { @@ -406,6 +394,13 @@ public class QuestionsController : ApiControllerBase ["type"] = "form", ["title"] = "", ["id"] = "questionPreviewForm", + ["data"] = new JObject + { + ["content"] = question.Content, + ["score"] = 1, + ["answer"] = 3, + ["analysis"] = question.Analysis + }, ["body"] = formItems, ["actions"] = new JArray() // 添加空的actions数组,隐藏表单自带的提交按钮 }; -- Gitee From e50521ae336c719a1caec0a09244fe28ffec43bd Mon Sep 17 00:00:00 2001 From: mago Date: Thu, 19 Jun 2025 16:19:23 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=AD=94=E6=A1=88=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/CodeSpirit.ExamApi/Controllers/QuestionsController.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Src/CodeSpirit.ExamApi/Controllers/QuestionsController.cs b/Src/CodeSpirit.ExamApi/Controllers/QuestionsController.cs index ea70a47..1431b29 100644 --- a/Src/CodeSpirit.ExamApi/Controllers/QuestionsController.cs +++ b/Src/CodeSpirit.ExamApi/Controllers/QuestionsController.cs @@ -397,15 +397,13 @@ public class QuestionsController : ApiControllerBase ["data"] = new JObject { ["content"] = question.Content, - ["score"] = 1, - ["answer"] = 3, + ["score"] = question.DefaultScore, + ["answer"] = question.CorrectAnswer, ["analysis"] = question.Analysis }, ["body"] = formItems, ["actions"] = new JArray() // 添加空的actions数组,隐藏表单自带的提交按钮 }; - - var xx= JsonConvert.SerializeObject(amisConfig); return SuccessResponse(amisConfig); } -- Gitee