namespace Blazor.Models;

public class QuestionModel
{
    public int Id { get; private set; }
    public string Content { get; set; }
    public int IdChapter { get; private set; }
    public int? IdAnswerGood { get; set; }
    public int Difficulty { get; set; }
    public int NbFails { get; private set; }

    public QuestionModel(int id, string content, int idChapter, int difficulty, int nbFails, int? idAnswerGood = null)
    {
        Id = id;
        Content = content;
        IdChapter = idChapter;
        Difficulty = difficulty;
        NbFails = nbFails;
        IdAnswerGood = idAnswerGood;
    }

    public void addFails(int nb) { NbFails += nb; }
    public void removeFails(int nb) { NbFails -= nb; }
}
