重构项目结构,移除Assignment相关功能,优化Submission模块
Some checks failed
TechAct / explore-gitea-actions (push) Failing after 12s

This commit is contained in:
SpecialX
2025-10-09 18:57:28 +08:00
parent 403b34a098
commit ac900159ba
289 changed files with 11948 additions and 20150 deletions

View File

@@ -10,23 +10,15 @@
<MudStack Row="true" Class="justify-content-between align-content-center" Style="background-color: transparent">
<MudText Class="justify-content-lg-start" Typo="Typo.h6">@ExamStruct.Title</MudText>
<MudStack Row="true" Class="align-content-center">
<MudText Class="ma-auto" Align="Align.Center" Typo="Typo.body2"> Num: @ExamStruct.ChildrenAssignmentQuestion.Count</MudText>
<MudText Class="ma-auto" Align="Align.Center" Typo="Typo.body2"> Num: @ExamStruct.ChildExamQuestions.Count</MudText>
<MudText Class="ma-auto" Align="Align.Center" Typo="Typo.body2"><b>总分:</b> @ExamStruct.Score 分</MudText>
<MudToggleIconButton @bind-Toggled="ExamStruct.BCorrect"
Icon="@Icons.Material.Filled.Close"
Color="@Color.Error"
ToggledIcon="@Icons.Material.Filled.Check"
ToggledColor="@Color.Success"
title="@(ExamStruct.BCorrect ? "On" : "Off")" />
<MudIconButton Color="Color.Tertiary" Icon="@Icons.Material.Filled.ExpandLess" Size="Size.Small" />
<MudIconButton Color="Color.Tertiary" Icon="@Icons.Material.Filled.ExpandMore" Size="Size.Small" />
<MudIconButton Icon="@Icons.Material.Filled.Delete" aria-label="delete" Size="Size.Small" />
<MudChip T="string" Color="Color.Info" Class="justify-content-end">@ExamStruct.StructType</MudChip>
<MudChip T="string" Color="Color.Warning" Class="justify-content-end">@(ExamStruct.QType == string.Empty ? "" : QuestionTypes[ExamStruct.QType].DisplayName)</MudChip>
@* <MudChip T="string" Color="Color.Info" Class="justify-content-end">@ExamStruct.Type.Name</MudChip> *@
@if(ExamStruct.Question!=null)
{
<MudRating SelectedValue="@((int)ExamStruct.Question.DifficultyLevel)" ReadOnly="true" Size="Size.Small" />
@* <MudRating SelectedValue="@((int)ExamStruct.Question.DifficultyLevel)" ReadOnly="true" Size="Size.Small" /> *@
}
</MudStack>
</MudStack>
@@ -36,41 +28,16 @@
<QuestionCard Question="ExamStruct.Question" Index="ExamStruct.Index" Elevation=0 Class="my-2 pa-1 rounded-xl" />
}
@foreach (var examStruct in ExamStruct.ChildrenAssignmentQuestion)
{
<ExamStructView ExamStruct="examStruct" ClickedStruct="HandleChildStructClick" Elevation=@(examStruct.Question != null
&& examStruct.ChildrenAssignmentQuestion.Count == 0 ? 0 : 0) Class="@($"my-2 pa-1 rounded-xl {(examStruct.StructType != AssignmentStructType.Question ? "my-5" : "my-1")}")"
Style=@(examStruct.StructType switch
{
AssignmentStructType.Question => "background-color: #ececec",
AssignmentStructType.Group => "background-color: #ffffff",
AssignmentStructType.Struct => "background-color: #cccccccc",
AssignmentStructType.SubQuestion => "background-color: #ffffff",
AssignmentStructType.Option => "background-color: #ffffff",
_ => "background-color: transparent"
}) />
}
</MudPaper>
</MudPaper>
@* Style=@(examStruct.StructType switch
{
AssignmentStructType.Question => "background-color: #ffffff",
AssignmentStructType.Composite => "background-color: #ececec",
AssignmentStructType.Struct => "background-color: #dcdcdc",
AssignmentStructType.SubQuestion => "background-color: #ffffff",
AssignmentStructType.Option => "background-color: #dddddd",
_ => "background-color: transparent"
}) *@
@code {
[Parameter]
public AssignmentQuestionDto ExamStruct { get; set; } = new AssignmentQuestionDto();
public ExamQuestionDto ExamStruct { get; set; } = new ExamQuestionDto();
[Parameter]
public EventCallback<AssignmentQuestionDto> ClickedStruct { get; set; }
public EventCallback<ExamQuestionDto> ClickedStruct { get; set; }
[Parameter]
public string Class { get; set; } = "my-2 pa-1";
@@ -81,20 +48,11 @@
[Parameter]
public string Style { get; set; } = "background-color : #eeeeee";
Dictionary<string, QuestionDisplayTypeData> QuestionTypes = new Dictionary<string, QuestionDisplayTypeData>();
[Inject]
private ILocalStorageService LocalStorageService { get; set; }
protected override void OnInitialized()
{
base.OnInitialized();
var cs = LocalStorageService.GetItem<string>("GlobalInfo");
var GlobalInfo = JsonConvert.DeserializeObject<Dictionary<string, QuestionDisplayTypeData>>(cs);
if (GlobalInfo != null)
{
QuestionTypes = GlobalInfo;
}
}
private async void HandleClick()
@@ -102,14 +60,14 @@
await ClickedStruct.InvokeAsync(ExamStruct);
}
private async void HandleChildStructClick(AssignmentQuestionDto clickedChildExamStruct)
private async void HandleChildStructClick(ExamQuestionDto clickedChildExamStruct)
{
await ClickedStruct.InvokeAsync(clickedChildExamStruct);
}
private void HandleSelected(int num)
{
ExamStruct.Question.DifficultyLevel = (DifficultyLevel)num;
// ExamStruct.Question.DifficultyLevel = (DifficultyLevel)num;
}
}