vladyslav
commited on
Commit
·
2ad9597
1
Parent(s):
220d9f2
Script to get list of passed students
Browse files- passed_students.py +48 -0
passed_students.py
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from dotenv import load_dotenv
|
2 |
+
|
3 |
+
from constants import STUDENTS
|
4 |
+
from utils.db import get_test_by_student_class_book
|
5 |
+
|
6 |
+
load_dotenv()
|
7 |
+
|
8 |
+
passed_students = {}
|
9 |
+
|
10 |
+
for class_name, students in STUDENTS.items():
|
11 |
+
for student in students:
|
12 |
+
tests = get_test_by_student_class_book(student, class_name, "Іван Франко - Захар Беркут")
|
13 |
+
unique_models = set()
|
14 |
+
for test in tests:
|
15 |
+
unique_models.add(test["model"])
|
16 |
+
print("Amount of unique models:", len(unique_models))
|
17 |
+
if len(unique_models) >= 5:
|
18 |
+
if class_name not in passed_students:
|
19 |
+
passed_students[class_name] = []
|
20 |
+
passed_students[class_name].append(student)
|
21 |
+
|
22 |
+
print(f"Склали 5 тестів")
|
23 |
+
for class_name, students in passed_students.items():
|
24 |
+
print(f"Клас: {class_name}")
|
25 |
+
for student in students:
|
26 |
+
print(f" {student}")
|
27 |
+
print(f"\n\n")
|
28 |
+
|
29 |
+
|
30 |
+
not_passed_students = {}
|
31 |
+
|
32 |
+
for class_name, students in STUDENTS.items():
|
33 |
+
for student in students:
|
34 |
+
tests = get_test_by_student_class_book(student, class_name, "Іван Франко - Захар Беркут")
|
35 |
+
unique_models = set()
|
36 |
+
for test in tests:
|
37 |
+
unique_models.add(test["model"])
|
38 |
+
print("Amount of unique models:", len(unique_models))
|
39 |
+
if len(unique_models) < 5:
|
40 |
+
if class_name not in not_passed_students:
|
41 |
+
not_passed_students[class_name] = []
|
42 |
+
not_passed_students[class_name].append(student)
|
43 |
+
|
44 |
+
print(f"Не cклали 5 тестів")
|
45 |
+
for class_name, students in not_passed_students.items():
|
46 |
+
print(f"Клас: {class_name}")
|
47 |
+
for student in students:
|
48 |
+
print(f" {student}")
|