Skip to content
Snippets Groups Projects
Commit b79359e5 authored by Thomas Roos's avatar Thomas Roos Committed by Anton Akhmerov
Browse files

Rename solutions and remarks of submission in api

parent 7b28c58d
No related branches found
No related tags found
No related merge requests found
......@@ -54,16 +54,16 @@ class ExamConfig(Resource):
'email': sub.student.email
} if sub.student else None,
'validated': sub.signature_validated,
'solutions':
'problems':
[
{
'problem': sol.problem.id,
'id': sol.problem.id,
'graded_by': sol.graded_by,
'graded_at': sol.graded_at.isoformat() if sol.graded_at else None,
'feedback': [
fb.id for fb in sol.feedback
],
'remarks': sol.remarks
'remark': sol.remarks
} for sol in sub.solutions.order_by(lambda s: s.problem.id)
]
} for sub in exam.submissions.order_by(lambda s: s.copy_number)
......
......@@ -44,16 +44,16 @@ class Submissions(Resource):
'email': sub.student.email
} if sub.student else None,
'validated': sub.signature_validated,
'solutions':
'problems':
[
{
'problem': sol.problem.id,
'id': sol.problem.id,
'graded_by': sol.graded_by,
'graded_at': sol.graded_at.isoformat() if sol.graded_at else None,
'feedback': [
fb.id for fb in sol.feedback
],
'remarks': sol.remarks
'remark': sol.remarks
} for sol in sub.solutions.order_by(lambda s: s.problem.id)
]
}
......@@ -69,16 +69,16 @@ class Submissions(Resource):
'email': sub.student.email
} if sub.student else None,
'validated': sub.signature_validated,
'solutions':
'problems':
[
{
'problem': sol.problem.id,
'id': sol.problem.id,
'graded_by': sol.graded_by,
'graded_at': sol.graded_at.isoformat() if sol.graded_at else None,
'feedback': [
fb.id for fb in sol.feedback
],
'remarks': sol.remarks
'remark': sol.remarks
} for sol in sub.solutions.order_by(lambda s: s.problem.id)
]
} for sub in Submission.select(lambda s: s.exam == exam).order_by(lambda s: s.copy_number)
......@@ -134,16 +134,16 @@ class Submissions(Resource):
'email': sub.student.email
} if sub.student else None,
'validated': sub.signature_validated,
'solutions':
'problems':
[
{
'problem': sol.problem.id,
'id': sol.problem.id,
'graded_by': sol.graded_by,
'graded_at': sol.graded_at.isoformat() if sol.graded_at else None,
'feedback': [
fb.id for fb in sol.feedback
],
'remarks': sol.remarks
'remark': sol.remarks
} for sol in sub.solutions.order_by(lambda s: s.problem.id)
]
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment