2 |
3 | @foreach (var schoolClass in Model)
4 | {
5 | if (schoolClass.Selected)
6 | {
7 |
8 | }
9 | else
10 | {
11 |
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Web/JudgeSystem.Web/Views/Shared/Components/UserNames/Default.cshtml:
--------------------------------------------------------------------------------
1 | @model UserNamesViewModel
2 |
3 | @if (!string.IsNullOrEmpty(Model.StudentFullName))
4 | {
5 | @Model.StudentFullName (@Model.UserName)
6 | }
7 | else
8 | {
9 | @Model.UserName
10 | }
11 |
--------------------------------------------------------------------------------
/Web/JudgeSystem.Web/Views/Shared/EntityNotFoundError.cshtml:
--------------------------------------------------------------------------------
1 | @model EntityNotFoundErrorViewModel
2 |
3 |
4 |

5 |
6 | @Model.Message
7 |
--------------------------------------------------------------------------------
/Web/JudgeSystem.Web/Views/Shared/Error.cshtml:
--------------------------------------------------------------------------------
1 | @model ErrorViewModel
2 | @{
3 | this.ViewData["Title"] = "Error";
4 | }
5 |
6 | Error.
7 | An error occurred while processing your request.
8 |
9 | @if (this.Model.ShowRequestId)
10 | {
11 |
12 | Request ID: @this.Model.RequestId
13 |
14 | }
15 |
16 | Development Mode
17 |
18 | Swapping to Development environment will display more detailed information about the error that occurred.
19 |
20 |
21 | The Development environment shouldn't be enabled for deployed applications.
22 | It can result in displaying sensitive information from exceptions to end users.
23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
24 | and restarting the app.
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Web/JudgeSystem.Web/Views/Shared/Partials/LessonTypeOptions.cshtml:
--------------------------------------------------------------------------------
1 | @model string
2 | @{
3 | IEnumerable lessonTypes = Utility.GetSelectListItems();
4 | }
5 |
6 | @foreach (var lessonType in lessonTypes)
7 | {
8 | if (Model == lessonType.Value)
9 | {
10 |
11 | }
12 | else
13 | {
14 |
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Web/JudgeSystem.Web/Views/Shared/_SelectLanguagePartial.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | var returnUrl = string.IsNullOrEmpty(Context.Request.Path) ? "~/" : $"~{Context.Request.Path.Value}";
3 | returnUrl += Context.Request.QueryString.ToString();
4 | IRequestCultureFeature currentCulture = Context.Features.Get();
5 | string requestedCultureName = string.Empty;
6 | string requestedCultureDisplayName = string.Empty;
7 |
8 | if(currentCulture.RequestCulture.Culture.Name == GlobalConstants.CurrentCultureInfo)
9 | {
10 | requestedCultureName = GlobalConstants.EnglishCultureInfo;
11 | requestedCultureDisplayName = "EN";
12 | }
13 | else
14 | {
15 | requestedCultureName = GlobalConstants.CurrentCultureInfo;
16 | requestedCultureDisplayName = "BG";
17 | }
18 |
19 | }
20 |
21 |
26 | @requestedCultureDisplayName
27 |
28 |
--------------------------------------------------------------------------------
/Web/JudgeSystem.Web/Views/Student/ActivateStudentProfile.cshtml:
--------------------------------------------------------------------------------
1 | @inject IViewLocalizer Localizer
2 | @model StudentActivateProfileInputModel
3 |
4 | @{
5 | ViewData["Title"] = Localizer["Activate Student Profile"];
6 | }
7 |
8 | @ViewData["Title"]
9 |
22 |
23 |
--------------------------------------------------------------------------------
/Web/JudgeSystem.Web/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | this.Layout = "_Layout";
3 | }
4 |
--------------------------------------------------------------------------------
/Web/JudgeSystem.Web/bundleconfig.json:
--------------------------------------------------------------------------------
1 | // Configure bundling and minification for the project.
2 | // More info at https://go.microsoft.com/fwlink/?LinkId=808241
3 | [
4 | {
5 | "outputFileName": "wwwroot/css/site.min.css",
6 | // An array of relative input file paths. Globbing patterns supported
7 | "inputFiles": [
8 | "wwwroot/css/site.css"
9 | ]
10 | },
11 | {
12 | "outputFileName": "wwwroot/js/site.min.js",
13 | "inputFiles": [
14 | "wwwroot/js/site.js"
15 | ],
16 | // Optionally specify minification options
17 | //TODO: change enable to true when the project is ready
18 | //"enabled": true,
19 | "minify": {
20 | "enabled": false,
21 | "renameLocals": true
22 | },
23 | // Optionally generate .map file
24 | "sourceMap": false
25 | }
26 | ]
27 |
--------------------------------------------------------------------------------
/Web/JudgeSystem.Web/wwwroot/Templates/Cpp/sum.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | using namespace std;
3 | int main()
4 | {
5 | int a;
6 | cin >> a;
7 | int b;
8 | cin >> b;
9 | cout << a + b;
10 | }
--------------------------------------------------------------------------------
/Web/JudgeSystem.Web/wwwroot/Templates/Json/addTestsSchema.json:
--------------------------------------------------------------------------------
1 | {
2 | "definitions": {},
3 | "$schema": "http://json-schema.org/draft-07/schema#",
4 | "$id": "http://example.com/root.json",
5 | "type": "array",
6 | "title": "Tests",
7 | "items": {
8 | "$id": "tests",
9 | "type": "object",
10 | "title": "The Tests Schema",
11 | "required": [
12 | "InputData",
13 | "OutputData",
14 | "IsTrialTest"
15 | ],
16 | "properties": {
17 | "InputData": {
18 | "$id": "InputData",
19 | "type": "string",
20 | "title": "The Inputdata Schema",
21 | "default": ""
22 | },
23 | "OutputData": {
24 | "$id": "OutputData",
25 | "type": "string",
26 | "title": "The Outputdata Schema",
27 | "default": ""
28 | },
29 | "IsTrialTest": {
30 | "$id": "IsTrialTest",
31 | "type": "boolean",
32 | "title": "The Istrialtest Schema",
33 | "default": false,
34 | "examples": [
35 | true
36 | ]
37 | }
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/Web/JudgeSystem.Web/wwwroot/Templates/Json/addTestsTemplateFile.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "InputData": "your first test input comes here. Use \r\n for new line.",
4 | "OutputData": "your first test expected output comes here. Use \r\n for new line.",
5 | "IsTrialTest": true
6 | },
7 | {
8 | "InputData": "your second test input comes here. Use \r\n for new line.",
9 | "OutputData": "your second test expected output comes here. Use \r\n for new line.",
10 | "IsTrialTest": false
11 | },
12 | {
13 | "InputData": "your third test input comes here. Use \r\n for new line.",
14 | "OutputData": "your third test expected output comes here. Use \r\n for new line.",
15 | "IsTrialTest": false
16 | }
17 | ]
18 |
--------------------------------------------------------------------------------
/Web/JudgeSystem.Web/wwwroot/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaskoIT/JudgeSystem/c9aa9e2462ed80fa180756e3e3fe578b4bbd739e/Web/JudgeSystem.Web/wwwroot/icon.ico
--------------------------------------------------------------------------------
/Web/JudgeSystem.Web/wwwroot/images/error-occured.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaskoIT/JudgeSystem/c9aa9e2462ed80fa180756e3e3fe578b4bbd739e/Web/JudgeSystem.Web/wwwroot/images/error-occured.jpg
--------------------------------------------------------------------------------
/Web/JudgeSystem.Web/wwwroot/images/error.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaskoIT/JudgeSystem/c9aa9e2462ed80fa180756e3e3fe578b4bbd739e/Web/JudgeSystem.Web/wwwroot/images/error.jpg
--------------------------------------------------------------------------------
/Web/JudgeSystem.Web/wwwroot/images/no-access.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaskoIT/JudgeSystem/c9aa9e2462ed80fa180756e3e3fe578b4bbd739e/Web/JudgeSystem.Web/wwwroot/images/no-access.png
--------------------------------------------------------------------------------
/Web/JudgeSystem.Web/wwwroot/js/controllers/courseController.js:
--------------------------------------------------------------------------------
1 | //Dropdown courses
2 | var toggler = $(".rotate");
3 |
4 | for (let i = 0; i < toggler.length; i++) {
5 | $(toggler[i]).click(() => {
6 | $(toggler[i].parentElement.querySelector(".hidden-element")).toggle("active");
7 | toggler[i].classList.toggle("rotate-down");
8 | });
9 | }
--------------------------------------------------------------------------------
/Web/JudgeSystem.Web/wwwroot/js/controllers/feedbackController.js:
--------------------------------------------------------------------------------
1 | $(".feedback-delete-btn").on('click', (e) => {
2 | let button = $(e.target)[0];
3 | let feedbackId = button.dataset.id;
4 |
5 | $.post('/Administration/Feedback/Archive', { id: feedbackId })
6 | .done((response) => {
7 | $(button.parentElement.parentElement).hide();
8 | showInfo(response);
9 | })
10 | .fail((error) => {
11 | showError(error.responseText);
12 | });
13 | });
--------------------------------------------------------------------------------
/Web/JudgeSystem.Web/wwwroot/js/controllers/ipAddressController.js:
--------------------------------------------------------------------------------
1 | //Delete ip address
2 | let clickedDeleteButton;
3 |
4 | $("#delete-confirm-btn").on('click', (e) => {
5 |
6 | if (clickedDeleteButton) {
7 | let ipAddressId = clickedDeleteButton.dataset.id;
8 |
9 | $.post('/Administration/AllowedIpAddress/Delete', { id: ipAddressId })
10 | .done((response) => {
11 | $(clickedDeleteButton.parentElement.parentElement).hide();
12 | showInfo(response);
13 | })
14 | .fail((error) => {
15 | showError(error.responseText);
16 | });
17 | }
18 | });
19 |
20 | $(".ipAddressDeleteBtn").on('click', (e) => {
21 | clickedDeleteButton = $(e.target)[0];
22 | });
--------------------------------------------------------------------------------
/Web/JudgeSystem.Web/wwwroot/js/fileUploader.js:
--------------------------------------------------------------------------------
1 | $("form").on("change", ".file-upload-field", function () {
2 | var files = this.files;
3 | let fileNames = "Select your files!";
4 | if (files.length > 0) {
5 | fileNames = Array.from(files).map(x => x.name).join(", ");
6 | }
7 |
8 |
9 | $(this).parent(".file-upload-wrapper").attr("data-text", fileNames);
10 | let value = this.files;
11 | });
--------------------------------------------------------------------------------
/Web/JudgeSystem.Web/wwwroot/js/initializeDateTimePicker.js:
--------------------------------------------------------------------------------
1 | function initializeDateTimePicker(id) {
2 | $(`#${id}`).datetimepicker({
3 | format: 'd/m/Y H:i',
4 | lang: 'en',
5 | });
6 | }
--------------------------------------------------------------------------------
/Web/JudgeSystem.Web/wwwroot/js/notification.js:
--------------------------------------------------------------------------------
1 | function showInfo(message) {
2 | let infoBox = $('#infoBox');
3 | infoBox.find('div > span').text(message);
4 | infoBox.show();
5 | setTimeout(function () {
6 | $('#infoBox').fadeOut();
7 | }, 4000);
8 | }
9 |
10 | function showError(err) {
11 | let errorBox = $('#errorBox');
12 | errorBox.find('div > span').text(err);
13 | errorBox.show();
14 | }
15 |
--------------------------------------------------------------------------------
/Web/JudgeSystem.Web/wwwroot/js/site.js:
--------------------------------------------------------------------------------
1 | //Show error or info message
2 | let infoBox = $('#infoBox');
3 | let errorBox = $('#errorBox');
4 |
5 | infoBox.on('click', () => {
6 | infoBox.hide();
7 | });
8 |
9 | errorBox.on('click', () => {
10 | errorBox.hide();
11 | });
12 |
13 | if (infoBox.find('span').text().trim() !== "") {
14 | infoBox.show();
15 | setTimeout(function () {
16 | $('#infoBox').fadeOut();
17 | }, 4000);
18 | }
19 |
20 | if (errorBox.find('span').text() !== "") {
21 | errorBox.show();
22 | }
--------------------------------------------------------------------------------
/Web/JudgeSystem.Web/wwwroot/js/site.min.js:
--------------------------------------------------------------------------------
1 | //Show error or info message
2 | let infoBox = $('#infoBox');
3 | let errorBox = $('#errorBox');
4 |
5 | infoBox.on('click', () => {
6 | infoBox.hide();
7 | });
8 |
9 | errorBox.on('click', () => {
10 | errorBox.hide();
11 | });
12 |
13 | if (infoBox.find('span').text().trim() !== "") {
14 | infoBox.show();
15 | setTimeout(function () {
16 | $('#infoBox').fadeOut();
17 | }, 4000);
18 | }
19 |
20 | if (errorBox.find('span').text() !== "") {
21 | errorBox.show();
22 | }
--------------------------------------------------------------------------------
/Workers/JudgeSystem.Checkers/Checker.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | using JudgeSystem.Executors;
4 | using JudgeSystem.Workers.Common;
5 |
6 | namespace JudgeSystem.Checkers
7 | {
8 | public class Checker
9 | {
10 | private readonly IExecutor executor;
11 |
12 | public Checker(IExecutor executor)
13 | {
14 | this.executor = executor;
15 | }
16 |
17 | public async Task Check(string filePath, string input, string expectedOutput, int timeLimit, int memoryLimit)
18 | {
19 | ExecutionResult executionResult = await executor.Execute(filePath, input, timeLimit, memoryLimit);
20 | var checkerResult = new CheckerResult(executionResult);
21 | if (!executionResult.IsSuccesfull)
22 | {
23 | checkerResult.IsCorrect = false;
24 | return checkerResult;
25 | }
26 |
27 | if(executionResult.Output.Trim() == expectedOutput.Trim())
28 | {
29 | checkerResult.IsCorrect = true;
30 | }
31 | else
32 | {
33 | checkerResult.IsCorrect = false;
34 | }
35 |
36 | return checkerResult;
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/Workers/JudgeSystem.Checkers/JudgeSystem.Checkers.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Workers/JudgeSystem.Compilers/Compiler.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 |
3 | using JudgeSystem.Common;
4 | using JudgeSystem.Workers.Common;
5 |
6 | namespace JudgeSystem.Compilers
7 | {
8 | internal class Compiler
9 | {
10 | public CompileResult Compile(string arguments, string processFileName)
11 | {
12 | var process = new Process();
13 | var info = new ProcessStartInfo
14 | {
15 | Arguments = arguments,
16 | FileName = processFileName,
17 | UseShellExecute = false,
18 | RedirectStandardError = true,
19 | CreateNoWindow = true
20 | };
21 |
22 | process.StartInfo = info;
23 |
24 | process.Start();
25 | string errors = process.StandardError.ReadToEnd();
26 | process.WaitForExit();
27 |
28 | return new CompileResult(errors);
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Workers/JudgeSystem.Compilers/CompilerFactory.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using JudgeSystem.Workers.Common;
4 |
5 | namespace JudgeSystem.Compilers
6 | {
7 | public class CompilerFactory : ICompilerFactory
8 | {
9 | private const string UnsupportedCompilerErrorMessage = "Unsupported compiler.";
10 |
11 | public ICompiler CreateCompiler(ProgrammingLanguage programmingLanguage)
12 | {
13 | switch (programmingLanguage)
14 | {
15 | case ProgrammingLanguage.CSharp:
16 | return new CSharpCompiler();
17 | case ProgrammingLanguage.CPlusPlus:
18 | return new CPlusPlusCompiler();
19 | case ProgrammingLanguage.Java:
20 | return new JavaCompiler();
21 | default:
22 | throw new ArgumentException(UnsupportedCompilerErrorMessage);
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Workers/JudgeSystem.Compilers/ICompiler.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | using JudgeSystem.Workers.Common;
4 |
5 | namespace JudgeSystem.Compilers
6 | {
7 | public interface ICompiler
8 | {
9 | CompileResult Compile(string fileName, string workingDirectory, IEnumerable sources = null);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Workers/JudgeSystem.Compilers/ICompilerFactory.cs:
--------------------------------------------------------------------------------
1 | using JudgeSystem.Workers.Common;
2 |
3 | namespace JudgeSystem.Compilers
4 | {
5 | public interface ICompilerFactory
6 | {
7 | ICompiler CreateCompiler(ProgrammingLanguage programmingLanguage);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Workers/JudgeSystem.Compilers/JudgeSystem.Compilers.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Workers/JudgeSystem.Executors/CPlusPlusExecutor.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using System.Runtime.InteropServices;
3 | using System.Threading.Tasks;
4 |
5 | using JudgeSystem.Common;
6 | using JudgeSystem.Workers.Common;
7 |
8 | namespace JudgeSystem.Executors
9 | {
10 | public class CPlusPlusExecutor : IExecutor
11 | {
12 | public Task Execute(string filePath, string input, int timeLimit, int memoryLimit)
13 | {
14 | string arguments = filePath;
15 | if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
16 | {
17 | arguments = $"{GlobalConstants.ConsoleComamndPrefix} {CompilationSettings.SetCPlusPlusCompilerPathCommand} & {arguments}";
18 | }
19 |
20 | var executor = new Executor();
21 | return executor.Execute(arguments, input, timeLimit, memoryLimit);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Workers/JudgeSystem.Executors/CSharpExecutor.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 | using System.Threading.Tasks;
3 |
4 | using JudgeSystem.Common;
5 | using JudgeSystem.Workers.Common;
6 |
7 | namespace JudgeSystem.Executors
8 | {
9 | public class CSharpExecutor : IExecutor
10 | {
11 | public Task Execute(string filePath, string input, int timeLimit, int memoryLimit)
12 | {
13 | string arguments = $"{GlobalConstants.ConsoleComamndPrefix} dotnet {filePath}";
14 | var executor = new Executor();
15 | return executor.Execute(arguments, input, timeLimit, memoryLimit);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Workers/JudgeSystem.Executors/ExecutorFactory.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using JudgeSystem.Workers.Common;
4 |
5 | namespace JudgeSystem.Executors
6 | {
7 | public class ExecutorFactory : IExecutorFactory
8 | {
9 | private const string UnsupportedExecutorErrorMessage = "Unsupported executor.";
10 |
11 | public IExecutor CreateExecutor(ProgrammingLanguage programmingLanguage)
12 | {
13 | switch (programmingLanguage)
14 | {
15 | case ProgrammingLanguage.CSharp:
16 | return new CSharpExecutor();
17 | case ProgrammingLanguage.CPlusPlus:
18 | return new CPlusPlusExecutor();
19 | case ProgrammingLanguage.Java:
20 | return new JavaExecutor();
21 | default:
22 | throw new ArgumentException(UnsupportedExecutorErrorMessage);
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Workers/JudgeSystem.Executors/IExecutor.cs:
--------------------------------------------------------------------------------
1 | using JudgeSystem.Workers.Common;
2 | using System.Threading.Tasks;
3 |
4 | namespace JudgeSystem.Executors
5 | {
6 | public interface IExecutor
7 | {
8 | Task Execute(string filePath, string input, int timeLimit, int memoryLimit);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Workers/JudgeSystem.Executors/IExecutorFactory.cs:
--------------------------------------------------------------------------------
1 | using JudgeSystem.Workers.Common;
2 |
3 | namespace JudgeSystem.Executors
4 | {
5 | public interface IExecutorFactory
6 | {
7 | IExecutor CreateExecutor(ProgrammingLanguage programmingLanguage);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Workers/JudgeSystem.Executors/JudgeSystem.Executors.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Workers/JudgeSystem.Workers.Common/CheckerResult.cs:
--------------------------------------------------------------------------------
1 | namespace JudgeSystem.Workers.Common
2 | {
3 | public class CheckerResult : ExecutionResult
4 | {
5 | public CheckerResult(ExecutionResult executionResult)
6 | {
7 | Error = executionResult.Error;
8 | Output = executionResult.Output;
9 | ExitCode = executionResult.ExitCode;
10 | MemoryUsed = executionResult.MemoryUsed;
11 | PrivilegedProcessorTime = executionResult.PrivilegedProcessorTime;
12 | TimeWorked = executionResult.TimeWorked;
13 | Type = executionResult.Type;
14 | UserProcessorTime = executionResult.UserProcessorTime;
15 | }
16 |
17 | public bool IsCorrect { get; set; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Workers/JudgeSystem.Workers.Common/CompileResult.cs:
--------------------------------------------------------------------------------
1 | namespace JudgeSystem.Workers.Common
2 | {
3 | public class CompileResult
4 | {
5 | public CompileResult()
6 | {
7 | }
8 |
9 | public CompileResult(string errors)
10 | {
11 | Errors = errors;
12 | }
13 |
14 | public string OutputFilePath { get; set; }
15 |
16 | public string Errors { get; private set; }
17 |
18 | public bool IsCompiledSuccessfully => string.IsNullOrEmpty(Errors);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Workers/JudgeSystem.Workers.Common/ExecutionResult.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace JudgeSystem.Workers.Common
4 | {
5 | public class ExecutionResult
6 | {
7 | public ExecutionResult()
8 | {
9 | Output = string.Empty;
10 | Error = string.Empty;
11 | ExitCode = 0;
12 | Type = ProcessExecutionResultType.Success;
13 | PrivilegedProcessorTime = default;
14 | UserProcessorTime = default;
15 | MemoryUsed = 0;
16 | }
17 |
18 | public string Output { get; set; }
19 |
20 | public string Error { get; set; }
21 |
22 | public bool IsSuccesfull => string.IsNullOrEmpty(Error);
23 |
24 | public int ExitCode { get; set; }
25 |
26 | public ProcessExecutionResultType Type { get; set; }
27 |
28 | public TimeSpan TimeWorked { get; set; }
29 |
30 | public TimeSpan PrivilegedProcessorTime { get; set; }
31 |
32 | public TimeSpan UserProcessorTime { get; set; }
33 |
34 | public long MemoryUsed { get; set; }
35 |
36 | public TimeSpan TotalProcessorTime => PrivilegedProcessorTime + UserProcessorTime;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/Workers/JudgeSystem.Workers.Common/JudgeSystem.Workers.Common.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 | latest
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Workers/JudgeSystem.Workers.Common/ProcessExecutionResultType.cs:
--------------------------------------------------------------------------------
1 | namespace JudgeSystem.Workers.Common
2 | {
3 | public enum ProcessExecutionResultType
4 | {
5 | Success = 1,
6 | TimeLimit = 2,
7 | MemoryLimit = 3,
8 | RunTimeError = 4,
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Workers/JudgeSystem.Workers.Common/ProgrammingLanguage.cs:
--------------------------------------------------------------------------------
1 | namespace JudgeSystem.Workers.Common
2 | {
3 | public enum ProgrammingLanguage
4 | {
5 | CSharp = 1,
6 | Java = 2,
7 | CPlusPlus = 3
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3.4'
2 |
3 | services:
4 | judge-system:
5 | build:
6 | context: .
7 | dockerfile: Web\JudgeSystem.Web/Dockerfile
8 | image: judge-system-image:latest
9 | ports:
10 | - "80:80"
11 | container_name: judge-system-instance
12 | restart: on-failure
--------------------------------------------------------------------------------