}); $app->post('/contest/:id/question', function ($id) { fAuthorization::requireLoggedIn(); User::requireEmailVerified(); $controller = new ReportController(); $controller->newQuestion($id); }); $app->post('/question/:id/reply', function ($id) { fAuthorization::requireLoggedIn(); $controller = new ReportController(); $controller->replyQuestion($id); }); $app->post('/question/:id/toggle', function ($id) { fAuthorization::requireLoggedIn(); $controller = new ReportController(); $controller->toggleQuestionVisibility($id); }); $app->get('/polling/:secret', function ($secret) { if (JUDGER_SECRET != $secret) { exit; } $controller = new PollingController(); $opcode = fRequest::get('opcode', 'string'); if ($opcode == 'fetchRecord') { $controller->fetchRecord(); } else { if ($opcode == 'fetchTimestamp') { $controller->fetchTimestamp(); } else { echo -1; }