mirror of
https://github.com/sabazadam/Se302.git
synced 2025-12-31 12:21:22 +00:00
Fixed CSV export & Course and Classroom views to use time instead of slot number
This commit is contained in:
@@ -13,6 +13,7 @@ import javafx.scene.control.TableView;
|
|||||||
import org.example.se302.model.Classroom;
|
import org.example.se302.model.Classroom;
|
||||||
import org.example.se302.model.Course;
|
import org.example.se302.model.Course;
|
||||||
import org.example.se302.model.ScheduleConfiguration;
|
import org.example.se302.model.ScheduleConfiguration;
|
||||||
|
import org.example.se302.model.TimeSlot;
|
||||||
import org.example.se302.service.DataManager;
|
import org.example.se302.service.DataManager;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
@@ -170,7 +171,18 @@ public class ScheduleClassroomController {
|
|||||||
dateStr = "Day " + (dayIndex + 1);
|
dateStr = "Day " + (dayIndex + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
String timeStr = "Slot " + (slotIndex + 1);
|
// Format time
|
||||||
|
String timeStr;
|
||||||
|
if (config != null) {
|
||||||
|
TimeSlot timeSlot = config.getTimeSlot(dayIndex, slotIndex);
|
||||||
|
if (timeSlot != null) {
|
||||||
|
timeStr = timeSlot.getStartTime() + " - " + timeSlot.getEndTime();
|
||||||
|
} else {
|
||||||
|
timeStr = "Slot " + (slotIndex + 1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
timeStr = "Slot " + (slotIndex + 1);
|
||||||
|
}
|
||||||
|
|
||||||
// Calculate utilization
|
// Calculate utilization
|
||||||
int studentCount = course.getEnrolledStudentsCount();
|
int studentCount = course.getEnrolledStudentsCount();
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import javafx.scene.control.TableRow;
|
|||||||
import javafx.scene.control.TableView;
|
import javafx.scene.control.TableView;
|
||||||
import org.example.se302.model.Course;
|
import org.example.se302.model.Course;
|
||||||
import org.example.se302.model.ScheduleConfiguration;
|
import org.example.se302.model.ScheduleConfiguration;
|
||||||
|
import org.example.se302.model.TimeSlot;
|
||||||
import org.example.se302.service.DataManager;
|
import org.example.se302.service.DataManager;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
@@ -173,8 +174,18 @@ public class ScheduleCourseController {
|
|||||||
dateStr = "Day " + (dayIndex + 1);
|
dateStr = "Day " + (dayIndex + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Format time using configuration's time slots
|
||||||
|
if (config != null) {
|
||||||
|
TimeSlot timeSlot = config.getTimeSlot(dayIndex, slotIndex);
|
||||||
|
if (timeSlot != null) {
|
||||||
|
timeStr = timeSlot.getStartTime() + " - " + timeSlot.getEndTime();
|
||||||
|
} else {
|
||||||
timeStr = "Slot " + (slotIndex + 1);
|
timeStr = "Slot " + (slotIndex + 1);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
timeStr = "Slot " + (slotIndex + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
entries.add(new CourseScheduleEntry(courseCode, enrolled, dateStr, timeStr, classroomStr,
|
entries.add(new CourseScheduleEntry(courseCode, enrolled, dateStr, timeStr, classroomStr,
|
||||||
dayIndex, slotIndex));
|
dayIndex, slotIndex));
|
||||||
|
|||||||
Reference in New Issue
Block a user