Ejemplo n.º 1
0
        public void Update(string questionTitle, List <QuizAnswer> answers, QuizQuestionTypeEnum type)
        {
            this.Title     = questionTitle;
            this.UpdatedTs = DateTime.UtcNow;
            this.Type      = type;

            foreach (var item in QuizAnswers)
            {
                item.IsDeleted = true;
            }

            foreach (var answer in answers)
            {
                answer.QuizQuestionId = this.Id;
                this.QuizAnswers.Add(answer);
            }
        }
Ejemplo n.º 2
0
        public QuizQuestion(string quizId, string title, string keywordAnswer, QuizQuestionTypeEnum type) : this()
        {
            this.QuizId    = quizId;
            this.Title     = title;
            this.Type      = type;
            this.CreatedTs = DateTime.UtcNow;
            this.UpdatedTs = DateTime.UtcNow;

            this.QuizAnswers = new List <QuizAnswer>();
            this.QuizAnswers.Add(new QuizAnswer()
            {
                IsDeleted      = false,
                IsRight        = true,
                QuizQuestionId = this.Id,
                Title          = keywordAnswer,
                Order          = 1
            });
        }
Ejemplo n.º 3
0
        public void Update(string questionTitle, string keywordAnswer, QuizQuestionTypeEnum type)
        {
            this.Title     = questionTitle;
            this.UpdatedTs = DateTime.UtcNow;
            this.Type      = type;

            foreach (var item in QuizAnswers)
            {
                item.IsDeleted = true;
            }

            this.QuizAnswers.Add(new QuizAnswer()
            {
                IsDeleted      = false,
                IsRight        = true,
                QuizQuestionId = this.Id,
                Title          = keywordAnswer,
                Order          = 1
            });
        }
Ejemplo n.º 4
0
        public QuizQuestion(string quizId, string title, List <QuizAnswer> selectAnswers, QuizQuestionTypeEnum type)
            : this()
        {
            this.QuizId    = quizId;
            this.Title     = title;
            this.Type      = type;
            this.CreatedTs = DateTime.UtcNow;
            this.UpdatedTs = DateTime.UtcNow;

            this.QuizAnswers = new List <QuizAnswer>();
            foreach (var answer in selectAnswers)
            {
                answer.QuizQuestionId = this.Id;
                this.QuizAnswers.Add(answer);
            }
        }