Compare commits

..
2 Commits
2 changed files with 19 additions and 5 deletions

No files matched your search

+14 -2
View File
@@ -11,9 +11,21 @@
@if (CurrentSession.LoadGame != null) @if (CurrentSession.LoadGame != null)
{ {
<h1>Vorherigen Lauf fortsetzen</h1> <h1>Vorheriges Quiz</h1>
<div>@CurrentSession.LoadGame.Title</div> <div>@CurrentSession.LoadGame.Title</div>
<button class="btn btn-primary" type="button" @onclick="() => StartQuiz(CurrentSession.LoadGame)">Fortsetzen</button>
@if (CurrentSession.LoadGame.Questions?.Count == 0 && CurrentSession.LoadGame.QuestionAnswers != null)
{
<button class="btn btn-primary" type="button" @onclick="() => StartQuiz(CurrentSession.LoadGame)">
Ergebnisse ansehen</button>
}
else
{
<button class="btn btn-primary" type="button" @onclick="() => StartQuiz(CurrentSession.LoadGame)">
Fortsetzen
</button>
}
<button class="btn btn-outline-danger" type="button" @onclick="DeleteGameState">Löschen</button> <button class="btn btn-outline-danger" type="button" @onclick="DeleteGameState">Löschen</button>
} }
+5 -3
View File
@@ -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();