Referenzierungsfehler behoben

This commit is contained in:
BuildTools 2024-09-05 20:16:40 +02:00
parent e0649f503f
commit 3e107950fe

View File

@ -58,18 +58,18 @@ else
<table class="table"> <table class="table">
<tbody> <tbody>
<tr class="table-primary"> <tr class="table-primary">
<td>Fragen Gesamt</td> <td>Fragen Gesamt</td>
<td>@(CurrentSession.LoadGame.QuestionAnswers.Count)</td> <td>@(CurrentSession.LoadGame.QuestionAnswers.Count)</td>
</tr> </tr>
<tr class="table-success"> <tr class="table-success">
<td>Korrekt beantwortet</td> <td>Korrekt beantwortet</td>
<td>@(CurrentSession.LoadGame.QuestionAnswers.Where(qa => qa.IsCorrect).Count())</td> <td>@(CurrentSession.LoadGame.QuestionAnswers.Where(qa => qa.IsCorrect).Count())</td>
</tr> </tr>
<tr class="table-danger"> <tr class="table-danger">
<td>Falsch beantwortet</td> <td>Falsch beantwortet</td>
<td>@(CurrentSession.LoadGame.QuestionAnswers.Where(qa => !qa.IsCorrect).Count())</td> <td>@(CurrentSession.LoadGame.QuestionAnswers.Where(qa => !qa.IsCorrect).Count())</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
@ -126,11 +126,13 @@ else
if (CurrentSession.LoadGame.QuestionAnswers == null) CurrentSession.LoadGame.QuestionAnswers = new(); if (CurrentSession.LoadGame.QuestionAnswers == null) CurrentSession.LoadGame.QuestionAnswers = new();
if (CurrentSession.LoadGame.CurrentQuestion != null) if (CurrentSession.LoadGame.CurrentQuestion != null)
{ {
CurrentSession.LoadGame.QuestionAnswers.Add(new(CurrentSession.LoadGame.CurrentQuestion) CurrentSession.LoadGame.QuestionAnswers.Add(new(CurrentSession.LoadGame.CurrentQuestion));
{ foreach (Answer aw in SelectedAnswers)
GivenAnswers = SelectedAnswers, {
}); CurrentSession.LoadGame.QuestionAnswers[^1].GivenAnswers.Add(aw);
}
} }
SelectedAnswers.Clear(); SelectedAnswers.Clear();
CurrentSession.LoadGame.NextQuestion(); CurrentSession.LoadGame.NextQuestion();
await CurrentSession.SaveAsync(); await CurrentSession.SaveAsync();