Skip to content

Commit

Permalink
Merge pull request #35 from Killerrekt/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Emerald-Wolf authored Sep 14, 2023
2 parents c28404e + 2b2aa33 commit 0343059
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions api/controllers/submission.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@ class submission {
console.log(url);
let completion = false;
let data_sent_back = {
error: [false,false,false], //false means it passed that grp
error: [false,false,false,false], //false means it passed that grp
//[complilation error/runtime,time limit exceeded, O/P failed]
Sub_db: "",
Score: "",
};
while (!completion && !data_sent_back.error[0]) {
while (!completion) {
let score = 0;
completion = true;
let failed = [];
Expand All @@ -209,13 +209,13 @@ class submission {
case 4:
if (element.expected_output + "\n" == element.stdout) continue;
else {
data_sent_back.error[2] = true;
data_sent_back.error[3] = true;
failed.push(i);
}
break;
case 5:
failed.push(i);
data_sent_back.error[1] = true;
data_sent_back.error[2] = true;
break;
case 6:
failed.push(i);
Expand All @@ -238,6 +238,16 @@ class submission {
if (completion) {
//console.log(failed);
//console.log(grp);
if(failed.length != tests.length && data_sent_back.error[0]){
data_sent_back.error[0] = false;
data_sent_back.error[1] = true;
}
if(data_sent_back.error[0]){
data_sent_back.Sub_db = "Sub DB not messed with";
data_sent_back.Score = null;
res.status(201).json(data_sent_back);
return;
}
Object.keys(grp).forEach((element) => {
let check = true;
const hell = grp[element];
Expand Down

0 comments on commit 0343059

Please sign in to comment.