Finishddd
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
@page "/exam/create"
|
||||
@using AutoMapper
|
||||
@using TechHelper.Client.Services
|
||||
@using Blazored.TextEditor
|
||||
@using Entities.DTO
|
||||
@@ -72,6 +73,16 @@
|
||||
</MudPaper>
|
||||
</MudPaper>
|
||||
|
||||
<MudPaper MaxWidth="300">
|
||||
|
||||
@if (_parsedExam.Errors.Any())
|
||||
{
|
||||
foreach (var item in _parsedExam.Errors)
|
||||
{
|
||||
<MudText> @item.Message </MudText>
|
||||
}
|
||||
}
|
||||
</MudPaper>
|
||||
<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" />
|
||||
@@ -98,11 +109,15 @@
|
||||
_edit = false;
|
||||
}
|
||||
private BlazoredTextEditor _textEditor = new BlazoredTextEditor();
|
||||
private ExamPaper _parsedExam = new ExamPaper();
|
||||
private AssignmentEx _parsedExam = new AssignmentEx();
|
||||
private AssignmentDto ExamContent = new AssignmentDto();
|
||||
|
||||
private ExamParserConfig _examParserConfig { get; set; } = new ExamParserConfig();
|
||||
|
||||
[Inject]
|
||||
public IMapper Mapper { get; set; }
|
||||
|
||||
|
||||
private void HandleClickedStruct(AssignmentQuestionDto dto)
|
||||
{
|
||||
_open = true;
|
||||
@@ -125,8 +140,9 @@
|
||||
_parsedExam = exampar.ParseExamPaper(plainText);
|
||||
Snackbar.Add("试卷解析成功。", Severity.Success);
|
||||
Snackbar.Add($"{_parsedExam.Errors}。", Severity.Success);
|
||||
ExamContent = _parsedExam.ConvertToExamDTO();
|
||||
// ExamContent.SeqIndex();
|
||||
StateHasChanged();
|
||||
ExamContent = Mapper.Map<AssignmentDto>(_parsedExam);
|
||||
ExamContent.SeqIndex();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
Reference in New Issue
Block a user