Esempio n. 1
0
        public async Task <IActionResult> AddQuestions(QuestionModel model)
        {
            if (ModelState.IsValid)
            {
                SampleQuestion question = new SampleQuestion(model.QuestionText, model.Correct, model.Wrong1, model.Wrong2, model.Wrong3);
                await _context.AddQuestionToSample(question, model.QuizId);

                model.Number++;
            }
            if (model.IsFinished)
            {
                return(RedirectToAction("MainPage"));
            }
            return(View(model));
        }