Submission#

class SubmissionHandler(application: grader_service.server.GraderServer, request: tornado.httputil.HTTPServerRequest, **kwargs: Any)[source]#

Tornado Handler class for http requests to /lectures/{lecture_id}/assignments/{assignment_id}/submissions.

async get(lecture_id: int, assignment_id: int)[source]#

Return the submissions of an assignment.

Two query parameter: latest, instructor-version.

latest: only get the latest submissions of users. instructor-version: if true, get the submissions of all users in lecture if false, get own submissions.

Parameters
  • lecture_id (int) – id of the lecture

  • assignment_id (int) – id of the assignment

Raises

HTTPError – throws err if user is not authorized or the assignment was not found

hub_api_base_path: str#
on_finish()[source]#

Called after the end of a request.

Override this method to perform cleanup, logging, etc. This method is a counterpart to prepare. on_finish may not produce any output, as it is called after the response has been sent to the client.

async post(lecture_id: int, assignment_id: int)[source]#

Create submission based on commit hash.

Parameters
  • lecture_id (int) – id of the lecture

  • assignment_id (int) – id of the assignment

Raises

HTTPError – throws err if user is not authorized or the assignment was not found

class SubmissionObjectHandler(application: grader_service.server.GraderServer, request: tornado.httputil.HTTPServerRequest, **kwargs: Any)[source]#

Tornado Handler class for http requests to /lectures/{lecture_id}/assignments/{assignment_id}/submissions/{submission_id}.

async get(lecture_id: int, assignment_id: int, submission_id: int)[source]#

Returns a specific submission.

Parameters
  • lecture_id (int) – id of the lecture

  • assignment_id (int) – id of the assignment

  • submission_id (int) – id of the submission

hub_api_base_path: str#
async put(lecture_id: int, assignment_id: int, submission_id: int)[source]#

Updates a specific submission and returns the updated entity.

Parameters
  • lecture_id (int) – id of the lecture

  • assignment_id (int) – id of the assignment

  • submission_id (int) – id of the submission

class SubmissionPropertiesHandler(application: grader_service.server.GraderServer, request: tornado.httputil.HTTPServerRequest, **kwargs: Any)[source]#

Tornado Handler class for http requests to /lectures/{lecture_id}/assignments/{assignment_id}/submissions/ {submission_id}/properties.

async get(lecture_id: int, assignment_id: int, submission_id: int)[source]#

Returns the properties of a submission,

Parameters
  • lecture_id (int) – id of the lecture

  • assignment_id (int) – id of the assignment

  • submission_id (int) – id of the submission

Raises

HTTPError – throws err if the submission or their properties are not found

hub_api_base_path: str#
async put(lecture_id: int, assignment_id: int, submission_id: int)[source]#

Updates the properties of a submission.

Parameters
  • lecture_id (int) – id of the lecture

  • assignment_id (int) – id of the assignment

  • submission_id (int) – id of the submission

Raises

HTTPError – throws err if the submission are not found

tuple_to_submission(t)[source]#

Transforms tuple with values into a submission entity.

Parameters

t (tuple) – tuple with values

Returns

submission entity