Exemple #1
0
        public IDataResult <List <Question> > GetExam(string categoryId)
        {
            var parameter    = _examParameterService.GetParameter().Data;
            var questionList = _questionDal.Get(x => x.CategoryId == categoryId).OrderBy(x => Guid.NewGuid()).ToList();

            parameter ??= new ExamParameter();

            if (questionList.Count < parameter.NumberOfQuestions)
            {
                return(new ErrorDataResult <List <Question> >(Messages.NotEnoughQuestions));
            }

            var exam = questionList.Take(parameter.NumberOfQuestions).ToList();

            return(new SuccessDataResult <List <Question> >(exam));

            //todo daha önce çözdüğü soruyu bir daha çekmesin
        }
Exemple #2
0
        public IActionResult Index()
        {
            var parameter = _examParameterService.GetParameter().Data;

            return(View(parameter));
        }