This commit is contained in:
143
TechHelper.Client/Pages/Common/Exam/AssignmentInfoCard.razor
Normal file
143
TechHelper.Client/Pages/Common/Exam/AssignmentInfoCard.razor
Normal file
@@ -0,0 +1,143 @@
|
||||
<MudPaper Class="rounded-xl w-100 px-10 ma-3 pt-5" Elevation="5" Height="170px" Style="background-color:#6bc6be">
|
||||
|
||||
<MudGrid Class="h-100">
|
||||
|
||||
<MudItem xs="12" sm="2" Class="h-100 pa-1 mt-1">
|
||||
<MudStack Class="h-100">
|
||||
<MudText Style="color:white"> 期中测试BETA版本 </MudText>
|
||||
<MudText Style="color:white" Typo="Typo.h3"><b> 75 </b></MudText>
|
||||
|
||||
<MudPaper Elevation=0 Class="h-100 w-100" Style="background-color:transparent">
|
||||
<MudStack Class="h-100" Row=true>
|
||||
<MudPaper Elevation=0 Height="100%" Width="100%" Style="background-color:transparent">
|
||||
<MudPaper Elevation=0 Height="50%" Style="background-color:transparent">
|
||||
<MudText Style="color:#9ed5f7" Typo="Typo.body2">
|
||||
TotalNumber:
|
||||
<span style="color: #fefefe;">15</span>
|
||||
</MudText>
|
||||
</MudPaper>
|
||||
<MudPaper Elevation=0 Height="50%" Style="background-color:transparent">
|
||||
<MudText Style="color:#9ed5f7" Typo="Typo.body2">
|
||||
TotalScore:
|
||||
<span style="color: #fefefe;">15</span>
|
||||
</MudText>
|
||||
</MudPaper>
|
||||
</MudPaper>
|
||||
|
||||
<MudPaper Elevation=0 Height="100%" Width="100%" Style="background-color:transparent">
|
||||
<MudPaper Elevation=0 Height="50%" Style="background-color:transparent">
|
||||
<MudText Style="color:#9ed5f7" Typo="Typo.body2">
|
||||
中位数:
|
||||
<span style="color: #fefefe;">15</span>
|
||||
</MudText>
|
||||
</MudPaper>
|
||||
<MudPaper Elevation=0 Height="50%" Style="background-color:transparent">
|
||||
<MudText Style="color:#9ed5f7" Typo="Typo.body2">
|
||||
方差:
|
||||
<span style="color: #fefefe;">15</span>
|
||||
</MudText>
|
||||
</MudPaper>
|
||||
</MudPaper>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
</MudStack>
|
||||
</MudItem>
|
||||
|
||||
|
||||
<MudItem xs="12" sm="9">
|
||||
<MudPaper Style="background-color:transparent" Class="w-100 mt-n3" Height="100%" Elevation="0">
|
||||
<MudChart ChartType="ChartType.Line" Class="pt-0" ChartSeries="@Series" XAxisLabels="@XAxisLabels" CanHideSeries
|
||||
Height="150px" Width="100%" AxisChartOptions="_axisChartOptions" ChartOptions="options">
|
||||
<CustomGraphics>
|
||||
<style>
|
||||
.heavy {
|
||||
font: normal 12px helvetica;
|
||||
fill: rgb(255,255,255);
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<text x="60" y="15" class="heavy"> 成绩的整体分布情况 </text>
|
||||
</CustomGraphics>
|
||||
</MudChart>
|
||||
</MudPaper>
|
||||
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="1">
|
||||
<MudChipSet T="string" SelectedValuesChanged="HandleSelectedValuesChanged" SelectedValues="@_selected" SelectionMode="SelectionMode.MultiSelection" CheckMark="true">
|
||||
<MudChip Size="Size.Small" Text="类型错误数量分布" Variant="Variant.Text" Color="Color.Default">类型分布</MudChip>
|
||||
<MudChip Size="Size.Small" Text="类型错误成绩分布" Variant="Variant.Text" Color="Color.Primary">课时分布</MudChip>
|
||||
<MudChip Size="Size.Small" Text="pink" Variant="Variant.Text" Color="Color.Secondary">成绩趋势</MudChip>
|
||||
<MudChip Size="Size.Small" Text="blue" Variant="Variant.Text" Color="Color.Info">分值区间</MudChip>
|
||||
<MudChip Size="Size.Small" Text="green" Variant="Variant.Text" Color="Color.Success">Success</MudChip>
|
||||
<MudChip Size="Size.Small" Text="orange" Variant="Variant.Text" Color="Color.Warning">Warning</MudChip>
|
||||
<MudChip Size="Size.Small" Text="red" Variant="Variant.Text" Color="Color.Error">Error</MudChip>
|
||||
<MudChip Size="Size.Small" Text="black" Variant="Variant.Text" Color="Color.Dark">Dark</MudChip>
|
||||
</MudChipSet>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</MudPaper>
|
||||
|
||||
|
||||
@code {
|
||||
public double[] data = { 25, 77, 28, 5 };
|
||||
public string[] labels = { "Oil", "Coal", "Gas", "Biomass" };
|
||||
private AxisChartOptions _axisChartOptions = new AxisChartOptions
|
||||
{
|
||||
};
|
||||
private ChartOptions options = new ChartOptions
|
||||
{
|
||||
InterpolationOption = InterpolationOption.NaturalSpline,
|
||||
YAxisFormat = "c2",
|
||||
ShowLegend = false,
|
||||
YAxisLines = false,
|
||||
XAxisLines = false,
|
||||
XAxisLabelPosition = XAxisLabelPosition.None,
|
||||
YAxisLabelPosition = YAxisLabelPosition.None,
|
||||
YAxisTicks = 100,
|
||||
ShowLabels = false,
|
||||
ShowLegendLabels = false
|
||||
|
||||
};
|
||||
public List<ChartSeries> Series = new List<ChartSeries>()
|
||||
{
|
||||
new ChartSeries() { Name = "类型错误数量分布", Data = new double[] { 35, 41, 35, 51, 49, 62, 69, 91, 148 } },
|
||||
new ChartSeries() { Name = "类型错误成绩分布", Data = new double[] { 55, 21, 45, 11, 45, 23, 11, 56, 13 } },
|
||||
};
|
||||
public string[] XAxisLabels = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep" };
|
||||
|
||||
Random random = new Random();
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
options.InterpolationOption = InterpolationOption.NaturalSpline;
|
||||
options.YAxisFormat = "c2";
|
||||
options.ShowLegend = false;
|
||||
options.YAxisLines = false;
|
||||
options.XAxisLines = false;
|
||||
options.XAxisLabelPosition = XAxisLabelPosition.None;
|
||||
options.YAxisLabelPosition = YAxisLabelPosition.None;
|
||||
options.ShowLabels = false;
|
||||
options.ShowLegendLabels = false;
|
||||
options.LineStrokeWidth = 1;
|
||||
_axisChartOptions.MatchBoundsToSize = true;
|
||||
|
||||
Series[0].LineDisplayType = LineDisplayType.Area;
|
||||
|
||||
}
|
||||
|
||||
private IReadOnlyCollection<string> _selected;
|
||||
|
||||
private void HandleSelectedValuesChanged(IReadOnlyCollection<string> selected)
|
||||
{
|
||||
Series.ForEach(x => x.Visible = false);
|
||||
|
||||
foreach(var item in selected)
|
||||
{
|
||||
var sv = Series.FirstOrDefault(predicate: x => x.Name == item);
|
||||
if(sv != null)
|
||||
{
|
||||
sv.Visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
<MudPaper Class="rounded-xl w-100 px-10 ma-3 pt-5">
|
||||
|
||||
<MudText> Name </MudText>
|
||||
<MudText> 错误数量 </MudText>
|
||||
<MudText> 分数 </MudText>
|
||||
</MudPaper>
|
@@ -0,0 +1,6 @@
|
||||
<MudPaper Class="rounded-xl w-100 px-10 ma-3 pt-5">
|
||||
|
||||
<MudText> Name </MudText>
|
||||
<MudText> 平均数 </MudText>
|
||||
<MudText> 中为数 </MudText>
|
||||
</MudPaper>
|
67
TechHelper.Client/Pages/Common/PublishExamDialog.razor
Normal file
67
TechHelper.Client/Pages/Common/PublishExamDialog.razor
Normal file
@@ -0,0 +1,67 @@
|
||||
@using Entities.DTO
|
||||
@inject ISnackbar Snackbar
|
||||
@using Entities.Contracts
|
||||
|
||||
|
||||
|
||||
<MudDialog Class="rounded-xl pa-2" Style="background-color: #dedede">
|
||||
<TitleContent>
|
||||
<MudText Typo="Typo.h6">
|
||||
<MudIcon Icon="@Icons.Material.Filled.EditAttributes" Class="mr-3 mb-n1" />
|
||||
<b> 发布! </b>
|
||||
</MudText>
|
||||
</TitleContent>
|
||||
<DialogContent>
|
||||
<MudPaper Elevation="0" Class="rounded-xl pa-1 " Style="background-color: transparent">
|
||||
<MudPaper Elevation="0" Class="rounded-xl pa-2 ma-2">
|
||||
<MudTextField @bind-Value="Exam.Name" Label="Title" Variant="Variant.Text" Margin="Margin.Dense" AutoFocus="true" />
|
||||
<MudTextField @bind-Value="Exam.TotalQuestions" Label="TotalQuestions" Variant="Variant.Text" Adornment="Adornment.End" AdornmentText="." Margin="Margin.Dense" AutoFocus="true" />
|
||||
<MudTextField @bind-Value="Exam.Score" Label="Score" Variant="Variant.Text" Adornment="Adornment.End" AdornmentText="." Margin="Margin.Dense" AutoFocus="true" />
|
||||
</MudPaper>
|
||||
<MudPaper Elevation="0" Class="rounded-xl pa-2 ma-2">
|
||||
|
||||
<MudChipSet T="SubjectAreaEnum" @bind-SelectedValue="@Exam.SubjectArea" CheckMark=true SelectionMode="SelectionMode.SingleSelection" Size="Size.Small">
|
||||
<MudChip Text="@SubjectAreaEnum.Literature.ToString()" Color="Color.Primary" Value="@SubjectAreaEnum.Literature"> @SubjectAreaEnum.Literature</MudChip>
|
||||
<MudChip Text="@SubjectAreaEnum.Mathematics.ToString()" Color="Color.Secondary" Value="@SubjectAreaEnum.Mathematics"> @SubjectAreaEnum.Mathematics</MudChip>
|
||||
<MudChip Text="@SubjectAreaEnum.English.ToString()" Color="Color.Info" Value="@SubjectAreaEnum.English"> @SubjectAreaEnum.English</MudChip>
|
||||
<MudChip Text="@SubjectAreaEnum.ComputerScience.ToString()" Color="Color.Success" Value="@SubjectAreaEnum.ComputerScience"> @SubjectAreaEnum.ComputerScience</MudChip>
|
||||
</MudChipSet>
|
||||
|
||||
|
||||
</MudPaper>
|
||||
<MudPaper Elevation="0" Class="rounded-xl pa-2 ma-2">
|
||||
|
||||
<MudChipSet T="ExamType" @bind-SelectedValue="@Exam.ExamType" CheckMark=true SelectionMode="SelectionMode.SingleSelection" Size="Size.Small">
|
||||
<MudChip Text="@ExamType.DailyTest.ToString()" Color="Color.Primary" Value="@ExamType.DailyTest"> @ExamType.DailyTest</MudChip>
|
||||
<MudChip Text="@ExamType.WeeklyExam.ToString()" Color="Color.Secondary" Value="@ExamType.WeeklyExam"> @ExamType.WeeklyExam</MudChip>
|
||||
<MudChip Text="@ExamType.MonthlyExam.ToString()" Color="Color.Info" Value="@ExamType.MonthlyExam"> @ExamType.MonthlyExam</MudChip>
|
||||
<MudChip Text="@ExamType.MidtermExam.ToString()" Color="Color.Success" Value="@ExamType.MidtermExam"> @ExamType.MidtermExam</MudChip>
|
||||
<MudChip Text="@ExamType.FinalExam.ToString()" Color="Color.Warning" Value="@ExamType.FinalExam"> @ExamType.FinalExam</MudChip>
|
||||
<MudChip Text="@ExamType.AITest.ToString()" Color="Color.Error" Value="@ExamType.AITest"> @ExamType.AITest</MudChip>
|
||||
</MudChipSet>
|
||||
</MudPaper>
|
||||
</MudPaper>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<MudButton OnClick="Cancel">Cancel</MudButton>
|
||||
<MudButton Color="Color.Error" OnClick="Confirm">确认</MudButton>
|
||||
</DialogActions>
|
||||
</MudDialog>
|
||||
|
||||
@code {
|
||||
[CascadingParameter]
|
||||
private IMudDialogInstance MudDialog { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public AssignmentDto Exam { get; set; } = new AssignmentDto();
|
||||
|
||||
|
||||
public SubjectAreaEnum SubjectArea { get; set; }
|
||||
private void Cancel() => MudDialog.Cancel();
|
||||
|
||||
private void Confirm()
|
||||
{
|
||||
Snackbar.Add("属性已更新", Severity.Success);
|
||||
MudDialog.Close(DialogResult.Ok(Exam));
|
||||
}
|
||||
}
|
34
TechHelper.Client/Pages/Common/QuestionCardDialog.razor
Normal file
34
TechHelper.Client/Pages/Common/QuestionCardDialog.razor
Normal file
@@ -0,0 +1,34 @@
|
||||
@using Entities.DTO
|
||||
@inject ISnackbar Snackbar
|
||||
|
||||
<MudDialog Class="rounded-xl" Style="background-color: #dedede" >
|
||||
<TitleContent>
|
||||
<MudText Typo="Typo.h6">
|
||||
<MudIcon Icon="@Icons.Material.Filled.EditAttributes" Class="mr-3 mb-n1" />
|
||||
<b> 编辑属性 </b>
|
||||
</MudText>
|
||||
</TitleContent>
|
||||
<DialogContent>
|
||||
<TechHelper.Client.Pages.Exam.AssignmentQuestionEdit AssignmentQuestion="Questions"/>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<MudButton OnClick="Cancel">Cancel</MudButton>
|
||||
<MudButton Color="Color.Error" OnClick="Confirm">确认</MudButton>
|
||||
</DialogActions>
|
||||
</MudDialog>
|
||||
|
||||
@code {
|
||||
[CascadingParameter]
|
||||
private IMudDialogInstance MudDialog { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public AssignmentQuestionDto Questions { get; set; } = new AssignmentQuestionDto();
|
||||
|
||||
private void Cancel() => MudDialog.Cancel();
|
||||
|
||||
private void Confirm()
|
||||
{
|
||||
Snackbar.Add("属性已更新", Severity.Success);
|
||||
MudDialog.Close(DialogResult.Ok(Questions));
|
||||
}
|
||||
}
|
22
TechHelper.Client/Pages/Common/SimpleCard.razor
Normal file
22
TechHelper.Client/Pages/Common/SimpleCard.razor
Normal file
@@ -0,0 +1,22 @@
|
||||
<MudPaper Elevation=5 Class="w-100 rounded-xl" Height="@Height" Style="@Style">
|
||||
<MudPaper Elevation=0 Class="w-100 pa-2 align-content-center" Height="20%" Style="background-color:transparent"> @TitleContent </MudPaper>
|
||||
<MudPaper Elevation=0 Class="w-100 pa-2" Style="background-color:transparent" Height="60%"> @BodyContent </MudPaper>
|
||||
<MudPaper Elevation=0 Class="w-100 pa-2 align-content-center" Style="background-color:transparent" Height="20%"> @FooterContent </MudPaper>
|
||||
</MudPaper>
|
||||
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public string Style { get; set; }
|
||||
[Parameter]
|
||||
public string Height { get; set; } = "200px";
|
||||
|
||||
[Parameter]
|
||||
public RenderFragment TitleContent { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public RenderFragment BodyContent { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public RenderFragment FooterContent { get; set; }
|
||||
}
|
86
TechHelper.Client/Pages/Common/TextEditorDialog.razor
Normal file
86
TechHelper.Client/Pages/Common/TextEditorDialog.razor
Normal file
@@ -0,0 +1,86 @@
|
||||
@using Entities.DTO
|
||||
@inject ISnackbar Snackbar
|
||||
|
||||
<MudDialog Class="rounded-xl" Style="background-color: #dedede" >
|
||||
<TitleContent>
|
||||
<MudText Typo="Typo.h6">
|
||||
<MudIcon Icon="@Icons.Material.Filled.EditAttributes" Class="mr-3 mb-n1" />
|
||||
<b> 编辑属性 </b>
|
||||
</MudText>
|
||||
</TitleContent>
|
||||
<DialogContent>
|
||||
<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>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<MudButton OnClick="Cancel">Cancel</MudButton>
|
||||
<MudButton Color="Color.Error" OnClick="Confirm">确认</MudButton>
|
||||
</DialogActions>
|
||||
</MudDialog>
|
||||
|
||||
@code {
|
||||
[CascadingParameter]
|
||||
private IMudDialogInstance MudDialog { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public BlazoredTextEditor TextEditor { get; set; } = new BlazoredTextEditor();
|
||||
[Parameter]
|
||||
public string EditorText { get; set; } = "{}";
|
||||
|
||||
private void HandleClick()
|
||||
{
|
||||
TextEditor.InsertText(EditorText);
|
||||
}
|
||||
|
||||
private void Cancel() => MudDialog.Cancel();
|
||||
|
||||
|
||||
protected async override Task OnInitializedAsync()
|
||||
{
|
||||
await DelayInsert();
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
|
||||
private async Task DelayInsert()
|
||||
{
|
||||
await Task.Delay(100);
|
||||
HandleClick();
|
||||
}
|
||||
|
||||
private async void Confirm()
|
||||
{
|
||||
Snackbar.Add("属性已更新", Severity.Success);
|
||||
EditorText = await TextEditor.GetText();
|
||||
MudDialog.Close(DialogResult.Ok(TextEditor));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user