parent
048c99b8c7
commit
b11f269c27
6 changed files with 10366 additions and 10327 deletions
File diff suppressed because one or more lines are too long
@ -0,0 +1,24 @@ |
|||||||
|
import django |
||||||
|
import os |
||||||
|
import sys |
||||||
|
|
||||||
|
sys.path.append("../") |
||||||
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lms.settings") |
||||||
|
django.setup() |
||||||
|
|
||||||
|
from progress.models import ProgressLesson, Progress |
||||||
|
from courses.models import Course |
||||||
|
|
||||||
|
if __name__ == '__main__': |
||||||
|
i = 0 |
||||||
|
for course in Course.objects.all(): |
||||||
|
print(i) |
||||||
|
i += 1 |
||||||
|
first_lesson = course.get_first() |
||||||
|
for progress in Progress.objects.filter(course_token=course.token): |
||||||
|
if not progress.progresslesson_set.count() and not first_lesson is None: |
||||||
|
ProgressLesson.objects.get( |
||||||
|
progress=progress, |
||||||
|
lesson_token=first_lesson.token, |
||||||
|
checker=progress.teacher if first_lesson.is_hm else progress.user, |
||||||
|
) |
||||||
Loading…
Reference in new issue