This commit is contained in:
SowinskiBraeden committed 2022-06-23 18:38:29 -07:00
1 parent f56cd4f6ac
commit b03941fab2
1 file changed
+4 -5
+4 -5
View File
@@ -2,6 +2,7 @@
import json import json
import random import random
from inspect import currentframe from inspect import currentframe
import pprint
# Import from custom utilities # Import from custom utilities
from util.mockStudents import getSampleStudents from util.mockStudents import getSampleStudents
@@ -52,7 +53,7 @@ def newConflict(pupilNum: str, email: str, conflictType: str, code: str, descrip
} }
if exists: logs[pupilNum].append(log) if exists: logs[pupilNum].append(log)
else: logs[pupilNum] = [log] else: logs[pupilNum] = [log]
return exists return exists if conflictType == "Critical" else False
minReq, median, classCap = 18, 24, 30 minReq, median, classCap = 18, 24, 30
activeCourses = {} activeCourses = {}
@@ -489,7 +490,6 @@ def generateScheduleV3(
found_oBlockSolution = True found_oBlockSolution = True
break break
if not found_oBlockSolution: if not found_oBlockSolution:
exceptions.append(clashIndex) exceptions.append(clashIndex)
criticalCount += 1 criticalCount += 1
@@ -546,7 +546,7 @@ def generateScheduleV3(
else: else:
print(f"Fatal error ({getLineNumber()}): Impossible error") print(f"Fatal error ({getLineNumber()}): Impossible error")
continue break
finalConflictLogs = { finalConflictLogs = {
"Conflicts": conflictLogs, "Conflicts": conflictLogs,
@@ -581,8 +581,7 @@ def generateScheduleV3(
for student in students: for student in students:
for block in student["schedule"]: for block in student["schedule"]:
if len(student["schedule"][block]) == 0: if len(student["schedule"][block]) == 0:
if int(block[len(block)-1]) <= 5: student["schedule"][block].append(flex[0]) student["schedule"][block].append(flex[0]) if int(block[len(block)-1]) <= 5 else student["schedule"][block].append(flex[1])
elif int(block[len(block)-1]) > 5: student["schedule"][block].append(flex[1])
# Update Student records # Update Student records
with open(studentsDir, "w") as outfile: with open(studentsDir, "w") as outfile: