mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
vjudge: uoj subtask
This commit is contained in:
1 parent
306a15b870
commit
867c38c2c6
3 files changed
+33
-6
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/vjudge",
|
"name": "@hydrooj/vjudge",
|
||||||
"version": "1.4.5",
|
"version": "1.4.6",
|
||||||
"description": "Submit problems to remote oj",
|
"description": "Submit problems to remote oj",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ export default class SPOJProvider implements IBasicProvider {
|
|||||||
login_user: this.account.handle,
|
login_user: this.account.handle,
|
||||||
password: this.account.password,
|
password: this.account.password,
|
||||||
});
|
});
|
||||||
console.log(res.body, res.header);
|
|
||||||
const cookie = res.header['set-cookie'];
|
const cookie = res.header['set-cookie'];
|
||||||
if (cookie) {
|
if (cookie) {
|
||||||
await this.save({ cookie });
|
await this.save({ cookie });
|
||||||
|
|||||||
@@ -207,10 +207,12 @@ export default class UOJProvider implements IBasicProvider {
|
|||||||
if (!summary) continue;
|
if (!summary) continue;
|
||||||
const time = parseTimeMS(summary.children[4].innerHTML);
|
const time = parseTimeMS(summary.children[4].innerHTML);
|
||||||
const memory = parseMemoryMB(summary.children[5].innerHTML) * 1024;
|
const memory = parseMemoryMB(summary.children[5].innerHTML) * 1024;
|
||||||
const root = document.getElementById('details_details_accordion');
|
let panel = document.getElementById('details_details_accordion_collapse_subtask_1');
|
||||||
if (!root) continue;
|
if (!panel) {
|
||||||
for (let t = 0; t < i; t++) root.children[0].remove();
|
panel = document.getElementById('details_details_accordion');
|
||||||
for (const node of root.children) {
|
if (!panel) continue;
|
||||||
|
for (let t = 0; t < i; t++) panel.children[0].remove();
|
||||||
|
for (const node of panel.children) {
|
||||||
const info = node.children[0].children[0];
|
const info = node.children[0].children[0];
|
||||||
i++;
|
i++;
|
||||||
await next({
|
await next({
|
||||||
@@ -223,6 +225,32 @@ export default class UOJProvider implements IBasicProvider {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
let subtaskId = 1;
|
||||||
|
let removed = 0;
|
||||||
|
while (panel) {
|
||||||
|
panel.children[0]?.remove();
|
||||||
|
while (removed < i - 1 && panel.children.length) {
|
||||||
|
panel.children[0].remove();
|
||||||
|
removed++;
|
||||||
|
}
|
||||||
|
for (const node of panel.children) {
|
||||||
|
const info = node.children[0].children[0];
|
||||||
|
i++;
|
||||||
|
await next({
|
||||||
|
status: STATUS.STATUS_JUDGING,
|
||||||
|
case: {
|
||||||
|
status: VERDICT[info.children[2]?.innerHTML?.trim().toUpperCase()] || STATUS.STATUS_WRONG_ANSWER,
|
||||||
|
time: parseTimeMS(info.children[3]?.innerHTML?.split('time: ')?.[1] || 0),
|
||||||
|
memory: parseMemoryMB(info.children[4]?.innerHTML?.split('memory: ')?.[1] || 0) * 1024,
|
||||||
|
message: node.children[1]?.children[0]?.children[5].innerHTML,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
subtaskId++;
|
||||||
|
panel = document.getElementById(`details_details_accordion_collapse_subtask_${subtaskId}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (document.querySelector('tbody').innerHTML.includes('Judging')) continue;
|
if (document.querySelector('tbody').innerHTML.includes('Judging')) continue;
|
||||||
const score = +summary.children[3]?.children[0].innerHTML || 0;
|
const score = +summary.children[3]?.children[0].innerHTML || 0;
|
||||||
const status = score === 100 ? STATUS.STATUS_ACCEPTED : STATUS.STATUS_WRONG_ANSWER;
|
const status = score === 100 ? STATUS.STATUS_ACCEPTED : STATUS.STATUS_WRONG_ANSWER;
|
||||||
|
|||||||
Reference in new issue
Block a user