From 603431a8e9591ad47d75aceb160a43a4e184d2be Mon Sep 17 00:00:00 2001 From: SowinskiBraeden Date: Wed, 30 Nov 2022 10:32:03 -0800 Subject: [PATCH] fix conflict solutions --- app/generator.py | 5 +++-- template/script.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/generator.py b/app/generator.py index b6526dd..151f417 100644 --- a/app/generator.py +++ b/app/generator.py @@ -24,7 +24,8 @@ def newConflict( "Code": code, "Conflict": description } - logs[pupilNum] = [log] if not exists else logs[pupilNum].append(log) + if exists: logs[pupilNum].append(log) + else: logs[pupilNum] = [log] return exists if conflictType == "Critical" else False def insertConflictSolutions( @@ -37,7 +38,7 @@ def insertConflictSolutions( conflict["Missing"] = data break -# V3 diffelogrs a lot by V1/2 as it does not focus on fitting the classes +# V3 differs a lot by V1/2 as it does not focus on fitting the classes # into the time table first. # It starts by trying to get all classes full and give all students a full class list. # Then it starts to attempt to fit all classes into a timetable, making corretions along diff --git a/template/script.js b/template/script.js index 089e1e8..8134e0c 100644 --- a/template/script.js +++ b/template/script.js @@ -34,10 +34,11 @@ function start() { } eel.expose(post_data); -function post_data(msg) { +function post_data(msg, warn=false) { let newMessage = document.createElement('li'); newMessage.innerText = msg; newMessage.className = 'nostyle'; + if (warn) newMessage.style = 'color:yellow;'; document.getElementById('progress').appendChild(newMessage) } @@ -59,7 +60,7 @@ function finish_callback(error) { while (data.firstChild) { data.removeChild(data.firstChild); } - post_data('Individual student schedules can be found in the \'/output/final/student_schedules/\' folder and the master timetable as well as student with conflicts can be found in the \'/output/final/\' folder.') + post_data('Success! The master timetable as well as student with conflicts can be found in the \'/output/final/\' folder.') } document.getElementById('loader').style.display = 'none';