|
|
|
|
@ -291,6 +291,7 @@ class SetProgress(APIView): |
|
|
|
|
course_slug = request.JSON.get('course_slug', None) |
|
|
|
|
topic_sort = int(request.JSON.get('topic', 1)) |
|
|
|
|
lesson_sort = int(request.JSON.get('lesson', 1)) |
|
|
|
|
only_watch = request.JSON.get('only_watch', False) |
|
|
|
|
force = request.JSON.get('force', False) |
|
|
|
|
|
|
|
|
|
if course_slug is None: |
|
|
|
|
@ -318,6 +319,9 @@ class SetProgress(APIView): |
|
|
|
|
teacher = get_user_model().objects.get(out_key=course.get_teacher()) |
|
|
|
|
progress = Progress.objects.create(course_token=course.token, user=student, teacher=teacher) |
|
|
|
|
|
|
|
|
|
progress.only_watch = only_watch |
|
|
|
|
progress.save() |
|
|
|
|
|
|
|
|
|
token_list = [] |
|
|
|
|
lesson_list = [] |
|
|
|
|
for topic_idx, topic in enumerate(course.topic_set.all()): |
|
|
|
|
|