You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
780 B
24 lines
780 B
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,
|
|
)
|
|
|