protected void SaveQuizClicked(object sender, EventArgs e)
        {
            var quiz = new Quiz();
            quiz.Name = quizName.Text;
            quiz.NumberOfQuestions = _Questions.Count;
            quiz.CreationDate = DateTime.Now;
            quiz.Questions = _Questions;
            quiz.Owner = GetUser();

            _QuizRepository.SaveQuiz(quiz);

            if (ViewState["Questions"] != null)
            {
                ViewState["Questions"] = null;
            }

            Server.Transfer("HomeWebForm.aspx");
        }
Ejemplo n.º 2
0
 public void SetQuiz(IQuizRepository quizRepository, int quizId)
 {
     _Quiz = quizRepository.GetQuiz(quizId);
 }