public async Task CheckSolution(string userId, string code, int problemId, string inputVariables)
        {
            var codeFile      = WriteCodeToFile(userId, code, inputVariables);
            var inputsOutputs = await ProblemAccessor.GetExpectedInputsOutputs(problemId);

            await Task.Run(() => ExecuteSolution(codeFile, inputsOutputs));

            File.Delete(codeFile);
        }
Esempio n. 2
0
        public IQueryable <ProblemVO> GetAll()
        {
            IQueryable <ProblemVO> qProblem;

            using (var problemAccessor = new ProblemAccessor())
            {
                qProblem = problemAccessor.Repo.All;
            }
            return(qProblem);
        }
Esempio n. 3
0
        public List <ProblemVO> FindAll()
        {
            List <ProblemVO> problermList;

            using (var problemAccessor = new ProblemAccessor())
            {
                problermList = problemAccessor.Repo.All.ToList();
            }
            return(problermList);
        }
Esempio n. 4
0
 public ProblemBL()
 {
     _problemAccessor = new ProblemAccessor();
 }