diff --git a/Src/CodeSpirit.ExamApi/Controllers/QuestionsController.cs b/Src/CodeSpirit.ExamApi/Controllers/QuestionsController.cs
index d69f8010f28fafa00b01fedd26660786f6b88068..1431b29fbbbbe7e4115b1a89e865bf008b2ca042 100644
--- a/Src/CodeSpirit.ExamApi/Controllers/QuestionsController.cs
+++ b/Src/CodeSpirit.ExamApi/Controllers/QuestionsController.cs
@@ -269,19 +269,14 @@ public class QuestionsController : ApiControllerBase
// 使用JObject/JArray构建表单
var formItems = new JArray();
-
// 问题标题
var titleObj = new JObject
{
["type"] = "tpl",
- ["tpl"] = "
1. ${content | raw}
(${score}分) ",
- ["data"] = new JObject
- {
- ["content"] = question.Content,
- ["score"] = question.DefaultScore
- },
+ ["tpl"] = "1. ${content | raw}
(${score}分) ",
["inline"] = false
};
+
formItems.Add(titleObj);
// 根据题目类型添加不同的表单控件
@@ -379,10 +374,6 @@ public class QuestionsController : ApiControllerBase
{
["type"] = "tpl",
["tpl"] = "正确答案:${answer | raw}
",
- ["data"] = new JObject
- {
- ["answer"] = question.CorrectAnswer
- },
["inline"] = false
});
@@ -393,10 +384,6 @@ public class QuestionsController : ApiControllerBase
{
["type"] = "tpl",
["tpl"] = "解析:${analysis | raw}
",
- ["data"] = new JObject
- {
- ["analysis"] = question.Analysis
- },
["inline"] = false
});
}
@@ -407,10 +394,16 @@ public class QuestionsController : ApiControllerBase
["type"] = "form",
["title"] = "",
["id"] = "questionPreviewForm",
+ ["data"] = new JObject
+ {
+ ["content"] = question.Content,
+ ["score"] = question.DefaultScore,
+ ["answer"] = question.CorrectAnswer,
+ ["analysis"] = question.Analysis
+ },
["body"] = formItems,
["actions"] = new JArray() // 添加空的actions数组,隐藏表单自带的提交按钮
};
-
return SuccessResponse(amisConfig);
}
diff --git a/Src/CodeSpirit.ExamApi/Services/Implementations/StudentService.cs b/Src/CodeSpirit.ExamApi/Services/Implementations/StudentService.cs
index 01ca19935bb766697de6101ce6f13f72bf9994ad..5e805e1531b935aff1165208f74d8d1c54a1e60e 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();