def get_rubric(submission_id: int) -> JSONResponse[t.Mapping[str, t.Any]]:
"""Return full rubric of the :class:`.models.Assignment` of the given
submission (:class:`.models.Work`).
.. :quickref: Submission; Get a rubric and its selected items.
:param int submission_id: The id of the submission
:returns: A response containing the JSON serialized rubric as described in
:py:meth:`.Work.__rubric_to_json__`.
:raises APIException: If the submission with the given id does not exist.
(OBJECT_ID_NOT_FOUND)
:raises PermissionException: If there is no logged in user. (NOT_LOGGED_IN)
:raises PermissionException: If the user can not see the assignment of the
given submission. (INCORRECT_PERMISSION)
"""
work = helpers.get_or_404(models.Work, submission_id)
auth.ensure_permission('can_see_assignments', work.assignment.course_id)
return jsonify(work.__rubric_to_json__())
评论列表
文章目录