diff --git a/README.md b/README.md index 67d4b07..184546a 100644 --- a/README.md +++ b/README.md @@ -26,21 +26,42 @@ The user can access all features of the program through the main dashboard. ![](images/dashboard_screen.png) ## To-Do List Task Creation - -If the user clicks on the `New Task` button, the screen for creating a new task will be displayed. -On this screen, the user can add, delete and edit the tasks in their to-do list. - -To create tasks, the user must fill in the required fields _(for events the format for start and end date is actually yyyy-MM-ddThh:mm:ss, current prompt is incorrect)_ and click `Submit`. -If the formatting is correct and nothing is left blank (except the `priority` field), it should create a new task of whatever type, generate an ID based on the student's name and course ID (if it is a course task), and save it to the task map and TaskMap file immediately. - -![](images/event_creation_screen.png) - -To delete a task _(UI not yet implemented)_, the user must click a task to view its info and then click the `Delete` button _(not yet implemented)_. -This will remove the task from the student's to-do list and move it into their archive, while remaining in the task map. - -For editing _(UI not yet implemented)_, the user must click a task to view its info click the `Edit` button. -A screen similar to the create screen should appear, allowing the user to change any info about the task. -If a section is left blank, no changes will be made. +If the user clicks on the `New Task` button, one of two things will occur: +- If the user is an instructor, they will have a choice between creating a new assignment, new test, or returning to their main screen (`Cancel` button). + ![](images/instructor_choose_task.png) +- If the user is a student, they will have a choice between creating a new event, new assignment, new test, or returning to their main screen (`Cancel`). + (image) + ![](images/student_choose_task.png) +Once they select a task to create, the user will be brought to one of the task creation screens, where they will be prompted to fill in the required information fields. +- For event creation, the user must fill in the title, date, start time, end time, indicate whether the event is recurring, and if so, the frequency of the event (must be one of "monthly", "weekly", "daily"). + - The priority field is optional, and its value will automatically set to 0 if the field is left blank. + ![](images/event_creation.png) +- For assignment creation, the user must fill in a title, due date, and due time. + - The priority value is once again optional, and instructors are not prompted to input an assignment's priority. + - The weightage value is optional for both instructors and students, and will be automatically set to 0 if left blank + ![](images/student_assignment_creation.png) +- For test creation, the user must fill in a title, date, start time and end time. + - Again, priority is optional, and instructors are not prompted to input a test's priority + - Weightage is once again optional for both instructors and students. + ![](images/student_test_creation.png) + +If all required fields are filled in the correct format, a new task should be created of whatever type, with an automatically generated ID based on the task's title, user's name, and course ID (only applicable if it is a course task). The task is then saved to the task map, TaskMap.txt file, and student's to-do list (if applicable) immediately. + +## To-Do List Screen +If a student clicks on the `To Do List` button, they will be brought to a screen displaying the titles of all of their tasks, with accompanying `Edit/Delete` buttons. +![](images/todo_list_screen.png) +- Clicking any of those buttons will bring the student to the task's respective edit/delete screen. + - If the task is an event, the edit/delete screen will look almost identical to the creation screen, except with a new checkbox to mark the event as complete, a disabled title field, and pre-filled values in the others. + ![](images/event_edit_delete.png) + - If the task is an assignment, the edit/delete screen will look similar to the creation screen, but with the "Mark task complete?" checkbox, disabled title field, prefilled values, and 2 new input fields to indicate time needed to complete the assignment, and time already spent on the assignment. + ![](images/assignment_edit_delete.png) + - If the task is a test, the edit/delete screen will also look similar to the creation screen, but with the same new features as other task edit/delete screens, and the new input fields for time needed and time already spent. + ![](images/test_edit_delete.png) + Once the student fills in the task's new information and presses the `Finish` button, the existing task will be updated to reflect those changes. Any fields left blank result in an unchanged value. + - If the task is marked as complete, in addition to editing, the task will also be removed from the student's to-do list and into their task archive. + If the student presses the `Delete` button, the task will be removed from their to-do list and moved to their archive + Pressing the `Cancel` button will return the student to their to-do list screen. +- Clicking the `Return` button will return the student to their dashboard ## Personal Calendar diff --git a/images/assignment_edit_delete.png b/images/assignment_edit_delete.png new file mode 100644 index 0000000..b73ddab Binary files /dev/null and b/images/assignment_edit_delete.png differ diff --git a/images/event_creation.png b/images/event_creation.png new file mode 100644 index 0000000..1c57215 Binary files /dev/null and b/images/event_creation.png differ diff --git a/images/event_edit_delete.png b/images/event_edit_delete.png new file mode 100644 index 0000000..466d906 Binary files /dev/null and b/images/event_edit_delete.png differ diff --git a/images/instructor_choose_task.png b/images/instructor_choose_task.png new file mode 100644 index 0000000..15bcd4a Binary files /dev/null and b/images/instructor_choose_task.png differ diff --git a/images/student_assignment_creation.png b/images/student_assignment_creation.png new file mode 100644 index 0000000..045aca5 Binary files /dev/null and b/images/student_assignment_creation.png differ diff --git a/images/student_choose_task.png b/images/student_choose_task.png new file mode 100644 index 0000000..dd5132c Binary files /dev/null and b/images/student_choose_task.png differ diff --git a/images/student_test_creation.png b/images/student_test_creation.png new file mode 100644 index 0000000..f23459e Binary files /dev/null and b/images/student_test_creation.png differ diff --git a/images/test_edit_delete.png b/images/test_edit_delete.png new file mode 100644 index 0000000..8172f79 Binary files /dev/null and b/images/test_edit_delete.png differ diff --git a/images/todo_list_screen.png b/images/todo_list_screen.png new file mode 100644 index 0000000..f9fe3cb Binary files /dev/null and b/images/todo_list_screen.png differ diff --git a/src/main/java/screens/task_management/task_creation_screens/StudentChooseTaskCreateScreen.java b/src/main/java/screens/task_management/task_creation_screens/StudentChooseTaskCreateScreen.java index aa09571..0b12542 100644 --- a/src/main/java/screens/task_management/task_creation_screens/StudentChooseTaskCreateScreen.java +++ b/src/main/java/screens/task_management/task_creation_screens/StudentChooseTaskCreateScreen.java @@ -2,11 +2,11 @@ import screens.task_management.FileTaskMap; import screens.task_management.task_creation_screens.assignment_creation_screens.AssignmentCreationController; -import screens.task_management.task_creation_screens.assignment_creation_screens.AssignmentCreationScreen; +import screens.task_management.task_creation_screens.assignment_creation_screens.StudentAssignmentCreationScreen; import screens.task_management.task_creation_screens.event_creation_screens.EventCreationController; import screens.task_management.task_creation_screens.event_creation_screens.EventCreationScreen; import screens.task_management.task_creation_screens.test_creation_screens.TestCreationController; -import screens.task_management.task_creation_screens.test_creation_screens.TestCreationScreen; +import screens.task_management.task_creation_screens.test_creation_screens.StudentTestCreationScreen; import use_cases.calendar_scheduler.schedule_conflict_use_case.ScheduleConflictPresenter; import use_cases.calendar_scheduler.scheduler_use_case.SchedulerPresenter; import use_cases.task_management.read_write.TaskMapGateway; @@ -75,9 +75,6 @@ public StudentChooseTaskCreateScreen(SchedulerPresenter schedulerPresenter, Sche */ @Override public void actionPerformed(ActionEvent e) { - if (e.getActionCommand().equals("Cancel")) { // go back to main - cardLayout.show(screens, "StudentMain"); - } // create use case components for task creation TaskCreationOutputBoundary taskCreationOutputBoundary = new TaskCreationResponseFormatter(); TaskMapGateway taskMapGateway = new FileTaskMap("src/main/java/data/TaskMap.txt"); @@ -94,15 +91,17 @@ public void actionPerformed(ActionEvent e) { screens.add("event", eventCreationScreen); cardLayout.show(screens, "event"); } else if (e.getActionCommand().equals("New assignment")) { // create and go to assignment screen - AssignmentCreationScreen assignmentCreationScreen = new AssignmentCreationScreen(assignmentCreationController, screens, cardLayout); + StudentAssignmentCreationScreen assignmentCreationScreen = new StudentAssignmentCreationScreen(assignmentCreationController, screens, cardLayout); screens.add("studentAssignment", assignmentCreationScreen); cardLayout.show(screens, "studentAssignment"); - } else { // create and go to test screen - TestCreationScreen testCreationScreen = new TestCreationScreen(testCreationController, screens, cardLayout); + } else if (e.getActionCommand().equals("New test")){ // create and go to test screen + StudentTestCreationScreen testCreationScreen = new StudentTestCreationScreen(testCreationController, screens, cardLayout); screens.add("studentTest", testCreationScreen); cardLayout.show(screens, "studentTest"); + } else { // cancel button pressed + cardLayout.show(screens, "StudentMain"); } } } diff --git a/src/main/java/screens/task_management/task_creation_screens/assignment_creation_screens/AssignmentCreationScreen.java b/src/main/java/screens/task_management/task_creation_screens/assignment_creation_screens/StudentAssignmentCreationScreen.java similarity index 93% rename from src/main/java/screens/task_management/task_creation_screens/assignment_creation_screens/AssignmentCreationScreen.java rename to src/main/java/screens/task_management/task_creation_screens/assignment_creation_screens/StudentAssignmentCreationScreen.java index 07c3a49..e5add0e 100644 --- a/src/main/java/screens/task_management/task_creation_screens/assignment_creation_screens/AssignmentCreationScreen.java +++ b/src/main/java/screens/task_management/task_creation_screens/assignment_creation_screens/StudentAssignmentCreationScreen.java @@ -10,7 +10,7 @@ import static javax.swing.JOptionPane.showMessageDialog; -public class AssignmentCreationScreen extends JPanel implements ActionListener { +public class StudentAssignmentCreationScreen extends JPanel implements ActionListener { // text fields JTextField title = new JTextField(15); JTextField priority = new JTextField(15); @@ -31,7 +31,7 @@ public class AssignmentCreationScreen extends JPanel implements ActionListener { * @param screens - the rest of the screens in the program * @param screenLayout - for switching between screens */ - public AssignmentCreationScreen(AssignmentCreationController assignmentController, JPanel screens, CardLayout screenLayout) { + public StudentAssignmentCreationScreen(AssignmentCreationController assignmentController, JPanel screens, CardLayout screenLayout) { this.assignmentController = assignmentController; this.screens = screens; this.screenLayout = screenLayout; @@ -48,7 +48,7 @@ public AssignmentCreationScreen(AssignmentCreationController assignmentControlle LabelTextPanel dueDayInfo = new LabelTextPanel( new JLabel("Enter Assignment due date (yyyy-MM-dd):"), dueDay); LabelTextPanel dueTimeInfo = new LabelTextPanel( - new JLabel("Enter Assignment due time (hh:mm):"), dueTime); + new JLabel("Enter Assignment due time (hh:mm, 24 hour):"), dueTime); LabelTextPanel weightInfo = new LabelTextPanel( new JLabel("Enter Assignment weightage (double, don't include %):"), weightage); diff --git a/src/main/java/screens/task_management/task_creation_screens/event_creation_screens/EventCreationScreen.java b/src/main/java/screens/task_management/task_creation_screens/event_creation_screens/EventCreationScreen.java index d015e22..f86cbf0 100644 --- a/src/main/java/screens/task_management/task_creation_screens/event_creation_screens/EventCreationScreen.java +++ b/src/main/java/screens/task_management/task_creation_screens/event_creation_screens/EventCreationScreen.java @@ -49,13 +49,13 @@ public EventCreationScreen(EventCreationController controller, JPanel screens, C LabelTextPanel prioInfo = new LabelTextPanel( new JLabel("Enter event priority (integer)"), priority); LabelTextPanel dateInfo = new LabelTextPanel( - new JLabel("Enter event start date (yyyy-MM-dd)"), date); + new JLabel("Enter event date (yyyy-MM-dd)"), date); LabelTextPanel startTimeInfo = new LabelTextPanel( - new JLabel("Enter event start time (hh:mm)"), startTime); + new JLabel("Enter event start time (hh:mm, 24 hour)"), startTime); LabelTextPanel endTimeInfo = new LabelTextPanel( - new JLabel("Enter event end time (hh:mm)"), endTime); + new JLabel("Enter event end time (hh:mm, 24 hour)"), endTime); LabelTextPanel frequencyInfo = new LabelTextPanel( - new JLabel("Enter frequency of event"), frequency); + new JLabel("Enter frequency of event (one of \"monthly\", \"weekly\", \"daily\")"), frequency); frequency.setEnabled(false); // finish and cancel buttons diff --git a/src/main/java/screens/task_management/task_creation_screens/test_creation_screens/InstructorTestCreationScreen.java b/src/main/java/screens/task_management/task_creation_screens/test_creation_screens/InstructorTestCreationScreen.java index b5442dc..ef6d9ea 100644 --- a/src/main/java/screens/task_management/task_creation_screens/test_creation_screens/InstructorTestCreationScreen.java +++ b/src/main/java/screens/task_management/task_creation_screens/test_creation_screens/InstructorTestCreationScreen.java @@ -47,11 +47,11 @@ public InstructorTestCreationScreen(TestCreationController testController, JPane LabelTextPanel titleInfo = new LabelTextPanel( new JLabel("Enter test title"), title); LabelTextPanel dateInfo = new LabelTextPanel( - new JLabel("Enter test start date (yyyy-MM-dd)"), date); + new JLabel("Enter test date (yyyy-MM-dd)"), date); LabelTextPanel startTimeInfo = new LabelTextPanel( - new JLabel("Enter test start time (hh:mm)"), startTime); + new JLabel("Enter test start time (hh:mm, 24 hour)"), startTime); LabelTextPanel endTimeInfo = new LabelTextPanel( - new JLabel("Enter test end time (hh:mm)"), endTime); + new JLabel("Enter test end time (hh:mm, 24 hour)"), endTime); LabelTextPanel weightInfo = new LabelTextPanel( new JLabel("Enter test weightage (double, don't include %)"), weightage); @@ -88,8 +88,8 @@ public void actionPerformed(ActionEvent evt) { if (evt.getActionCommand().equals("Finish")) { try { // get the start and end date+times and parse them - LocalDateTime startDate = LocalDateTime.parse(date.getText() + "T" + startTime.getText() + ":00"); - LocalDateTime endDate = LocalDateTime.parse(date.getText() + "T" + endTime.getText() + ":00"); + LocalDateTime startDate = LocalDateTime.parse(date.getText() + "T" + startTime.getText()); + LocalDateTime endDate = LocalDateTime.parse(date.getText() + "T" + endTime.getText()); // set weightage value to value in the box or 0 if blank double valWeightage = weightage.getText().equals("") ? 0.0 : Double.parseDouble(weightage.getText()); diff --git a/src/main/java/screens/task_management/task_creation_screens/test_creation_screens/TestCreationScreen.java b/src/main/java/screens/task_management/task_creation_screens/test_creation_screens/StudentTestCreationScreen.java similarity index 90% rename from src/main/java/screens/task_management/task_creation_screens/test_creation_screens/TestCreationScreen.java rename to src/main/java/screens/task_management/task_creation_screens/test_creation_screens/StudentTestCreationScreen.java index 026f40c..2c03c4a 100644 --- a/src/main/java/screens/task_management/task_creation_screens/test_creation_screens/TestCreationScreen.java +++ b/src/main/java/screens/task_management/task_creation_screens/test_creation_screens/StudentTestCreationScreen.java @@ -10,7 +10,7 @@ import static javax.swing.JOptionPane.showMessageDialog; -public class TestCreationScreen extends JPanel implements ActionListener { +public class StudentTestCreationScreen extends JPanel implements ActionListener { // text fields JTextField title = new JTextField(15); JTextField priority = new JTextField(15); @@ -32,7 +32,7 @@ public class TestCreationScreen extends JPanel implements ActionListener { * @param screens - rest of screens in the program * @param screenLayout - for switching between screens */ - public TestCreationScreen(TestCreationController testController, JPanel screens, CardLayout screenLayout) { + public StudentTestCreationScreen(TestCreationController testController, JPanel screens, CardLayout screenLayout) { this.testController = testController; this.screens = screens; this.screenLayout = screenLayout; @@ -47,11 +47,11 @@ public TestCreationScreen(TestCreationController testController, JPanel screens, LabelTextPanel prioInfo = new LabelTextPanel( new JLabel("Enter test priority (integer)"), priority); LabelTextPanel dateInfo = new LabelTextPanel( - new JLabel("Enter test start date (yyyy-MM-dd)"), date); + new JLabel("Enter test date (yyyy-MM-dd)"), date); LabelTextPanel startTimeInfo = new LabelTextPanel( - new JLabel("Enter test start time (hh:mm)"), startTime); + new JLabel("Enter test start time (hh:mm, 24 hour)"), startTime); LabelTextPanel endTimeInfo = new LabelTextPanel( - new JLabel("Enter test end time (hh:mm)"), endTime); + new JLabel("Enter test end time (hh:mm, 24 hour)"), endTime); LabelTextPanel weightInfo = new LabelTextPanel( new JLabel("Enter test weightage (double, don't include %)"), weightage); diff --git a/src/main/java/screens/task_management/task_edit_delete_screens/assignment_edit_delete_screens/AssignmentEditDeleteScreen.java b/src/main/java/screens/task_management/task_edit_delete_screens/assignment_edit_delete_screens/AssignmentEditDeleteScreen.java index abf336a..ca595a1 100644 --- a/src/main/java/screens/task_management/task_edit_delete_screens/assignment_edit_delete_screens/AssignmentEditDeleteScreen.java +++ b/src/main/java/screens/task_management/task_edit_delete_screens/assignment_edit_delete_screens/AssignmentEditDeleteScreen.java @@ -74,7 +74,7 @@ public AssignmentEditDeleteScreen( LabelTextPanel dueDayInfo = new LabelTextPanel( new JLabel("Enter new Assignment due date (yyyy-MM-dd):"), dueDay); LabelTextPanel dueTimeInfo = new LabelTextPanel( - new JLabel("Enter new Assignment due time (hh:mm, 24 hour time):"), dueTime); + new JLabel("Enter new Assignment due time (hh:mm, 24 hour):"), dueTime); LabelTextPanel weightInfo = new LabelTextPanel( new JLabel("Enter new Assignment weightage (double, don't include %):"), weightage); LabelTextPanel timeNeededInfo = new LabelTextPanel( @@ -135,7 +135,7 @@ public void actionPerformed(ActionEvent e) { valTimeNeeded, valTimeSpent); // notify user of success and return to main screen - showMessageDialog(this, "Assignment edited successfully"); // todo customize this message + showMessageDialog(this, "Assignment edited successfully"); screenLayout.show(screens, "StudentMain"); } // Assignment being deleted diff --git a/src/main/java/screens/task_management/task_edit_delete_screens/event_edit_delete_screens/EventEditDeleteScreen.java b/src/main/java/screens/task_management/task_edit_delete_screens/event_edit_delete_screens/EventEditDeleteScreen.java index 6a57309..0baae52 100644 --- a/src/main/java/screens/task_management/task_edit_delete_screens/event_edit_delete_screens/EventEditDeleteScreen.java +++ b/src/main/java/screens/task_management/task_edit_delete_screens/event_edit_delete_screens/EventEditDeleteScreen.java @@ -74,9 +74,9 @@ public EventEditDeleteScreen(EventEditController eventEditController, LabelTextPanel dateInfo = new LabelTextPanel( new JLabel("Enter new event start date (yyyy-MM-dd)"), date); LabelTextPanel startTimeInfo = new LabelTextPanel( - new JLabel("Enter new event start time (hh:mm)"), startTime); + new JLabel("Enter new event start time (hh:mm, 24 hour)"), startTime); LabelTextPanel endTimeInfo = new LabelTextPanel( - new JLabel("Enter new event end time (hh:mm)"), endTime); + new JLabel("Enter new event end time (hh:mm, 24 hour)"), endTime); LabelTextPanel frequencyInfo = new LabelTextPanel( new JLabel("Enter new frequency of event"), frequency); frequency.setEnabled(recurring.isSelected()); diff --git a/src/main/java/screens/task_management/task_edit_delete_screens/test_edit_delete_screens/TestEditDeleteScreen.java b/src/main/java/screens/task_management/task_edit_delete_screens/test_edit_delete_screens/TestEditDeleteScreen.java index 53c25c4..ec9822e 100644 --- a/src/main/java/screens/task_management/task_edit_delete_screens/test_edit_delete_screens/TestEditDeleteScreen.java +++ b/src/main/java/screens/task_management/task_edit_delete_screens/test_edit_delete_screens/TestEditDeleteScreen.java @@ -76,9 +76,9 @@ public TestEditDeleteScreen( LabelTextPanel dateInfo = new LabelTextPanel( new JLabel("Enter new test start date (yyyy-MM-dd)"), date); LabelTextPanel startTimeInfo = new LabelTextPanel( - new JLabel("Enter new test start time (hh:mm)"), startTime); + new JLabel("Enter new test start time (hh:mm, 24 hour)"), startTime); LabelTextPanel endTimeInfo = new LabelTextPanel( - new JLabel("Enter new test end time (hh:mm)"), endTime); + new JLabel("Enter new test end time (hh:mm, 24 hour)"), endTime); LabelTextPanel weightInfo = new LabelTextPanel( new JLabel("Enter new test weightage (double, don't include %)"), weightage); LabelTextPanel timeNeededInfo = new LabelTextPanel( @@ -142,17 +142,17 @@ public void actionPerformed(ActionEvent e) { valTimeNeeded, valTimeSpent); // update user and return to main list page - showMessageDialog(this, "Test edited successfully."); // todo customize this message + showMessageDialog(this, "Test edited successfully."); screenLayout.show(screens, "StudentMain"); } else if (e.getActionCommand().equals("Delete")) { // Test being deleted // delete Test taskDeletionController.delete(testInfo.getId()); - // update user and return to to-do list page + // update user and return to main page showMessageDialog(this, "Test deleted successfully."); - screenLayout.show(screens, "toDoList"); - } else { // Test is racist screenLayout.show(screens, "StudentMain"); + } else { // cancel button pressed, return to to-do list + screenLayout.show(screens, "toDoList"); } } catch (Exception ex) { showMessageDialog(this, ex.getMessage());