Skip to content

codingame_tools.client.service.services.test_session_question_submission

test_session_question_submission

Async TestSessionQuestionSubmission service endpoint.

CgTestSessionQuestionSubmissionServiceHelper

CgTestSessionQuestionSubmissionServiceHelper(service)

Bases: CgServiceHelper['CgTestSessionQuestionSubmissionService']

Helper methods for CgTestSessionQuestionSubmissionService. Currently empty.

Source code in codingame_tools/client/service/cg_service.py
124
125
def __init__(self, service: TService) -> None:
    self.service = service

CgTestSessionQuestionSubmissionService

CgTestSessionQuestionSubmissionService(client)

Bases: CgService

Async TestSessionQuestionSubmission service endpoint.

Source code in codingame_tools/client/service/services/test_session_question_submission.py
25
26
27
def __init__(self, client: CgClient) -> None:
    super().__init__(client, "TestSessionQuestionSubmission")
    self.helper = CgTestSessionQuestionSubmissionServiceHelper(self)

find_all_submissions async

find_all_submissions(test_session_handle)

Find all past submissions for a puzzle, most recent first.

Parameters:

  • test_session_handle (str) –

    The puzzle's test session handle (see CgTestSessionService.start_test_session).

Returns:

Raises:

  • CgAuthenticationError

    If the session is not authenticated and cannot implicitly login.

  • CgClientHttpError

    If a transport error occurs, if the response content could not be decoded at all, if the status code is not 2xx, or if the decoded content is not a list.

Source code in codingame_tools/client/service/services/test_session_question_submission.py
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
async def find_all_submissions(
            self,
            test_session_handle: str,
        ) -> list[CgTestSessionQuestionSubmission]:
    """Find all past submissions for a puzzle, most recent first.

    Args:
        test_session_handle: The puzzle's test session handle (see
                              `CgTestSessionService.start_test_session`).

    Returns:
        A list of CgTestSessionQuestionSubmission objects.

    Raises:
        CgAuthenticationError:
            If the session is not authenticated and cannot implicitly login.
        CgClientHttpError:
            If a transport error occurs, if the response content could not be decoded at all,
            if the status code is not 2xx, or if the decoded content is not a list.
    """
    raw_submissions = await self.service_request_to_list("findAllSubmissions", [test_session_handle])
    return CgTestSessionQuestionSubmission.from_list(cast(list[JsonDict], raw_submissions))