Skip to content

Commit e4bae74

Browse files
committed
new submit flow working
Signed-off-by: Tathagat Thapliyal <[email protected]>
1 parent 0cae3c0 commit e4bae74

File tree

12 files changed

+233
-252
lines changed

12 files changed

+233
-252
lines changed

config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ exports = module.exports = {
1111
// Database config for a postgresql db (docker based or native)
1212
DB: {
1313
DATABASE: process.env.DB_NAME || 'judgeapi',
14-
USERNAME: process.env.DB_USER|| 'judgeapi',
15-
PASSWORD: process.env.DB_PASS|| 'judgeapi',
14+
USERNAME: process.env.DB_USER || 'judgeapi',
15+
PASSWORD: process.env.DB_PASS || 'judgeapi',
1616
HOST: process.env.DB_HOST || 'localhost'
1717
},
1818

docs/api_data.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api_data.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[ { "type": "get", "url": "/langs", "title": "GET /langs", "description": "<p>Get all supported Languages</p>", "name": "GetLangs", "group": "Langs", "version": "0.0.1", "filename": "src/routes/api/langs.ts", "groupTitle": "Langs", "sampleRequest": [ { "url": "http://judge.cb.lk/langs" } ] }, { "type": "post", "url": "/run", "title": "POST /run", "description": "<p>Run a code and get its output</p>", "name": "PostRun", "group": "Run", "version": "0.0.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String(Base64)", "optional": false, "field": "source", "description": "<p>source code to run (encoded in base64)</p>" }, { "group": "Parameter", "type": "Enum", "optional": false, "field": "lang", "description": "<p>Language of code to execute</p>" }, { "group": "Parameter", "type": "String(Base64)", "optional": false, "field": "input", "description": "<p>[Optional] stdin input for the program (encoded in base64)</p>" } ] }, "examples": [ { "title": "lang (choices)", "content": "py2,java7,java8,cpp,cpp14,nodejs6,nodejs8,csharp", "type": "String" } ] }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Number", "optional": false, "field": "id", "description": "<p>Submission id</p>" }, { "group": "Success 200", "type": "String(Base64)", "optional": false, "field": "stdout", "description": "<p>Output of stdout of execution (encoded in base64)</p>" }, { "group": "Success 200", "type": "String(Base64)", "optional": false, "field": "stderr", "description": "<p>Output of stderr of execution (encoded in base64)</p>" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "statuscode", "description": "<p>Result of operation</p>" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"id\": 10,\n \"statuscode\": 0,\n \"stdout\": \"NA0KMg0KMw==\"\n \"stderr\": \"VHlwZUVycm9y\"\n}", "type": "JSON" } ] }, "filename": "src/routes/api/run.ts", "groupTitle": "Run", "sampleRequest": [ { "url": "http://judge.cb.lk/run" } ] }, { "type": "get", "url": "/submissions", "title": "GET /submissions", "description": "<p>List of all previous submissions</p>", "name": "GetSubmissions", "group": "Submissions", "version": "0.0.1", "filename": "src/routes/api/submissions.ts", "groupTitle": "Submissions", "sampleRequest": [ { "url": "http://judge.cb.lk/submissions" } ] }, { "type": "post", "url": "/submissions", "title": "POST /submissions", "description": "<p>Check a code with given testcases</p>", "name": "PostSubmissions", "group": "Submissions", "version": "0.0.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "URL", "optional": false, "field": "source", "description": "<p>URL of file containing the source code to run</p>" }, { "group": "Parameter", "type": "Enum", "optional": false, "field": "lang", "description": "<p>Language of code to execute</p>" }, { "group": "Parameter", "type": "Array(Object)", "optional": false, "field": "testcases", "description": "<p>Array of urls of input and output testcases</p>" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "getstdout", "description": "<p>Defines if the results will carry value of stdout and stderr (default: false)</p>" }, { "group": "Parameter", "type": "URL", "optional": false, "field": "callbackurl", "description": "<p>An url which we will call (POST) with the judgement results</p>" } ] }, "examples": [ { "title": "testcases", "content": "[\n {\"input\": \"http://file.cb.lk/1872634.txt\", \"output\": \"http://file.cb.lk/151312.txt\"},\n {\"input\": \"http://file.cb.lk/1827312.txt\", \"output\": \"http://file.cb.lk/123121.txt\"},\n {\"input\": \"http://file.cb.lk/1314114.txt\", \"output\": \"http://file.cb.lk/513123.txt\"}\n]", "type": "Array" }, { "title": "lang (choices)", "content": "py2,java7,java8,cpp,cpp14,nodejs6,nodejs8,csharp", "type": "String" } ] }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Number", "optional": false, "field": "id", "description": "" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "accepted", "description": "" }, { "group": "Success 200", "type": "URL", "optional": false, "field": "callbackurl", "description": "<p>The url we will POST back the result to</p>" } ], "Callback": [ { "group": "Callback", "type": "Number", "optional": false, "field": "id", "description": "" }, { "group": "Callback", "type": "Array", "optional": false, "field": "results", "description": "<p>Array of object with results (with optionally stderr and stdout inside them if <code>getstdout</code> was set <strong>true</strong> in request)</p>" } ] }, "examples": [ { "title": "Success-Example:", "content": "HTTP/1.1 200 OK\n{\n \"id\": 22,\n \"accepted\": true,\n \"callbackurl\": \"http://app.cb.lk/judgement/result\"\n}", "type": "json" }, { "title": "Callback Body:", "content": "HTTP/1.1 POST\n{\n \"id\": 22,\n \"results\": [\n {\"statuscode\": 0, \"stdout\": \"JB81jv=\", \"stderr\": \"TnVsbFBvaW50Zng2KB2jbaRpb24=\"},\n {\"statuscode\": 0, \"stdout\": \"Mbj15A=\", \"stderr\": \"TnVsbFBvabjg12bfjGNlcHRpb24=\"},\n {\"statuscode\": 0, \"stdout\": \"UV131b=\", \"stderr\": \"TnVsbFBvaW50ZXJFeGNlcHRpb24=\"},\n ]\n}", "type": "json" } ] }, "filename": "src/routes/api/submissions.ts", "groupTitle": "Submissions", "sampleRequest": [ { "url": "http://judge.cb.lk/submissions" } ] }]
1+
[ { "type": "get", "url": "/langs", "title": "GET /langs", "description": "<p>Get all supported Languages</p>", "name": "GetLangs", "group": "Langs", "version": "0.0.1", "filename": "src/routes/api/langs.ts", "groupTitle": "Langs", "sampleRequest": [ { "url": "https://judge2.codingblocks.com/api/langs" } ] }]

