Skip to content

Commit

Permalink
fixes homework documentation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Yufannnn committed Apr 8, 2023
1 parent 20e0000 commit 5033c0f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class CreateExamCommand extends Command {

public static final String COMMAND_WORD = "new-exam";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds an exam to a student.\n"
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds an exam to students.\n"
+ "Parameters: "
+ PREFIX_NAME + "STUDENT_NAME "
+ PREFIX_EXAM + "EXAM_NAME "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
public class CreateHomeworkCommand extends Command {
public static final String COMMAND_WORD = "new-homework";
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds an assignment to a student.\n"
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds an assignment to students.\n"
+ "Parameters: "
+ PREFIX_NAME + "STUDENT_NAME "
+ PREFIX_HOMEWORK + "HOMEWORK_NAME "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class CreateLessonCommand extends Command {

public static final String COMMAND_WORD = "new-lesson";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a lesson to a student.\n"
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a lesson to students.\n"
+ "Parameters: "
+ PREFIX_NAME + "STUDENT_NAME "
+ PREFIX_LESSON + "LESSON_NAME "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import static seedu.address.logic.parser.CliSyntax.PREFIX_DEADLINE;
import static seedu.address.logic.parser.CliSyntax.PREFIX_HOMEWORK;
import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME;
import static seedu.address.logic.parser.ParserUtil.checkNotNullNames;
import static seedu.address.logic.parser.ParserUtil.checkUniqueNotNUllDeadline;
import static seedu.address.logic.parser.ParserUtil.checkUniqueNotNUllHomework;
import static seedu.address.logic.parser.ParserUtil.checkUniqueNotNUllName;

import java.time.LocalDateTime;
import java.util.List;
Expand Down Expand Up @@ -47,11 +47,12 @@ public CreateHomeworkCommand parse(String args) throws ParseException {
CreateHomeworkCommand.MESSAGE_USAGE));
}

checkUniqueNotNUllName(argMultimap);
List<String> nameKeywords = argMultimap.getAllValues(PREFIX_NAME);

checkNotNullNames(nameKeywords);
checkUniqueNotNUllHomework(argMultimap);
checkUniqueNotNUllDeadline(argMultimap);

List<String> nameKeywords = argMultimap.getAllValues(PREFIX_NAME);
String homeworkName = argMultimap.getValue(PREFIX_HOMEWORK).get();
LocalDateTime deadline = ParserUtil.parseDeadline(argMultimap.getValue(PREFIX_DEADLINE).get());
if (deadline.isBefore(LocalDateTime.now())) {
Expand Down

0 comments on commit 5033c0f

Please sign in to comment.