Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
b44b350
Refractor Duke to Quinn and implement Level-0
Sep 4, 2024
1a384e7
Implement Level-1
Sep 4, 2024
80154db
Implement Level-2
Sep 4, 2024
83bc054
Implement Level-3 and adhere to coding standard
Sep 4, 2024
9cdfdcd
Implement Level-4
Sep 5, 2024
e9a5a29
Implement Level-5 and review code quality
Sep 10, 2024
6a82856
Merge branch 'branch-Level-5'
Sep 10, 2024
8e7dc1c
Organise classes into different packages
Sep 10, 2024
e16f866
Merge branch 'branch-A-Packages'
Sep 10, 2024
53936b5
Update README.md
Sep 10, 2024
b25c7de
Implement Level-6
Sep 10, 2024
b06b90c
Fix some text errors due to refactoring
Sep 10, 2024
9c924df
Merge branch 'master' into branch-Level-6
Sep 10, 2024
bdaa224
Fix text errors in Quinn java file
Sep 10, 2024
6799df1
Merge branch 'master' into branch-Level-6
Sep 10, 2024
9dde6b8
Implement Level-7
Sep 16, 2024
d8e6940
Merge branch 'branch-Level-6'
Sep 16, 2024
06ca525
Merge branch 'branch-Level-7'
Sep 16, 2024
db7785f
Implement saving after deletion of tasks
Sep 16, 2024
8a57ddf
update some responses by quinn
Sep 16, 2024
b35fedf
Implement A-MoreOOP, refactor code to extract out more classes
Sep 26, 2024
a9c924a
Implement Level-8 for chatbot to understand date time
Sep 26, 2024
b46f621
Implement Level-9
Sep 26, 2024
68cff40
Merge pull request #1 from kaboomzxc/branch-Level-8
kaboomzxc Sep 26, 2024
c29453c
Merge branch 'master' into branch-Level-9
Sep 26, 2024
5b746ce
Merge pull request #2 from kaboomzxc/branch-Level-9
kaboomzxc Sep 26, 2024
02bc63a
Added JavaDoc comments
Sep 26, 2024
a4e9125
Merge pull request #3 from kaboomzxc/branch-A-JavaDoc
kaboomzxc Sep 26, 2024
c621d5e
Implement User Guide
Oct 8, 2024
b0bf095
Update User Guide
Oct 9, 2024
bb7a02e
Update User Guide
Oct 9, 2024
0054652
Update User Guide
Oct 9, 2024
626cc6b
Update User Guide
Oct 9, 2024
e0003ff
Update User Guide
Oct 9, 2024
2d4c709
Update download link
Oct 9, 2024
0681301
Update UG
Oct 9, 2024
1444e91
remove "build.gradle" file
Oct 9, 2024
389da92
Change "Checkmark" symbol to "X" symbol
Oct 9, 2024
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
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Duke project template
# Quinn project template

This is a project template for a greenfield Java project. It's named after the Java mascot _Duke_. Given below are instructions on how to use it.

