Skip to content
Snippets Groups Projects
Commit 6fa4a663 authored by Thomas Roos's avatar Thomas Roos
Browse files

Rename solutions and remarks of submission in api

parent cc229a5a
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