예제 #1
0
        public void SelectCourse(ExamViewModel quizInfo)
        {
            Quiz existQuiz = quizRepo.GetSingle(q => q.CourseID == quizInfo.CourseID);


            ExamViewModel viewModel = new ExamViewModel();

            viewModel.Quizes = quizRepo.GetItemListByQueryWithOrderByDesc(q => q.CourseID == existQuiz.CourseID, q => q.CreatedDate, 0, 1000);
            CollectionAssert.Contains(existQuiz, viewModel);
        }//end method
예제 #2
0
        public void QuizQuestion(QuizQuestion quizQuestionInfo)
        {
            Quiz existQuiz = quizRepo.GetSingle(q => q.ID == quizQuestionInfo.QuizID);

            QuizQuestion newQuizQuestion = new QuizQuestion()
            {
                QuizID      = existQuiz.ID,
                Question    = quizQuestionInfo.Question,
                A           = quizQuestionInfo.A,
                B           = quizQuestionInfo.B,
                C           = quizQuestionInfo.C,
                D           = quizQuestionInfo.D,
                E           = quizQuestionInfo.E,
                CreatedDate = DateTime.Now,
                Answer      = quizQuestionInfo.Answer,
                Sequence    = quizQuestionInfo.Sequence,
            };

            List <QuizQuestion> quizesQuestions = quizQuestionRepo.GetAll();

            CollectionAssert.Contains(quizesQuestions, newQuizQuestion);
        }//end method