mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
vjudge: codeforces: fix
This commit is contained in:
1 parent
1124ed9506
commit
018257f2b8
1 file changed
+8
-16
@@ -279,31 +279,23 @@ export default class CodeforcesProvider extends BasicFetcher implements IBasicPr
|
||||
else if (comment instanceof Array) code = `${comment[0]} ${msg} ${comment[1]}\n${code}`;
|
||||
}
|
||||
const [type, contestId, problemId] = parseProblemId(id);
|
||||
const [csrf, ftaa, bfaa] = await this.getCsrfToken(type !== 'GYM'
|
||||
? '/problemset/submit'
|
||||
: `/gym/${contestId}/submit`);
|
||||
// TODO check submit time to ensure submission
|
||||
const endpoint = type === 'GYM'
|
||||
? `/gym/${contestId}/submit?csrf_token=${csrf}`
|
||||
: `/problemset/submit/${contestId}/${problemId}?csrf_token=${csrf}`;
|
||||
const { text: submit } = await this.post(endpoint).send({
|
||||
? `/gym/${contestId}/submit`
|
||||
: `/problemset/submit/${contestId}/${problemId}`;
|
||||
const [csrf, ftaa, bfaa] = await this.getCsrfToken(endpoint);
|
||||
// TODO check submit time to ensure submission
|
||||
const { text: submit } = await this.post(`${endpoint}?csrf_token=${csrf}`).send({
|
||||
csrf_token: csrf,
|
||||
action: 'submitSolutionFormSubmitted',
|
||||
programTypeId,
|
||||
source: code,
|
||||
tabsize: 4,
|
||||
tabSize: 4,
|
||||
sourceFile: '',
|
||||
ftaa,
|
||||
bfaa,
|
||||
_tta: this.tta(this.getCookie('39ce7')),
|
||||
...(type !== 'GYM')
|
||||
? {
|
||||
submittedProblemCode: contestId + problemId,
|
||||
sourceCodeConfirmed: true,
|
||||
} : {
|
||||
contestId,
|
||||
submittedProblemIndex: problemId,
|
||||
},
|
||||
contestId,
|
||||
submittedProblemIndex: problemId,
|
||||
});
|
||||
const { window: { document: statusDocument } } = new JSDOM(submit);
|
||||
const message = Array.from(statusDocument.querySelectorAll('.error'))
|
||||
|
||||
Reference in new issue
Block a user