Beispiel #1
0
        private static void TestCCompiler()
        {
            string source_path           = DummyCode.getCCode();
            ProgrammingLanguageEnum lang = ProgrammingLanguageEnum.C;

            CodeRunner runner = new CodeRunner(lang, source_path, DummyData.intput, DummyData.expected_output, time_limit);

            runner.OnExecutionFinished += CodeResultsHandler;
            runner.RunCode();
        }
Beispiel #2
0
        public void judge(SubmissionFormData submissison, Problem problem)
        {
            int problem_code = problem.Id;

            logger.Info(String.Format("Submission recieved from user {0}, for Problem {1}", 1, problem_code));

            var runner = new JudgeCodeRunner.CodeRunner((ProgrammingLanguageEnum)submissison.ProgrammingLanguageId,
                                                        submissison.SourceCode,
                                                        problem.TestCaseInput,
                                                        problem.TestCaseOutput,
                                                        problem.TimeLimit);


            runner.OnExecutionFinished += (sender, e) => {
                logger.Info("Execution finished");
                OnSubmissionStatusChange(this, new ExecutionResultEventArgs(e.ExecutionResult));
            };

            runner.RunCode();
        }