def format_assignment_gist(recording, debug=False):
"""Given a single recording, format it into a markdown file.
Each recording will only have one student.
Returns a {content: str, student: str, type: str} dict.
"""
try:
files = format_files_list(recording.get('files', {}))
warnings = format_warnings(recording.get('warnings', {}).items())
header = format_header(recording, warnings)
output = (header + files) + '\n\n'
except Exception as err:
if debug:
raise err
output = indent(traceback.format_exc(), ' ' * 4) + '\n\n'
return {
'content': output,
'student': recording['student'],
'type': 'md',
}
评论列表
文章目录