Expand All @@ -13,12 +13,15 @@ Prerequisites: JDK 17, update Intellij to the most recent version.
1. If there are any further prompts, accept the defaults.
1. Configure the project to use **JDK 17** (not other versions) as explained in [here](https://www.jetbrains.com/help/idea/sdk.html#set-up-jdk).<br>
In the same dialog, set the **Project language level** field to the `SDK default` option.
3. After that, locate the `src/main/java/Duke.java` file, right-click it, and choose `Run Duke.main()` (if the code editor is showing compile errors, try restarting the IDE). If the setup is correct, you should see something like the below as the output:
3. After that, locate the `src/main/java/quinn/Quinn.java` file, right-click it, and choose `Run Quinn.main()` (if the code editor is showing compile errors, try restarting the IDE). If the setup is correct, you should see something like the below as the output:
```
Hello from
____ _
| _ \ _ _| | _____
| | | | | | | |/ / _ \
| |_| | |_| | < __/
|____/ \__,_|_|\_\___|

QQQ U U III N N N N
Q Q U U I NN N NN N
Q Q U U I N N N N N N
Q Q U U I N NN N NN
QQQ UUU III N N N N
Q
QQ
```
159 changes: 143 additions & 16 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,157 @@
# Duke User Guide
# Quinn Task Manager User Guide

// Update the title above to match the actual product name
Quinn is a personal assistant chatbot that helps in Task Management. <br>
It is a desktop application optimized to use from a Command Line Interface (CLI). <br>
Quinn helps to keep track of your to-dos, deadlines, and events. <br>
With Quinn, you can easily add, list, mark, and delete tasks using simple commands. <br>
This User Guide(UG) is also found at this link : [Quinn User Guide](https://kaboomzxc.github.io/ip/)

// Product screenshot goes here
## Table of Contents
1. [Quick Start](#quick-start)
2. [Features](#features)
3. [Command Reference](#command-reference)
4. [Understanding Task Types](#understanding-task-types)
5. [Error Handling](#error-handling)
6. [Data Storage](#data-storage)
7. [Quinn Command Summary](#quinn-command-summary)

// Product intro goes here
## Quick Start

## Adding deadlines
1. Ensure you have Java 17 installed on your computer.
2. Download the latest `Quinn.jar` file from [here](https://github.com/kaboomzxc/ip/releases).
3. Copy the file to your desired folder.
4. Open a command prompt or terminal, navigate to the folder containing Quinn.jar, and run: **java -jar Quinn.jar**

// Describe the action and its outcome.

// Give examples of usage
## Features

Example: `keyword (optional arguments)`
### Adding Tasks

// A description of the expected outcome goes here
Quinn supports three types of tasks: ToDos, Deadlines, and Events.

```
expected output
```
#### Adding a ToDo
Command: `todo <description>` <br>
Example: `todo Buy groceries`

#### Adding a Deadline
Command: `deadline <description> /by <date> <time>` <br>
Example: `deadline Submit report /by 2023-05-15 1400` <br>
* For proper recognition of `date` and `time`,
* `date` has to be entered first, followed by `time`.
* `date` has to be in the format `yyyy-MM-dd` (e.g. `2024-01-21`).
* `time` has to be in the format `HHmm` (e.g. `1400`) and can be optional.
* Nonetheless, any other string e.g. 13121995 will still be accepted, albeit not formatted
* (i.e. the same exact string "13121995" would be displayed.)

#### Adding an Event
Command: `event <description> /from <start date> <start time> /to <end date> <end time>` <br>
Example: `event Team meeting /from 2023-06-20 0900 /to 2023-06-20 1100` <br>
* For proper recognition of `date` and `time`,
* `date` has to be entered first, followed by `time`.
* `date` has to be in the format `yyyy-MM-dd` (e.g. `2024-01-21`).
* `time` has to be in the format `HHmm` (e.g. `1800`) and can be optional.
* Nonetheless, any other string e.g. 13121995 will still be accepted, albeit not formatted
* (i.e. the same exact string "13121995" would be displayed.)

### Examples of Tasks Display

After using these commands, tasks will be displayed in the following format:

1. ToDo: `[T][ ] Buy groceries`
2. Deadline: `[D][ ] Submit report (by: Jun 30 2023 02:00 PM)`
3. Event: `[E][ ] Team meeting (from: Jun 15 2023 09:00 AM to: Jun 15 2023 11:00 AM)`

### Listing Tasks
Command: `list`

### Marking Tasks as Done
Command: `mark <task number>`
Example: `mark 1`

### Unmarking Tasks
Command: `unmark <task number>`
Example: `unmark 2`

### Deleting Tasks
Command: `delete <task number>`
Example: `delete 3`

### Finding Tasks
Command: `find <keyword>`
Example: `find meeting`

### Exiting the Application
Command: `bye`


## Command Reference
Here is a quick reference for all available commands:

• todo [description]: Add a ToDo task <br>
• deadline [description] /by [date] [time]: Add a Deadline task <br>
• event [description] /from [start date] [start time] /to [end date] [end time]: Add an Event task <br>
• list: Display all tasks <br>
• mark [task number]: Mark a task as done <br>
• unmark [task number]: Mark a task as not done <br>
• delete [task number]: Remove a task <br>
• find [keyword]: Search for tasks containing the keyword <br>
• bye: Exit the application

## Understanding Task Types
Quinn supports three types of tasks:

• ToDo: A simple task without any date/time constraint.

Displayed as: [T][ ] <Task Description>


• Deadline: A task with a specific due date and time.

Displayed as: [D][ ] <Task Description> (by: Date Time)


• Event: A task with a start and end date/time.

Displayed as: [E][ ] <Task Description> (from: Start Date Time to: End Date Time)

The square brackets next to the task type indicator (T/D/E) show the task's completion status: <br>
[ ]: Task is not done <br>
[X]: Task is done

## Error Handling
Quinn will display error messages if it encounters issues. Here are some common errors and their meanings:

"INVALID COMMAND. Please try again!": The command entered is not recognized. <br>
"The description of a todo cannot be empty!": You need to provide a description for the ToDo task. <br>
"INCOMPLETE COMMAND": Some required information is missing from the command. <br>
"Task not found. Please try again!": The task number provided doesn't exist in the list. <br>
"Please enter a valid task number to be marked as done!": The mark/unmark command requires a valid task number. <br>

If you encounter an error, read the error message carefully and adjust your command accordingly.


## Data Storage
Quinn automatically saves your tasks to a file named "tasks.txt" in a "data" folder in the same directory as the Quinn.jar file. This ensures that your tasks persist between sessions.
Note: Do not modify the "tasks.txt" file manually, as this may cause Quinn to malfunction.




## Quinn Command Summary

| Command | Description | Example |
|---------|-------------|---------|
| `todo [description]` | Add a ToDo task | `todo Buy groceries` |
| `deadline [description] /by [date] [time]` | Add a Deadline task | `deadline Submit report /by 2023-06-30 1400` |
| `event [description] /from [start date] [start time] /to [end date] [end time]` | Add an Event task | `event Team meeting /from 2023-06-15 0900 /to 2023-06-15 1100` |
| `list` | Display all tasks | `list` |
| `mark [task number]` | Mark a task as done | `mark 1` |
| `unmark [task number]` | Mark a task as not done | `unmark 2` |
| `delete [task number]` | Remove a task | `delete 3` |
| `find [keyword]` | Search for tasks containing the keyword | `find meeting` |
| `bye` | Exit the application | `bye` |

## Feature ABC

// Feature details


## Feature XYZ

// Feature details
10 changes: 0 additions & 10 deletions src/main/java/Duke.java

This file was deleted.

127 changes: 127 additions & 0 deletions src/main/java/quinn/Quinn.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
package quinn;

import quinn.command.Command;
import quinn.command.CommandType;
import quinn.command.FindCommand;
import quinn.exception.QuinnException;
import quinn.parser.Parser;
import quinn.task.TaskList;
import quinn.ui.Ui;
import quinn.storage.Storage;

import java.io.IOException;

/**
* The Quinn class represents the main controller for the Quinn task management application.
* It initializes the application components, manages the command execution loop, and
* coordinates interactions between the user interface, task list, storage, and parser.
*
* This class is responsible for:
* Initializing the UI, parser, storage, and task list
* Running the main command execution loop
* Handling exceptions during command execution
* Managing the display of filtered tasks
*/
public class Quinn {

/** The user interface component for handling input/output. */
private final Ui ui;

/** The parser for interpreting user commands. */
private final Parser parser;

/** The storage component for persisting task data. */
private Storage storage;

/** The list of tasks managed by the application. */
private TaskList taskList;

/**
* Constructs a new Quinn application instance.
* Initializes the UI, parser, storage, and task list components.
*
* @param folderName the name of the folder to store task data
* @param fileName the name of the file to store task data
*/
public Quinn(String folderName, String fileName) {
ui = new Ui();
parser = new Parser();

Command command = null;

try {
storage = new Storage(folderName, fileName);
taskList = storage.loadTasksFromFile();
} catch (QuinnException | IOException e) {
ui.displayError(e.getMessage());
taskList = new TaskList();
}
}


/**
* Checks if there are filtered tasks and displays them if necessary.
* This method is called after each command execution to maintain
* the display of filtered tasks when appropriate.
*
* @param command the last executed command
*/
public void checkAndDisplayFilteredTasks(Command command) {
if (taskList.hasFilter()) {
String filteredTasksMessage;

if (taskList.getFilterCommandType() == CommandType.FIND && !(command instanceof FindCommand)) {
filteredTasksMessage = ui.tasksWithKeywordMessage(taskList, taskList.getFilterInfo());
} else {
filteredTasksMessage = "";
}

if (!filteredTasksMessage.isEmpty()) {
ui.displayFilteredTasks(filteredTasksMessage);
}
}
}

/**
* The main entry point of the Quinn application.
* Creates a new Quinn instance and starts its execution.
*
* @param args command-line arguments (not used)
*/
public static void main(String[] args) {
new Quinn("data", "tasks.txt").run();
}

/**
* Runs the main execution loop of the Quinn application.
* This method continuously reads user input, executes commands,
* and displays results until an exit command is received.
*
* The execution loop performs the following steps:
* Read a command from the user
* Parse the command
* Execute the command
* Check and display filtered tasks if necessary
* Handle any exceptions that occur during execution
*/
public void run() {
ui.displayWelcome();
boolean isExit = false;

Command command = null;

while (!isExit) {
try {
String commandLine = ui.readCommand();
command = parser.parse(commandLine);
command.execute(taskList, ui, storage);
isExit = command.isExit();
} catch (QuinnException | IOException e) {
ui.displayError(e.getMessage());
} finally {
checkAndDisplayFilteredTasks(command);
ui.displayLine();
}
}
}
}
Loading