S2OJ/web/app/controllers/submission_status_details.php
Baoshuo 3c3ec65551
All checks were successful
continuous-integration/drone/push Build is passing
fix: 8b45b03225
2023-02-20 11:54:54 +08:00

20 lines
573 B
PHP

<?php
Auth::check() || UOJResponse::page403();
is_array($_GET['get']) || UOJResponse::page404();
$res = [];
foreach ($_GET['get'] as $id) {
($submission = UOJSubmission::query($id)) || UOJResponse::page404();
$submission->setProblem() || UOJResponse::page404();
// $submission->userIsSubmitter(Auth::user()) || UOJResponse::page403();
$submission->userCanView(Auth::user(), ['ensure' => true]);
$res[] = [
'judged' => $submission->hasJudged(),
'waiting' => $submission->isWaiting(),
'html' => $submission->getStatusDetailsHTML()
];
}
die(json_encode($res));