forked from ngsankha/judgev2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
db-default.js
41 lines (36 loc) · 1.33 KB
/
db-default.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
(function() {
var parse = function(data) {
// here is our custom db handling code.
// return an object of the form:
// { id: /* the unique id of the problem */,
// filename: /* the filename */,
// code: /* the code submitted */,
// language: /* the programming language */
// input: /* the input test data */,
// output: /* the output to be matched against */,
// matchLines: /* bool: to check if single lines are to be tested */,
// partial: /* if partial marks are for the problem */,
// time: /* maximum time (in seconds) allotted to the program */
// }
};
var reportCompileFail = function(id, msg) {
// code that handles the compile failure
// do whatever you want to write to the db here
};
var reportRunFail = function(id, msg) {
// code that handles the run failure
// do whatever you want to write to the db here
};
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;
})();