-
Notifications
You must be signed in to change notification settings - Fork 5
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
Bad FlashCards/ Deadline - v1.3 #150
Conversation
@@ -30,6 +30,9 @@ public DeadlinePanel(Deadline deadline, int displayedIndex) { | |||
this.deadline = deadline; | |||
id.setText(displayedIndex + ". "); | |||
task.setText(deadline.getTask().toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can change the task from label to Textflow so that the text will not be concatenated and you can change the color of the text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks!
requireNonNull(model); | ||
List<FlashCard> lastShownList = model.getFilteredFlashCardList(); | ||
if (index.getZeroBased() >= lastShownList.size()) { | ||
throw new CommandException(Messages.MESSAGE_INVALID_FLASHCARD_DISPLAYED_INDEX); | ||
} | ||
|
||
FlashCard badFlashcard = lastShownList.get(index.getZeroBased()); | ||
|
||
Task task = new Task("To Do: Bad Questions"); | ||
DueDate d = BadQuestions.getBadDeadline(); | ||
Deadline deadline = new Deadline(task, d); | ||
|
||
//TODO: add questions and due date into filtered bad flashcards list | ||
Question q = badFlashcard.getQuestion(); | ||
|
||
BadQuestions badQuestions = new BadQuestions(); | ||
|
||
badQuestions.addBadQuestion(d, q); | ||
|
||
badQuestions.saveAsJson(badQuestions); | ||
|
||
try { | ||
model.addDeadline(deadline); | ||
} catch (DuplicateDeadlineException e) { | ||
return new CommandResult(DUPLICATE_DEADLINE); | ||
} | ||
|
||
return new CommandResult(MESSAGE_SUCCESS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider SLAPing it
@@ -0,0 +1,31 @@ | |||
//@@author: dalsontws |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct format is //@@author dalsontws
// convert java object to JSON format, | ||
// and returned as JSON formatted string | ||
String json = gson.toJson(badQuestions.getBadQuestionsList()); | ||
try { | ||
//write converted json data to a file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Writing a method to abstract these steps might be better than to explain it through comments
Add 'Bad' FlashCard as a Deadline on the list
Store 'Bad' FlashCards in Json
Add Tests for 'Bad' Command
Integrate 'Bad' Command with Edit and Add FlashCard Commands