S2OJ/web/app/controllers/subdomain/api/submission/submission_status_details.php

20 lines
573 B
PHP
Raw Permalink Normal View History

2016-07-18 16:39:37 +00:00
<?php
2022-11-06 02:26:21 +00:00
Auth::check() || UOJResponse::page403();
is_array($_GET['get']) || UOJResponse::page404();
2016-07-18 16:39:37 +00:00
$res = [];
foreach ($_GET['get'] as $id) {
2022-11-06 02:26:21 +00:00
($submission = UOJSubmission::query($id)) || UOJResponse::page404();
$submission->setProblem() || UOJResponse::page404();
// $submission->userIsSubmitter(Auth::user()) || UOJResponse::page403();
2022-11-06 02:26:21 +00:00
$submission->userCanView(Auth::user(), ['ensure' => true]);
2016-07-18 16:39:37 +00:00
$res[] = [
2022-11-06 02:26:21 +00:00
'judged' => $submission->hasJudged(),
'waiting' => $submission->isWaiting(),
'html' => $submission->getStatusDetailsHTML()
2016-07-18 16:39:37 +00:00
];
}
die(json_encode($res));