Course content #72

Merged
juggy1233 merged 6 commits from #70-course-content into master 2023-04-14 17:02:53 -04:00
Showing only changes of commit 608854ebb0 - Show all commits

View File

@@ -149,6 +149,18 @@ def get_students_in_course(id):
resp["students"].append(s.to_dict())
return jsonify(resp)
@bp.route("/course/<int:id>/content", methods=["GET"])
@login_required
def get_content_in_course(id):
c = Course.query.get(id)
if not c:
return error_response(400, f"course with id {id} not found")
content = c.content.all()
resp = {"content": []}
for c in content:
resp["content"].append(c.to_dict())
return jsonify(resp)
@bp.route("/course/<int:id>/assignments", methods=["GET"])
@login_required