docs/api_project.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api_project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "title": "judge-blocks API", "url": "http://judge.cb.lk", "sampleUrl": "http://judge.cb.lk", "name": "judge-api", "version": "0.0.1", "description": "Judge API", "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2017-11-14T20:27:03.266Z", "url": "http://apidocjs.com", "version": "0.17.6" }}
1+
{ "title": "judge-blocks API", "url": "https://judge2.codingblocks.com/api", "sampleUrl": "https://judge2.codingblocks.com/api", "name": "judge-api", "version": "1.2.0", "description": "Judge API", "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2020-04-11T08:58:22.454Z", "url": "http://apidocjs.com", "version": "0.17.7" }}

docs/locales/cs.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
define({
2+
cs: {
3+
'Allowed values:' : 'Povolené hodnoty:',
4+
'Compare all with predecessor': 'Porovnat vše s předchozími verzemi',
5+
'compare changes to:' : 'porovnat změny s:',
6+
'compared to' : 'porovnat s',
7+
'Default value:' : 'Výchozí hodnota:',
8+
'Description' : 'Popis',
9+
'Field' : 'Pole',
10+
'General' : 'Obecné',
11+
'Generated with' : 'Vygenerováno pomocí',
12+
'Name' : 'Název',
13+
'No response values.' : 'Nebyly vráceny žádné hodnoty.',
14+
'optional' : 'volitelné',
15+
'Parameter' : 'Parametr',
16+
'Permission:' : 'Oprávnění:',
17+
'Response' : 'Odpověď',
18+
'Send' : 'Odeslat',
19+
'Send a Sample Request' : 'Odeslat ukázkový požadavek',
20+
'show up to version:' : 'zobrazit po verzi:',
21+
'Size range:' : 'Rozsah velikosti:',
22+
'Type' : 'Typ',
23+
'url' : 'url'
24+
}
25+
});

docs/locales/locale.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
define([
22
'./locales/ca.js',
3+
'./locales/cs.js',
34
'./locales/de.js',
45
'./locales/es.js',
56
'./locales/fr.js',

0 commit comments

Comments
 (0)