mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-27 12:46:21 +00:00
Compare commits
No commits in common. "d897a27801a91e2fdbee6008e084f50efb59dbd4" and "10ee5ca049bdab55a85fce0bb3ea3bfacb118782" have entirely different histories.
d897a27801
...
10ee5ca049
@ -205,8 +205,6 @@ export default class AtcoderProvider implements IBasicProvider {
|
|||||||
`(S2OJ Submission #${submissionId})`
|
`(S2OJ Submission #${submissionId})`
|
||||||
);
|
);
|
||||||
|
|
||||||
await next({ status: 'Submitting to AtCoder...' });
|
|
||||||
|
|
||||||
// TODO: check submit time to ensure submission
|
// TODO: check submit time to ensure submission
|
||||||
const res = await this.post(`/contests/${contestId}/submit`).send({
|
const res = await this.post(`/contests/${contestId}/submit`).send({
|
||||||
csrf_token: csrf,
|
csrf_token: csrf,
|
||||||
@ -229,8 +227,6 @@ export default class AtcoderProvider implements IBasicProvider {
|
|||||||
this.cookie = res.header['set-cookie'];
|
this.cookie = res.header['set-cookie'];
|
||||||
}
|
}
|
||||||
|
|
||||||
await next({ status: 'Submitted to AtCoder' });
|
|
||||||
|
|
||||||
const { text: status, header: status_header } = await this.get(
|
const { text: status, header: status_header } = await this.get(
|
||||||
`/contests/${contestId}/submissions/me`
|
`/contests/${contestId}/submissions/me`
|
||||||
).retry(3);
|
).retry(3);
|
||||||
@ -284,7 +280,7 @@ export default class AtcoderProvider implements IBasicProvider {
|
|||||||
statusElem.title === 'Waiting for Re-judging' ||
|
statusElem.title === 'Waiting for Re-judging' ||
|
||||||
['WJ', 'WR'].includes(statusElem.innerHTML.trim())
|
['WJ', 'WR'].includes(statusElem.innerHTML.trim())
|
||||||
) {
|
) {
|
||||||
await next({ status: '[AtCoder] Waiting for Judging' });
|
await next({ test_id: 0 });
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -277,8 +277,6 @@ export default class CodeforcesProvider implements IBasicProvider {
|
|||||||
`(S2OJ Submission #${submissionId})`
|
`(S2OJ Submission #${submissionId})`
|
||||||
);
|
);
|
||||||
|
|
||||||
await next({ status: 'Submitting to Codeforces...' });
|
|
||||||
|
|
||||||
// TODO: check submit time to ensure submission
|
// TODO: check submit time to ensure submission
|
||||||
const { text: submit, error } = await this.post(
|
const { text: submit, error } = await this.post(
|
||||||
`/${
|
`/${
|
||||||
@ -330,8 +328,6 @@ export default class CodeforcesProvider implements IBasicProvider {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
await next({ status: 'Submitted to Codeforces' });
|
|
||||||
|
|
||||||
const { text: status } = await this.get(
|
const { text: status } = await this.get(
|
||||||
type !== 'GYM' ? '/problemset/status?my=on' : `/gym/${contestId}/my`
|
type !== 'GYM' ? '/problemset/status?my=on' : `/gym/${contestId}/my`
|
||||||
).retry(3);
|
).retry(3);
|
||||||
@ -354,9 +350,9 @@ export default class CodeforcesProvider implements IBasicProvider {
|
|||||||
let count = 0;
|
let count = 0;
|
||||||
let fail = 0;
|
let fail = 0;
|
||||||
|
|
||||||
while (count < 360 && fail < 60) {
|
while (count < 180 && fail < 10) {
|
||||||
count++;
|
count++;
|
||||||
await sleep(500);
|
await sleep(1000);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { body } = await this.post('/data/submitSource')
|
const { body } = await this.post('/data/submitSource')
|
||||||
@ -390,16 +386,6 @@ export default class CodeforcesProvider implements IBasicProvider {
|
|||||||
|
|
||||||
if (body.waiting === 'true') continue;
|
if (body.waiting === 'true') continue;
|
||||||
|
|
||||||
let files = [];
|
|
||||||
|
|
||||||
if (body?.source) {
|
|
||||||
files.push({
|
|
||||||
name: 'answer.code',
|
|
||||||
content: body.source,
|
|
||||||
lang: '/',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const testCount = +body.testCount;
|
const testCount = +body.testCount;
|
||||||
const status =
|
const status =
|
||||||
VERDICT[
|
VERDICT[
|
||||||
@ -460,7 +446,6 @@ export default class CodeforcesProvider implements IBasicProvider {
|
|||||||
time,
|
time,
|
||||||
memory,
|
memory,
|
||||||
details,
|
details,
|
||||||
result: { files },
|
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.error(e);
|
logger.error(e);
|
||||||
|
@ -249,8 +249,6 @@ export default class LibreojProvider implements IBasicProvider {
|
|||||||
`(S2OJ Submission #${submissionId})`
|
`(S2OJ Submission #${submissionId})`
|
||||||
);
|
);
|
||||||
|
|
||||||
await next({ status: 'Submitting to LibreOJ...' });
|
|
||||||
|
|
||||||
const { body, error } = await this.post('/submission/submit').send({
|
const { body, error } = await this.post('/submission/submit').send({
|
||||||
problemId: id,
|
problemId: id,
|
||||||
content: {
|
content: {
|
||||||
@ -270,8 +268,6 @@ export default class LibreojProvider implements IBasicProvider {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
await next({ status: 'Submitted to LibreOJ' });
|
|
||||||
|
|
||||||
return body.submissionId;
|
return body.submissionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -349,7 +345,7 @@ export default class LibreojProvider implements IBasicProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await next({
|
await next({
|
||||||
status: `[LibreOJ] ${body.progress.progressType}`,
|
status: `${body.progress.progressType}`,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (body.progress.progressType !== 'Finished') {
|
if (body.progress.progressType !== 'Finished') {
|
||||||
|
@ -319,8 +319,6 @@ export default class LuoguProvider implements IBasicProvider {
|
|||||||
code = `${comment[0]} ${msg} ${comment[1]}\n${code}`;
|
code = `${comment[0]} ${msg} ${comment[1]}\n${code}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
await next({ status: 'Submitting to Luogu...' });
|
|
||||||
|
|
||||||
if (this.account.type == 'luogu-api') {
|
if (this.account.type == 'luogu-api') {
|
||||||
const result = await this.post('/judge/problem').send({
|
const result = await this.post('/judge/problem').send({
|
||||||
pid: id,
|
pid: id,
|
||||||
|
@ -200,8 +200,6 @@ export default class QOJProvider extends UOJProvider implements IBasicProvider {
|
|||||||
code = `${comment[0]} ${msg} ${comment[1]}\n${code}`;
|
code = `${comment[0]} ${msg} ${comment[1]}\n${code}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
await next({ status: 'Submitting to QOJ...' });
|
|
||||||
|
|
||||||
const _token = await this.getCsrfToken(`/problem/${id}`);
|
const _token = await this.getCsrfToken(`/problem/${id}`);
|
||||||
const { text } = await this.post(`/problem/${id}`).send({
|
const { text } = await this.post(`/problem/${id}`).send({
|
||||||
_token,
|
_token,
|
||||||
|
@ -217,8 +217,6 @@ export default class UOJProvider implements IBasicProvider {
|
|||||||
code = `${comment[0]} ${msg} ${comment[1]}\n${code}`;
|
code = `${comment[0]} ${msg} ${comment[1]}\n${code}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
await next({ status: 'Submitting to UniversalOJ...' });
|
|
||||||
|
|
||||||
const _token = await this.getCsrfToken(`/problem/${id}`);
|
const _token = await this.getCsrfToken(`/problem/${id}`);
|
||||||
const { text } = await this.post(`/problem/${id}`).send({
|
const { text } = await this.post(`/problem/${id}`).send({
|
||||||
_token,
|
_token,
|
||||||
@ -230,8 +228,6 @@ export default class UOJProvider implements IBasicProvider {
|
|||||||
|
|
||||||
if (!text.includes('我的提交记录')) throw new Error('Submit failed');
|
if (!text.includes('我的提交记录')) throw new Error('Submit failed');
|
||||||
|
|
||||||
await next({ status: 'Submitted to UniversalOJ' });
|
|
||||||
|
|
||||||
const { text: status } = await this.get(
|
const { text: status } = await this.get(
|
||||||
`/submissions?problem_id=${id}&submitter=${this.account.handle}`
|
`/submissions?problem_id=${id}&submitter=${this.account.handle}`
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user