def __to_json__(self) -> t.Mapping[str, t.Any]:
"""Converts a rubric of a work to a object that is JSON serializable.
The resulting object will look like this:
.. code:: python
{
'changed_at': str, # The date the history was added.
'is_rubric': bool, # Was this history items added by a rubric
# grade.
'grade': float, # The new grade, -1 if the grade was deleted.
'passed_back': bool, # Is this grade given back to LTI.
'user': User, # The user that added this grade.
}
:returns: A object as described above.
"""
return {
'changed_at': self.changed_at.isoformat(),
'is_rubric': self.is_rubric,
'grade': self.grade,
'passed_back': self.passed_back,
'user': self.user,
}
评论列表
文章目录