32 lines
809 B
C#
32 lines
809 B
C#
using MultipleChoiceTrainer.Models.DataModels;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MultipleChoiceTrainer.Models
|
|
{
|
|
public enum QuizType
|
|
{
|
|
Section,
|
|
Category
|
|
}
|
|
|
|
public class QuizViewModel
|
|
{
|
|
public QuizType QuizType { get; set; }
|
|
|
|
public int CurrentTypeId { get; set; }
|
|
|
|
public Question CurrentQuestion { 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; }
|
|
}
|
|
}
|