Skip to content

Commit

Permalink
Added Event, hourly tracking (#88)
Browse files Browse the repository at this point in the history
* Added ability to mark attendance

* Added stub tests for MarkAttendanceCommand and MarkAttendanceCommandParser

* Added ability to add multiple pending commands

* Added ability to mark attendance of all students in a tutorial

* Added ability for user to input multiple commands

* Added ability to export attendance

* Fixed bug where attendance marking is cancelled after no command is inputted
Throws CommandException when invalid week is entered to mark attendance

* Added index functionality for MarkAttendanceCommand, ExportAttendanceCommand
Added tests for MarkAttendanceCommand, MarkAttendanceCommandParser,
ExportAttendanceCommand, ExportAttendanceCommandParser

* Added ability to remove Student from Attendance

* Added Assignment, ability to add/delete Assignments

* Fixed model.setStudent(), EditCommandTest

* Added ability to add/delete/edit Events, hourly tracking

* Added ability to add/delete/edit Events, hourly tracking
  • Loading branch information
ZiHawkEye authored and lumos309 committed Oct 22, 2019
1 parent 4915ea5 commit 4c9de33
Show file tree
Hide file tree
Showing 47 changed files with 1,617 additions and 230 deletions.
2 changes: 2 additions & 0 deletions src/main/java/seedu/tarence/commons/core/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ public class Messages {
public static final String MESSAGE_UNKNOWN_COMMAND = "Unknown command";
public static final String MESSAGE_INVALID_ASSIGNMENT_IN_TUTORIAL = "No such assignment exists!";
public static final String MESSAGE_INVALID_ASSIGNMENT_DISPLAYED_INDEX = "The assignment index provided is invalid";
public static final String MESSAGE_INVALID_EVENT_IN_TUTORIAL = "No such event exists!";
public static final String MESSAGE_INVALID_EVENT_DISPLAYED_INDEX = "The event index provided is invalid";
public static final String MESSAGE_INVALID_COMMAND_FORMAT = "Invalid command format! \n%1$s";
public static final String MESSAGE_INVALID_FILE = "Invalid file";
public static final String MESSAGE_INVALID_MODULE_DISPLAYED_INDEX = "The module index provided is invalid";
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/seedu/tarence/logic/commands/AddModuleCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,6 @@ public CommandResult execute(Model model) throws CommandException {

}

@Override
public boolean needsInput() {
return false;
}

@Override
public boolean needsCommand(Command command) {
return false;
}

/**
* Returns true if user command matches command word or any defined synonyms, and false otherwise.
*
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/seedu/tarence/logic/commands/AddStudentCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,6 @@ private String createSuggestedCommands(List<ModCode> similarModCodes, ModCode or
return suggestedCorrections;
}

@Override
public boolean needsInput() {
return false;
}

@Override
public boolean needsCommand(Command command) {
return false;
}

/**
* Returns true if user command matches command word or any defined synonyms, and false otherwise.
*
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/seedu/tarence/logic/commands/AddTutorialCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,6 @@ private String createSuggestedCommands(List<ModCode> similarModCodes, Model mode
return suggestedCorrections;
}

@Override
public boolean needsInput() {
return false;
}

@Override
public boolean needsCommand(Command command) {
return false;
}

/**
* Returns true if user command matches command word or any defined synonyms, and false otherwise.
*
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/seedu/tarence/logic/commands/ChangeTabCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,6 @@ public TabNames getTabvalue() throws CommandException {
throw new CommandException(MESSAGE_INVALID_TAB);
}

@Override
public boolean needsInput() {
return false;
}

@Override
public boolean needsCommand(Command command) {
return false;
}

/**
* Returns true if user command matches command word or any defined synonyms, and false otherwise.
*
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/seedu/tarence/logic/commands/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@ public abstract class Command {
/**
* Returns true if command requires prior user input, else false.
*/
public abstract boolean needsInput();
public boolean needsInput() {
return false;
}

/**
* Returns true if prior command is required for execution, else false.
* Only needed for commands that require prior user input.
*/
public abstract boolean needsCommand(Command command);
public boolean needsCommand(Command command) {
return false;
}

/**
* Returns a list of {@code ModCode}s similar to the given one, and corresponding to a module containing a
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/seedu/tarence/logic/commands/ConfirmNoCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@ public CommandResult execute(Model model) throws CommandException {
return new CommandResult(MESSAGE_CONFIRM_NO_SUCCESS);
}

@Override
public boolean needsInput() {
return false;
}

@Override
public boolean needsCommand(Command command) {
return false;
}

/**
* Returns true if user command matches command word or any defined synonyms, and false otherwise.
*
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/seedu/tarence/logic/commands/ConfirmYesCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,6 @@ public CommandResult execute(Model model) throws CommandException {
return model.getPendingCommand().execute(model);
}

@Override
public boolean needsInput() {
return false;
}

@Override
public boolean needsCommand(Command command) {
return false;
}

/**
* Returns true if user command matches command word or any defined synonyms, and false otherwise.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,6 @@ private String createSuggestedCommands(List<ModCode> similarModCodes, Model mode
return suggestedCorrections;
}

@Override
public boolean needsInput() {
return false;
}

@Override
public boolean needsCommand(Command command) {
return false;
}

/**
* Returns true if user command matches command word or any defined synonyms, and false otherwise.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,6 @@ public CommandResult execute(Model model) throws CommandException {
return new CommandResult(String.format(MESSAGE_DELETE_PERSON_SUCCESS, studentToDelete));
}

@Override
public boolean needsInput() {
return false;
}

@Override
public boolean needsCommand(Command command) {
return false;
}

/**
* Returns true if user command matches command word or any defined synonyms, and false otherwise.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,6 @@ private String createSuggestedCommands(List<ModCode> similarModCodes, ModCode or
return suggestedCorrections;
}

@Override
public boolean needsInput() {
return false;
}

@Override
public boolean needsCommand(Command command) {
return false;
}

/**
* Returns true if user command matches command word or any defined synonyms, and false otherwise.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,6 @@ private String createSuggestedCommands(List<ModCode> similarModCodes, List<TutNa
return suggestedCorrections;
}

@Override
public boolean needsInput() {
return false;
}

@Override
public boolean needsCommand(Command command) {
return false;
}

/**
* Returns true if user command matches command word or any defined synonyms, and false otherwise.
*
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/seedu/tarence/logic/commands/DisplayCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,4 @@ public class DisplayCommand extends Command {
public CommandResult execute(Model model) throws CommandException {
return new CommandResult(message);
}

@Override
public boolean needsInput() {
return false;
}

@Override
public boolean needsCommand(Command command) {
return false;
}
}
10 changes: 0 additions & 10 deletions src/main/java/seedu/tarence/logic/commands/EditCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,6 @@ public CommandResult execute(Model model) throws CommandException {
return new CommandResult(String.format(MESSAGE_EDIT_PERSON_SUCCESS, editedStudent));
}

@Override
public boolean needsInput() {
return false;
}

@Override
public boolean needsCommand(Command command) {
return false;
}

/**
* Creates and returns a {@code Student} with the details of {@code studentToEdit}
* edited with {@code editPersonDescriptor}.
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/seedu/tarence/logic/commands/ExitCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@ public CommandResult execute(Model model) {
return new CommandResult(MESSAGE_EXIT_ACKNOWLEDGEMENT, false, true);
}

@Override
public boolean needsInput() {
return false;
}

@Override
public boolean needsCommand(Command command) {
return false;
}

/**
* Returns true if user command matches command word or any defined synonyms, and false otherwise.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public class ExportAttendanceCommand extends Command {
// TODO: Update the message to include index format
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Exports the attendance of a tutorial in a csv file.\n"
+ "Parameters: "
+ PREFIX_TUTORIAL_NAME + "TUTORIAL_NAME "
+ PREFIX_MODULE + "MODULE_CODE "
+ PREFIX_TUTORIAL_NAME + "TUTORIAL NAME "
+ PREFIX_MODULE + "MODULE CODE "
+ "Example: " + COMMAND_WORD + " "
+ PREFIX_TUTORIAL_NAME + "Lab 1 "
+ PREFIX_MODULE + "CS1010 ";
Expand Down Expand Up @@ -134,16 +134,6 @@ public CommandResult execute(Model model) throws CommandException {
return new CommandResult(String.format(MESSAGE_EXPORT_ATTENDANCE_SUCCESS, targetTutorial.getTutName()));
}

@Override
public boolean needsInput() {
return false;
}

@Override
public boolean needsCommand(Command command) {
return false;
}

/**
* Returns true if user command matches command word or any defined synonyms, and false otherwise.
*
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/seedu/tarence/logic/commands/FindCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,6 @@ public CommandResult execute(Model model) {
TabNames.STUDENTS);
}

@Override
public boolean needsInput() {
return false;
}

@Override
public boolean needsCommand(Command command) {
return false;
}

/**
* Returns true if user command matches command word or any defined synonyms, and false otherwise.
*
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/seedu/tarence/logic/commands/HelpCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@ public CommandResult execute(Model model) {
return new CommandResult(SHOWING_HELP_MESSAGE, true, false);
}

@Override
public boolean needsInput() {
return false;
}

@Override
public boolean needsCommand(Command command) {
return false;
}

/**
* Returns true if user command matches command word or any defined synonyms, and false otherwise.
*
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/seedu/tarence/logic/commands/ListCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,6 @@ public CommandResult execute(Model model) throws CommandException {
return new CommandResult(MESSAGE_SUCCESS, TabNames.STUDENTS);
}

@Override
public boolean needsInput() {
return false;
}

@Override
public boolean needsCommand(Command command) {
return false;
}

/**
* Returns true if user command matches command word or any defined synonyms, and false otherwise.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public class MarkAttendanceCommand extends Command {
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Marks the attendance of a student in a tutorial.\n"
+ "Parameters: "
+ PREFIX_NAME + "NAME "
+ PREFIX_TUTORIAL_NAME + "TUTORIAL_NAME "
+ PREFIX_MODULE + "MODULE_CODE "
+ PREFIX_TUTORIAL_NAME + "TUTORIAL NAME "
+ PREFIX_MODULE + "MODULE CODE "
+ PREFIX_TUTORIAL_WEEKS + "WEEK\n"
+ "Example: " + COMMAND_WORD + " "
+ PREFIX_NAME + "John Doe "
Expand Down Expand Up @@ -263,16 +263,6 @@ private String createSuggestedStudentCommands(
return suggestedCorrections;
}

@Override
public boolean needsInput() {
return false;
}

@Override
public boolean needsCommand(Command command) {
return false;
}

/**
* Returns true if user command matches command word or any defined synonyms, and false otherwise.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,4 @@ public CommandResult execute(Model model) throws CommandException {
public boolean needsInput() {
return index == null;
}

@Override
public boolean needsCommand(Command command) {
return false;
}
}
Loading

0 comments on commit 4c9de33

Please sign in to comment.