Quiz weiter gebaut;

This commit is contained in:
2020-06-10 21:26:12 +02:00
parent c7dfcf918f
commit 9a9388ab12
5 changed files with 49 additions and 4 deletions

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace MultipleChoiceTrainer.Models.DataModels
{
public class Evaluation
{
public bool Success => RightAnswer == GivenAnswer;
public bool RightAnswer { get; set; }
public bool GivenAnswer { get; set; }
public string Text { get; set; }
}
}

View File

@@ -20,6 +20,12 @@ namespace MultipleChoiceTrainer.Models
public Question CurrentQuestion { get; set; }
public IList<Choice> Choices { get; set; }
public IList<Choice> Choices { get; set; }
public bool HasPreviousResult => (Evaluations != null && Evaluations.Any());
public bool PassedPreviousQuestion => HasPreviousResult && !Evaluations.Any(e => !e.Success);
public string PreviousQuestion { get; set; }
public IList<Evaluation> Evaluations { get; set; }
}
}