MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / updateStatus

Method updateStatus

packages/hydrooj/src/model/problem.ts:435–446  ·  view source on GitHub ↗
(
        domainId: string, pid: number, uid: number,
        rid: ObjectId, status: number, score: number,
    )

Source from the content-addressed store, hash-verified

433 }
434
435 static async updateStatus(
436 domainId: string, pid: number, uid: number,
437 rid: ObjectId, status: number, score: number,
438 ) {
439 const condition = status === STATUS.STATUS_ACCEPTED ? {}
440 : { $or: [{ status: { $ne: STATUS.STATUS_ACCEPTED } }, { rid }] };
441 const res = await document.setStatusIfCondition(
442 domainId, document.TYPE_PROBLEM, pid, uid,
443 condition, { rid, status, score },
444 );
445 return !!res;
446 }
447
448 static async incStatus(
449 domainId: string, pid: number, uid: number,

Callers 3

submitMethod · 0.80
postMethod · 0.80
postJudgeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected