feat: show the confirmed grade in the head of the child's result page
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f98b1c21c4
commit
d2ef08e17b
2 files changed
+23
-1
No files matched your search
@@ -29,7 +29,14 @@
|
||||
}
|
||||
else if (_attempt.Status != LearningAttemptStatus.InProgress)
|
||||
{
|
||||
<MudText Typo="Typo.h4" HtmlTag="h1" Class="mb-2">@_attempt.SetTitle</MudText>
|
||||
<div class="d-flex align-center flex-wrap gap-2 mb-2 fp-learning-result-head">
|
||||
<MudText Typo="Typo.h4" HtmlTag="h1">@_attempt.SetTitle</MudText>
|
||||
@if (_attempt.Result is { IsFinal: true, Grade: { } headGrade })
|
||||
{
|
||||
@* Die bestätigte Note steht schon im Kopf des Lernzettels, nicht erst in der Liste. *@
|
||||
<MudChip T="string" Color="Color.Primary" Icon="@Icons.Material.Filled.Grade" Class="fp-learning-head-grade">@LearningFormat.Grade(headGrade)</MudChip>
|
||||
}
|
||||
</div>
|
||||
<AttemptResult Attempt="_attempt" />
|
||||
}
|
||||
else
|
||||
|
||||
@@ -324,9 +324,24 @@ public sealed class AttemptRunnerTests : LearningTestBase
|
||||
var cut = Open(attempt);
|
||||
|
||||
Assert.Equal("Note 1 – sehr gut", Text(cut.Find(".fp-learning-grade")));
|
||||
Assert.Equal("Note 1 – sehr gut", Text(cut.Find(".fp-learning-result-head .fp-learning-head-grade"))); // auch im Kopf des Zettels
|
||||
Assert.Contains("Von Mama oder Papa bestätigt", cut.Find(".fp-learning-final").TextContent);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void An_unconfirmed_result_shows_no_grade_in_the_head()
|
||||
{
|
||||
var attempt = Attempt(LearningMode.Exam, items: [FakeLearningApi.AttemptItem(0, "Frage", feedback: new LearningItemFeedbackDto(LearningVerdict.Correct, 1, null, null, null))]) with
|
||||
{
|
||||
Status = LearningAttemptStatus.Submitted,
|
||||
Result = new MyLearningResultDto(Guid.NewGuid(), 1, LearningAttemptStatus.Submitted, Start, false, 1, 1, 0, null, false),
|
||||
};
|
||||
|
||||
var cut = Open(attempt);
|
||||
|
||||
Assert.Empty(cut.FindAll(".fp-learning-head-grade"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Unknown_attempts_are_reported_with_a_way_back()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user