fix: show only parent comments as feedback reasons to children

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
JannisandClaude Sonnet 5.5 committed 2026-10-10 14:18:26 +02:00
1 parent 24a6a1aa66
commit d1ff7dd291
2 files changed
+7 -2

No files matched your search

@@ -140,7 +140,8 @@ internal static class LearningMapper
feedback = new LearningItemFeedbackDto(
answer.Verdict,
answer.AwardedPoints,
attempt.Status == LearningAttemptStatus.InProgress ? null : answer.Reason,
// Nur Kommentare der Eltern; Meldungen der Automatik („Keine Antwort.“) stehen schon im Ergebnis.
attempt.Status != LearningAttemptStatus.InProgress && answer.Grader == LearningGrader.Parent ? answer.Reason : null,
visibility.ShowSolution ? item.CorrectAnswer : null,
visibility.ShowSolution ? item.Explanation : null);
}
@@ -128,11 +128,15 @@ public sealed class LearningMapperTests
{
var (set, attempt) = Build(LearningMode.Practice, true, LearningAttemptStatus.InProgress);
attempt.Answers[0].Reason = ParentReason;
attempt.Answers[0].Grader = LearningGrader.Parent;
attempt.Answers[1].Reason = "Keine Zahl erkannt."; // Meldung der Automatik: kein Kommentar der Eltern
Assert.DoesNotContain(ParentReason, Json(set, attempt));
attempt.Status = LearningAttemptStatus.Reviewed;
Assert.Contains(ParentReason, Json(set, attempt));
var json = Json(set, attempt);
Assert.Contains(ParentReason, json);
Assert.DoesNotContain("Keine Zahl erkannt.", json);
}
[Fact]