Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature 2 - README updates, slight improvements #76

Merged
merged 6 commits into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 36 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Binary file added images/assignment_edit_delete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/event_creation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/event_edit_delete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/instructor_choose_task.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/student_assignment_creation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/student_choose_task.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/student_test_creation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/test_edit_delete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/todo_list_screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand All @@ -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");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand All @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand All @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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());
Expand Down