mirror of
https://github.com/sabazadam/Se302.git
synced 2025-12-31 20:31: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.Course;
|
||||
import org.example.se302.model.ScheduleConfiguration;
|
||||
import org.example.se302.model.TimeSlot;
|
||||
import org.example.se302.service.DataManager;
|
||||
|
||||
import java.time.LocalDate;
|
||||
@@ -170,7 +171,18 @@ public class ScheduleClassroomController {
|
||||
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
|
||||
int studentCount = course.getEnrolledStudentsCount();
|
||||
|
||||
@@ -10,6 +10,7 @@ import javafx.scene.control.TableRow;
|
||||
import javafx.scene.control.TableView;
|
||||
import org.example.se302.model.Course;
|
||||
import org.example.se302.model.ScheduleConfiguration;
|
||||
import org.example.se302.model.TimeSlot;
|
||||
import org.example.se302.service.DataManager;
|
||||
|
||||
import java.time.LocalDate;
|
||||
@@ -173,7 +174,17 @@ public class ScheduleCourseController {
|
||||
dateStr = "Day " + (dayIndex + 1);
|
||||
}
|
||||
|
||||
timeStr = "Slot " + (slotIndex + 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);
|
||||
}
|
||||
} else {
|
||||
timeStr = "Slot " + (slotIndex + 1);
|
||||
}
|
||||
}
|
||||
|
||||
entries.add(new CourseScheduleEntry(courseCode, enrolled, dateStr, timeStr, classroomStr,
|
||||
|
||||
Reference in New Issue
Block a user