This commit is contained in:
46
TechHelper.Client/Pages/Exam/QuestionCard/QuestionCard.razor
Normal file
46
TechHelper.Client/Pages/Exam/QuestionCard/QuestionCard.razor
Normal file
@@ -0,0 +1,46 @@
|
||||
@using Entities.Contracts
|
||||
@using Entities.DTO
|
||||
@using TechHelper.Client.Exam
|
||||
|
||||
<MudPaper Class=@Class Elevation=@Elevation Outlined="false">
|
||||
|
||||
<MudText Typo="Typo.subtitle1">
|
||||
<b>@Index</b> @((MarkupString)Question.Title.Replace("\n", "<br />"))
|
||||
@if (Score > 0)
|
||||
{
|
||||
<MudText Typo="Typo.body2" Class="d-inline ml-2">(@Score 分)</MudText>
|
||||
}
|
||||
</MudText>
|
||||
|
||||
@if (!string.IsNullOrEmpty(Question.Options))
|
||||
{
|
||||
<div class="mt-2">
|
||||
@foreach (var option in Question.Options.ParseOptionsFromText())
|
||||
{
|
||||
var tempOption = option;
|
||||
<p>@((MarkupString)(tempOption.Replace("\n", "<br />")))</p>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
</MudPaper>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public QuestionDto Question { get; set; } = new QuestionDto();
|
||||
|
||||
[Parameter]
|
||||
public AssignmentStructType Type { get; set; } = AssignmentStructType.Question;
|
||||
|
||||
[Parameter]
|
||||
public byte Index { get; set; } = 0;
|
||||
|
||||
[Parameter]
|
||||
public byte Score { get; set; } = 0;
|
||||
|
||||
[Parameter]
|
||||
public string Class { get; set; } = string.Empty;
|
||||
|
||||
[Parameter]
|
||||
public int Elevation { get; set; }
|
||||
}
|
18
TechHelper.Client/Pages/Exam/QuestionCard/QuestionEdit.razor
Normal file
18
TechHelper.Client/Pages/Exam/QuestionCard/QuestionEdit.razor
Normal file
@@ -0,0 +1,18 @@
|
||||
@using Entities.DTO
|
||||
@using TechHelper.Client.Exam
|
||||
|
||||
|
||||
<MudPaper Elevation="1" Class="ma-4 pa-5 rounded-xl">
|
||||
@* <MudText>@Question.Id</MudText> *@
|
||||
<MudText Class="mt-3" Typo="Typo.button"><b>问题属性</b></MudText>
|
||||
<MudTextField @bind-Value="Question.Title" Label="Title" Variant="Variant.Text" Margin="Margin.Dense" AutoGrow="true" />
|
||||
<MudTextField @bind-Value="Question.Answer" Label="Answer" Variant="Variant.Text" Adornment="Adornment.End" AdornmentText="." Margin="Margin.Dense" AutoGrow="true" />
|
||||
<MudTextField @bind-Value="Question.Options" Label="Options" Variant="Variant.Text" Adornment="Adornment.End" AdornmentText="." Margin="Margin.Dense" AutoGrow="true" />
|
||||
|
||||
</MudPaper>
|
||||
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public QuestionDto Question { get; set; } = new QuestionDto();
|
||||
}
|
Reference in New Issue
Block a user