Ejemplo n.º 1
0
 public Result(User userTakingTheTest, List <Question> questionsAsked, List <Answer> selectedAnswers, QuizType quizType, DateTime dateTime, QuizTemplate questionSuite)
 {
     User            = userTakingTheTest;
     QuestionsAsked  = questionsAsked;
     SelectedAnswers = selectedAnswers;
     QuizType        = quizType;
     DateTime        = dateTime;
     QuestionSuite   = questionSuite;
 }
Ejemplo n.º 2
0
        public Quiz CreateQuiz(string name, QuizTemplate quizTemplate)
        {
            User user = GetUserByName(name);
            Quiz exam = new Quiz(GetDBTime(), user, quizTemplate);

            Context.Exams.Add(exam);
            Context.SaveChanges();
            return(exam);
        }
Ejemplo n.º 3
0
        internal void DeleteQuestionSuiteById(int suiteId)
        {
            QuizTemplate qs = Context.QuestionSuites.FirstOrDefault(q => q.Id == suiteId);

            if (qs != null)
            {
                Context.QuestionSuites.Remove(qs);
                Context.SaveChanges();
            }
        }
Ejemplo n.º 4
0
 public Quiz(DateTime startDate, User user, QuizTemplate suite)
 {
     StartDate = startDate;
     User      = user;
     Suite     = suite;
 }
Ejemplo n.º 5
0
 public QuizTemplate CreateTemporaryQuizTemplate(QuizTemplate newQuestionSuite)
 {
     Context.QuestionSuites.Add(newQuestionSuite);
     Context.SaveChanges();
     return(newQuestionSuite);
 }