| 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, |