-
Notifications
You must be signed in to change notification settings - Fork 11
/
count_not_solved_tasks.py
34 lines (27 loc) · 1.15 KB
/
count_not_solved_tasks.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from methods import *
s = get_and_auth()
course_id, group_id = get_course(s)
lessons = get_all_lessons(s, course_id, group_id)
print("Ваши нерешённые задачи или незачтённые задачи:\n")
statuses = set()
for lesson in lessons:
with_deadline = True
if lesson['msBeforeDeadline'] is None:
with_deadline = False
elif lesson['msBeforeDeadline'] < 0:
break
if lesson['type'] != 'normal' or lesson['numPassed'] == lesson['numTasks']:
continue
lesson_id = lesson['id']
tasks = get_all_tasks(s, lesson_id, course_id)
for task_group in tasks:
for task in task_group['tasks']:
solution = task['solution']
if solution is not None:
statuses.add(tuple(solution['status'].values()))
if solution is None or \
(not solution['score'] and solution['status']['type'] != 'review'):
if with_deadline:
print(f"{lesson['title']}: {task['title']}")
else:
print(f"{lesson['title']}: {task['title']} (Без ограничений по времени)")