def get_grade_history(submission_id: int
) -> JSONResponse[t.Sequence[models.GradeHistory]]:
"""Get the grade history for the given submission.
.. :quickref: Submission; Get the grade history for the given submission.
:returns: A list of :class:`.models.GradeHistory` object serialized to
json for the given assignment.
:raises PermissionException: If the current user has no permission to see
the grade history. (INCORRECT_PERMISSION)
"""
work = helpers.get_or_404(models.Work, submission_id)
auth.ensure_permission('can_see_grade_history', work.assignment.course_id)
hist: t.MutableSequence[models.GradeHistory]
hist = db.session.query(
models.GradeHistory
).filter_by(work_id=work.id).order_by(
models.GradeHistory.changed_at.desc(), # type: ignore
).all()
return jsonify(hist)
评论列表
文章目录