重构项目结构,移除Assignment相关功能,优化Submission模块
Some checks failed
TechAct / explore-gitea-actions (push) Failing after 12s
Some checks failed
TechAct / explore-gitea-actions (push) Failing after 12s
This commit is contained in:
@@ -16,54 +16,34 @@
|
||||
@inject IDialogService DialogService
|
||||
|
||||
<MudPaper Elevation="5" Class="d-flex overflow-hidden flex-grow-1 pa-1 rounded-xl " Style="overflow:hidden; position:relative;height:100%">
|
||||
<MudDrawerContainer Class="mud-height-full flex-grow-1" Style="height:100%">
|
||||
<MudDrawer @bind-Open="@_open" Elevation="0" Variant="@DrawerVariant.Persistent" Color="Color.Primary" Anchor="Anchor.End" OverlayAutoClose="true">
|
||||
|
||||
@if (_edit)
|
||||
|
||||
<MudStack Class="flex-grow-1 h-100">
|
||||
|
||||
<MudPaper Class="rounded-xl ma-1 pa-2" Style="background-color:#fefefefe">
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Secondary" Class="rounded-xl" Size="Size.Small" OnClick="OpenEditor">文本编辑器</MudButton>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Secondary" Class="rounded-xl" Size="Size.Small" OnClick="ParseExam">载入</MudButton>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Secondary" Class="rounded-xl" Size="Size.Small" OnClick="OpenPublish">发布</MudButton>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Secondary" Class="rounded-xl" Size="Size.Small" OnClick="OpenPublish">指派</MudButton>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Secondary" Class="rounded-xl" Size="Size.Small" OnClick="OpenTest">Test</MudButton>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Secondary" Class="rounded-xl" Size="Size.Small" OnClick="HandleGlobalInfo">GlobalExamInfo</MudButton>
|
||||
</MudPaper>
|
||||
|
||||
|
||||
<ExamView Class="overflow-auto ma-1 pa-2 rounded-xl" ClickedStruct="HandleClickedStruct" ParsedExam="ExamContent"></ExamView>
|
||||
|
||||
<MudPaper MaxWidth="300">
|
||||
|
||||
@if (_parsedExam.Errors.Any())
|
||||
{
|
||||
<AssignmentQuestionEdit AssignmentQuestion="selectedAssignmentQuestion" />
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
<MudDrawerHeader>
|
||||
<MudText Typo="Typo.h6"> 配置 </MudText>
|
||||
</MudDrawerHeader>
|
||||
|
||||
<MudStack Class="overflow-auto">
|
||||
<ParseRoleConfig />
|
||||
<MudButton Color="Color.Success"> ParseExam </MudButton>
|
||||
</MudStack>
|
||||
}
|
||||
|
||||
|
||||
</MudDrawer>
|
||||
<MudStack Class="flex-grow-1 h-100">
|
||||
|
||||
<MudPaper Class="rounded-xl ma-1 pa-2" Style="background-color:#fefefefe">
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Secondary" Class="rounded-xl" Size="Size.Small" OnClick="OpenEditor">文本编辑器</MudButton>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Secondary" Class="rounded-xl" Size="Size.Small" OnClick="ParseExam">载入</MudButton>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Secondary" Class="rounded-xl" Size="Size.Small" OnClick="OpenPublish">发布</MudButton>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Secondary" Class="rounded-xl" Size="Size.Small" OnClick="OpenPublish">指派</MudButton>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Secondary" Class="rounded-xl" Size="Size.Small" OnClick="OpenTest">Test</MudButton>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Secondary" Class="rounded-xl" Size="Size.Small" OnClick="HandleGlobalInfo">GlobalExamInfo</MudButton>
|
||||
</MudPaper>
|
||||
|
||||
|
||||
<ExamView Class="overflow-auto ma-1 pa-2 rounded-xl" ClickedStruct="HandleClickedStruct" ParsedExam="ExamContent"></ExamView>
|
||||
|
||||
<MudPaper MaxWidth="300">
|
||||
|
||||
@if (_parsedExam.Errors.Any())
|
||||
foreach (var item in _parsedExam.Errors)
|
||||
{
|
||||
foreach (var item in _parsedExam.Errors)
|
||||
{
|
||||
<MudText> @item.Message </MudText>
|
||||
}
|
||||
<MudText> @item.Message </MudText>
|
||||
}
|
||||
</MudPaper>
|
||||
</MudStack>
|
||||
</MudDrawerContainer>
|
||||
}
|
||||
</MudPaper>
|
||||
</MudStack>
|
||||
|
||||
</MudPaper>
|
||||
|
||||
@code {
|
||||
@@ -71,19 +51,11 @@
|
||||
[CascadingParameter]
|
||||
private Task<AuthenticationState> authenticationStateTask { get; set; }
|
||||
|
||||
private AssignmentQuestionDto selectedAssignmentQuestion = new AssignmentQuestionDto();
|
||||
private IReadOnlyCollection<string> _selected;
|
||||
private bool _open = false;
|
||||
private bool _edit = false;
|
||||
private ExamQuestionDto selectedAssignmentQuestion = new ExamQuestionDto();
|
||||
|
||||
private void ToggleDrawer()
|
||||
{
|
||||
_open = !_open;
|
||||
_edit = false;
|
||||
}
|
||||
private BlazoredTextEditor _textEditor = new BlazoredTextEditor();
|
||||
private AssignmentEx _parsedExam = new AssignmentEx();
|
||||
private AssignmentDto ExamContent = new AssignmentDto();
|
||||
private ExamEx _parsedExam = new ExamEx();
|
||||
private ExamDto ExamContent = new ExamDto();
|
||||
|
||||
private ExamParserConfig _examParserConfig { get; set; } = new ExamParserConfig();
|
||||
private string EditorText = "";
|
||||
@@ -98,20 +70,6 @@
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await base.OnInitializedAsync();
|
||||
|
||||
var response = await NoteService.GetNote((byte)SubjectAreaEnum.Literature);
|
||||
|
||||
if (response.Status)
|
||||
{
|
||||
try
|
||||
{
|
||||
LocalStorageService.SetItem("GlobalInfo", response.Result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async void OpenEditor()
|
||||
@@ -141,12 +99,8 @@
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private async void HandleClickedStruct(AssignmentQuestionDto dto)
|
||||
private async void HandleClickedStruct(ExamQuestionDto dto)
|
||||
{
|
||||
// _open = true;
|
||||
// _edit = true;
|
||||
// StateHasChanged();
|
||||
|
||||
var parameters = new DialogParameters<QuestionCardDialog> { { x => x.Questions, dto } };
|
||||
|
||||
var dialog = await DialogService.ShowAsync<QuestionCardDialog>("Edit_Question", parameters);
|
||||
@@ -157,6 +111,9 @@
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
[Inject]
|
||||
public ICommonService commonService { get; set; }
|
||||
|
||||
private async Task ParseExam()
|
||||
{
|
||||
|
||||
@@ -167,12 +124,12 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
var exampar = new ExamParser(_examParserConfig);
|
||||
var exampar = new ExamParser(_examParserConfig, commonService);
|
||||
_parsedExam = exampar.ParseExamPaper(plainText);
|
||||
Snackbar.Add("试卷解析成功。", Severity.Success);
|
||||
Snackbar.Add($"{_parsedExam.Errors}。", Severity.Success);
|
||||
StateHasChanged();
|
||||
ExamContent = Mapper.Map<AssignmentDto>(_parsedExam);
|
||||
ExamContent = Mapper.Map<ExamDto>(_parsedExam);
|
||||
ExamContent.SeqIndex();
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -194,8 +151,6 @@
|
||||
[Inject]
|
||||
public IExamService examService { get; set; }
|
||||
|
||||
[Inject]
|
||||
public INoteService NoteService { get; set; }
|
||||
|
||||
|
||||
public async Task Publish()
|
||||
@@ -207,7 +162,6 @@
|
||||
{
|
||||
Dictionary<string, (Color, string)> Note = new Dictionary<string, (Color, string)> { { "Hello", (Color.Surface, "World") }, { "My", (Color.Surface, "App") }, };
|
||||
var json = JsonConvert.SerializeObject(Note);
|
||||
var result = await NoteService.AddNote(new GlobalDto { SubjectArea = Entities.Contracts.SubjectAreaEnum.Physics, Data = json });
|
||||
|
||||
|
||||
|
||||
@@ -218,9 +172,6 @@
|
||||
|
||||
private async void HandleGlobalInfo()
|
||||
{
|
||||
// _open = true;
|
||||
// _edit = true;
|
||||
// StateHasChanged();
|
||||
|
||||
var parameters = new DialogParameters<ExamGlobalInfoDialog> { { x => x.Assignment, ExamContent } };
|
||||
|
||||
@@ -232,53 +183,3 @@
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- #region name -->
|
||||
@* <MudButtonGroup Vertical="true" Color="Color.Primary" Variant="Variant.Filled">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Settings" OnClick="@ToggleDrawer" Color="Color.Secondary" />
|
||||
<MudIconButton Icon="@Icons.Material.Filled.TransitEnterexit" OnClick="@ParseExam" Color="Color.Secondary" />
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Save" OnClick="@ToggleDrawer" Color="Color.Secondary" />
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Publish" OnClick="@Publish" Color="Color.Secondary" />
|
||||
</MudButtonGroup> *@
|
||||
@* <MudPaper Class="ma-2 h-100">
|
||||
<MudPaper Elevation="0" Style="height:calc(100% - 80px)">
|
||||
<BlazoredTextEditor @ref="@_textEditor">
|
||||
<ToolbarContent>
|
||||
<select class="ql-header">
|
||||
<option selected=""></option>
|
||||
<option value="1"></option>
|
||||
<option value="2"></option>
|
||||
<option value="3"></option>
|
||||
<option value="4"></option>
|
||||
<option value="5"></option>
|
||||
</select>
|
||||
<span class="ql-formats">
|
||||
<button class="ql-bold"></button>
|
||||
<button class="ql-italic"></button>
|
||||
<button class="ql-underline"></button>
|
||||
<button class="ql-strike"></button>
|
||||
</span>
|
||||
<span class="ql-formats">
|
||||
<select class="ql-color"></select>
|
||||
<select class="ql-background"></select>
|
||||
</span>
|
||||
<span class="ql-formats">
|
||||
<button class="ql-list" value="ordered"></button>
|
||||
<button class="ql-list" value="bullet"></button>
|
||||
</span>
|
||||
<span class="ql-formats">
|
||||
<button class="ql-link"></button>
|
||||
</span>
|
||||
</ToolbarContent>
|
||||
<EditorContent>
|
||||
</EditorContent>
|
||||
</BlazoredTextEditor>
|
||||
</MudPaper>
|
||||
</MudPaper> *@
|
||||
|
||||
<!-- #endregion -->
|
||||
Reference in New Issue
Block a user