forked from ngsankha/judgev2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb-hoax.js
42 lines (37 loc) · 1.05 KB
/
db-hoax.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
(function() {
var parse = function(data) {
var code = "#include <stdio.h>\n" +
"int main() {\n" +
"printf(\"Hello World\\n\");\n" +
"return 0;\n" +
"}";
return { id: 0,
filename: "hello.c",
code: code,
language: "C",
input: "",
output: "Hello World",
matchLines: false,
partial: false,
time: 1
};
};
var reportCompileFail = function(id, msg) {
console.log(msg);
};
var reportRunFail = function(id, msg) {
console.log(msg);
};
var reportTLE = function(id) {
// TLE reporting code here
};
var reportResult = function(id, msg) {
// code that handles the result of the code
// do whatever you want to write to the db here
}
module.exports.parse = parse;
module.exports.reportCompileFail = reportCompileFail;
module.exports.reportRunFail = reportRunFail;
module.exports.reportResult = reportResult;
module.exports.reportTLE = reportTLE;
})();