Example #1
0
 /**
  * Returns the Scoreboard events
  *
  * @param Request $r
  * @return array
  * @throws InvalidDatabaseOperationException
  * @throws NotFoundException
  */
 public static function apiScoreboardEvents(Request $r)
 {
     // Get the current user
     self::validateDetails($r);
     // Create scoreboard
     $scoreboard = new Scoreboard($r["contest"]->getContestId(), Authorization::IsContestAdmin($r["current_user_id"], $r["contest"]));
     // Push scoreboard data in response
     $response = array();
     $response["events"] = $scoreboard->events();
     return $response;
 }