diff --git a/omegaup/api.py b/omegaup/api.py index 71d3a55..6be5b76 100644 --- a/omegaup/api.py +++ b/omegaup/api.py @@ -15398,29 +15398,29 @@ def createVirtual( def create( self, *, - admission_mode: Optional[Any] = None, - alias: Optional[Any] = None, + finish_time: int, + start_time: int, + submissions_gap: int, + window_length: int, + admission_mode: Optional[str] = None, + alias: Optional[str] = None, check_plagiarism: Optional[bool] = None, contest_for_teams: Optional[bool] = None, - description: Optional[Any] = None, - feedback: Optional[Any] = None, - finish_time: Optional[Any] = None, - languages: Optional[Any] = None, + description: Optional[str] = None, + feedback: Optional[str] = None, + languages: Optional[str] = None, needs_basic_information: Optional[bool] = None, - penalty: Optional[Any] = None, - penalty_calc_policy: Optional[Any] = None, - penalty_type: Optional[Any] = None, - points_decay_factor: Optional[Any] = None, + penalty: Optional[int] = None, + penalty_calc_policy: Optional[str] = None, + penalty_type: Optional[str] = None, + points_decay_factor: Optional[float] = None, problems: Optional[str] = None, - requests_user_information: Optional[Any] = None, + requests_user_information: Optional[bool] = None, score_mode: Optional[str] = None, - scoreboard: Optional[Any] = None, - show_scoreboard_after: Optional[Any] = None, - start_time: Optional[Any] = None, - submissions_gap: Optional[Any] = None, + scoreboard: Optional[float] = None, + show_scoreboard_after: Optional[bool] = None, teams_group_alias: Optional[str] = None, - title: Optional[Any] = None, - window_length: Optional[int] = None, + title: Optional[str] = None, # Out-of-band parameters: files_: Optional[Mapping[str, BinaryIO]] = None, check_: bool = True, @@ -15428,13 +15428,16 @@ def create( r"""Creates a new contest Args: + finish_time: + start_time: + submissions_gap: + window_length: admission_mode: alias: check_plagiarism: contest_for_teams: description: feedback: - finish_time: languages: needs_basic_information: penalty: @@ -15446,41 +15449,41 @@ def create( score_mode: scoreboard: show_scoreboard_after: - start_time: - submissions_gap: teams_group_alias: title: - window_length: Returns: The API result object. """ - parameters: Dict[str, str] = {} + parameters: Dict[str, str] = { + 'finish_time': str(finish_time), + 'start_time': str(start_time), + 'submissions_gap': str(submissions_gap), + 'window_length': str(window_length), + } if admission_mode is not None: - parameters['admission_mode'] = str(admission_mode) + parameters['admission_mode'] = admission_mode if alias is not None: - parameters['alias'] = str(alias) + parameters['alias'] = alias if check_plagiarism is not None: parameters['check_plagiarism'] = str(check_plagiarism) if contest_for_teams is not None: parameters['contest_for_teams'] = str(contest_for_teams) if description is not None: - parameters['description'] = str(description) + parameters['description'] = description if feedback is not None: - parameters['feedback'] = str(feedback) - if finish_time is not None: - parameters['finish_time'] = str(finish_time) + parameters['feedback'] = feedback if languages is not None: - parameters['languages'] = str(languages) + parameters['languages'] = languages if needs_basic_information is not None: parameters['needs_basic_information'] = str( needs_basic_information) if penalty is not None: parameters['penalty'] = str(penalty) if penalty_calc_policy is not None: - parameters['penalty_calc_policy'] = str(penalty_calc_policy) + parameters['penalty_calc_policy'] = penalty_calc_policy if penalty_type is not None: - parameters['penalty_type'] = str(penalty_type) + parameters['penalty_type'] = penalty_type if points_decay_factor is not None: parameters['points_decay_factor'] = str(points_decay_factor) if problems is not None: @@ -15494,16 +15497,10 @@ def create( parameters['scoreboard'] = str(scoreboard) if show_scoreboard_after is not None: parameters['show_scoreboard_after'] = str(show_scoreboard_after) - if start_time is not None: - parameters['start_time'] = str(start_time) - if submissions_gap is not None: - parameters['submissions_gap'] = str(submissions_gap) if teams_group_alias is not None: parameters['teams_group_alias'] = teams_group_alias if title is not None: - parameters['title'] = str(title) - if window_length is not None: - parameters['window_length'] = str(window_length) + parameters['title'] = title self._client.query('/api/contest/create/', payload=parameters, files_=files_, @@ -16211,6 +16208,7 @@ def update( *, contest_alias: str, finish_time: int, + start_time: int, submissions_gap: int, window_length: int, admission_mode: Optional[str] = None, @@ -16219,19 +16217,18 @@ def update( contest_for_teams: Optional[bool] = None, default_show_all_contestants_in_scoreboard: Optional[bool] = None, description: Optional[str] = None, - feedback: Optional[Any] = None, - languages: Optional[Any] = None, + feedback: Optional[str] = None, + languages: Optional[str] = None, needs_basic_information: Optional[bool] = None, penalty: Optional[int] = None, - penalty_calc_policy: Optional[Any] = None, - penalty_type: Optional[Any] = None, + penalty_calc_policy: Optional[str] = None, + penalty_type: Optional[str] = None, points_decay_factor: Optional[float] = None, problems: Optional[str] = None, requests_user_information: Optional[str] = None, score_mode: Optional[str] = None, scoreboard: Optional[float] = None, show_scoreboard_after: Optional[bool] = None, - start_time: Optional[datetime.datetime] = None, teams_group_alias: Optional[str] = None, title: Optional[str] = None, # Out-of-band parameters: @@ -16244,6 +16241,7 @@ def update( Args: contest_alias: finish_time: + start_time: submissions_gap: window_length: admission_mode: @@ -16264,7 +16262,6 @@ def update( score_mode: scoreboard: show_scoreboard_after: - start_time: teams_group_alias: title: @@ -16274,6 +16271,7 @@ def update( parameters: Dict[str, str] = { 'contest_alias': contest_alias, 'finish_time': str(finish_time), + 'start_time': str(start_time), 'submissions_gap': str(submissions_gap), 'window_length': str(window_length), } @@ -16291,18 +16289,18 @@ def update( if description is not None: parameters['description'] = description if feedback is not None: - parameters['feedback'] = str(feedback) + parameters['feedback'] = feedback if languages is not None: - parameters['languages'] = str(languages) + parameters['languages'] = languages if needs_basic_information is not None: parameters['needs_basic_information'] = str( needs_basic_information) if penalty is not None: parameters['penalty'] = str(penalty) if penalty_calc_policy is not None: - parameters['penalty_calc_policy'] = str(penalty_calc_policy) + parameters['penalty_calc_policy'] = penalty_calc_policy if penalty_type is not None: - parameters['penalty_type'] = str(penalty_type) + parameters['penalty_type'] = penalty_type if points_decay_factor is not None: parameters['points_decay_factor'] = str(points_decay_factor) if problems is not None: @@ -16315,8 +16313,6 @@ def update( parameters['scoreboard'] = str(scoreboard) if show_scoreboard_after is not None: parameters['show_scoreboard_after'] = str(show_scoreboard_after) - if start_time is not None: - parameters['start_time'] = str(int(start_time.timestamp())) if teams_group_alias is not None: parameters['teams_group_alias'] = teams_group_alias if title is not None: