Example #1
0
        public UserExerciseSubmission FindSubmission(int id)
        {
            var submission = db.UserExerciseSubmissions.AsNoTracking().SingleOrDefault(x => x.Id == id);

            if (submission == null)
            {
                return(null);
            }
            submission.SolutionCode                       = textsRepo.GetText(submission.SolutionCodeHash);
            submission.AutomaticChecking.Output           = textsRepo.GetText(submission.AutomaticChecking.OutputHash);
            submission.AutomaticChecking.CompilationError = textsRepo.GetText(submission.AutomaticChecking.CompilationErrorHash);
            return(submission);
        }
Example #2
0
        public UserSolution GetDetails(int id)
        {
            var solution = db.UserSolutions.AsNoTracking().SingleOrDefault(x => x.Id == id);

            if (solution == null)
            {
                return(null);
            }
            solution.SolutionCode     = textsRepo.GetText(solution.SolutionCodeHash);
            solution.Output           = textsRepo.GetText(solution.OutputHash);
            solution.CompilationError = textsRepo.GetText(solution.CompilationErrorHash);
            return(solution);
        }