Esempio n. 1
0
        public IActionResult Quiz(QCreate quiz, string action, int Useranswer)
        {
            if (!ModelState.IsValid)
            {
                return(View(quiz));
            }
            Qquest quest = new Qquest();

            if (action == "Next")
            {
                quest.answer = Useranswer;
                quiz.Generate();
                quest.number1 = quiz.num1;
                quest.number2 = quiz.num2;
                quest.oper    = quiz.operat;
                quest.count();
                quiz.Expressions.Add(quest);
                return(View(quiz));
            }
            else
            {
                quest.answer  = Useranswer;
                quest.number1 = quiz.num1;
                quest.number2 = quiz.num2;
                quest.oper    = quiz.operat;
                quest.count();
                quiz.Expressions.Add(quest);
                return(View("Result", quiz));
            }
        }
Esempio n. 2
0
        public IActionResult Quiz()
        {
            QCreate quiz = new QCreate();

            quiz.Generate();
            return(View(quiz));
        }