Exemplo n.º 1
0
        public void CreateListOfQuestionsTest(int userId, int testId)
        {
            AttemptCreator       creator = new AttemptCreator();
            AttemptBusinessModel result1 = creator.CreateAttempt(userId, testId);
            AttemptBusinessModel result2 = creator.CreateAttempt(userId, testId);
            AttemptBusinessModel result3 = creator.CreateAttempt(userId, testId);

            string questions1 = JsonSerializer.Serialize(result1.Questions);
            string questions2 = JsonSerializer.Serialize(result2.Questions);
            string questions3 = JsonSerializer.Serialize(result3.Questions);

            Assert.AreNotEqual(questions1, questions2, questions3);
        }
Exemplo n.º 2
0
        public IActionResult GetTestAttempt(int testId, int userId)
        {
            AttemptCreator studentattempt = new AttemptCreator();
            var            attempt        = studentattempt.CreateAttempt(userId, testId);

            return(Json(new Mapper().AttemptBusinessModelToConcreteAttemptOutputModel(attempt, testId, userId)));
        }