Now resets and kicks user back to chunk selection if the chunk has been learnt
This commit is contained in:
parent
2a49117995
commit
1a0c59af3a
|
@ -125,7 +125,11 @@
|
|||
|
||||
void GenerateQuestion()
|
||||
{
|
||||
if (DontSkipTheseCChar.Count < 5) throw new Exception("Finished this chunk of CChars");
|
||||
if (DontSkipTheseCChar.Count < 5)
|
||||
{
|
||||
FinishAndKickBackToLearn();
|
||||
return;
|
||||
}
|
||||
|
||||
int correctIndex = Random.Shared.Next(0, Answers.Length);
|
||||
|
||||
|
@ -142,6 +146,19 @@
|
|||
}
|
||||
}
|
||||
|
||||
void FinishAndKickBackToLearn()
|
||||
{
|
||||
Snackbar.Add("Congrats, you have compleated this chunk!", Severity.Success, config =>
|
||||
{
|
||||
config.RequireInteraction = true;
|
||||
config.CloseAfterNavigation = false;
|
||||
});
|
||||
Program.UpdateUiEvent -= OnUiUpdate;
|
||||
Program.CCharsLeft = 0;
|
||||
|
||||
navigator.NavigateTo("");
|
||||
}
|
||||
|
||||
async void Submit()
|
||||
{
|
||||
bool isCorrect = Answers.Any(x => x.isCorrect && x.isSelected);
|
||||
|
|
Loading…
Reference in New Issue