From 3e107950fedbb206d5a155b9b8c8282f62fa8060 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Thu, 5 Sep 2024 20:16:40 +0200 Subject: [PATCH] Referenzierungsfehler behoben --- FWLAZ_Web/Components/Pages/QuizRun.razor | 34 +++++++++++++----------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/FWLAZ_Web/Components/Pages/QuizRun.razor b/FWLAZ_Web/Components/Pages/QuizRun.razor index 55b7336..3da6464 100644 --- a/FWLAZ_Web/Components/Pages/QuizRun.razor +++ b/FWLAZ_Web/Components/Pages/QuizRun.razor @@ -58,18 +58,18 @@ else - - - - - - - - - - - - + + + + + + + + + + + +
Fragen Gesamt@(CurrentSession.LoadGame.QuestionAnswers.Count)
Korrekt beantwortet@(CurrentSession.LoadGame.QuestionAnswers.Where(qa => qa.IsCorrect).Count())
Falsch beantwortet@(CurrentSession.LoadGame.QuestionAnswers.Where(qa => !qa.IsCorrect).Count())
Fragen Gesamt@(CurrentSession.LoadGame.QuestionAnswers.Count)
Korrekt beantwortet@(CurrentSession.LoadGame.QuestionAnswers.Where(qa => qa.IsCorrect).Count())
Falsch beantwortet@(CurrentSession.LoadGame.QuestionAnswers.Where(qa => !qa.IsCorrect).Count())
@@ -126,11 +126,13 @@ else if (CurrentSession.LoadGame.QuestionAnswers == null) CurrentSession.LoadGame.QuestionAnswers = new(); if (CurrentSession.LoadGame.CurrentQuestion != null) { - CurrentSession.LoadGame.QuestionAnswers.Add(new(CurrentSession.LoadGame.CurrentQuestion) - { - GivenAnswers = SelectedAnswers, - }); + CurrentSession.LoadGame.QuestionAnswers.Add(new(CurrentSession.LoadGame.CurrentQuestion)); + foreach (Answer aw in SelectedAnswers) + { + CurrentSession.LoadGame.QuestionAnswers[^1].GivenAnswers.Add(aw); + } } + SelectedAnswers.Clear(); CurrentSession.LoadGame.NextQuestion(); await CurrentSession.SaveAsync();