S2OJ/web/app/controllers/submission_status_details.php

20 lines
570 B
PHP
Raw 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();
$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));