-
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
v1.2.1 attendence #81
v1.2.1 attendence #81
Conversation
# Conflicts: # src/main/java/seedu/address/commons/core/Messages.java # src/main/java/seedu/address/logic/parser/AddressBookParser.java
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.
Excellent work Sheng Yang!
@@ -9,6 +9,7 @@ | |||
public static final String MESSAGE_INVALID_COMMAND_FORMAT = "Invalid command format! \n%1$s"; | |||
public static final String MESSAGE_INVALID_PERSON_DISPLAYED_INDEX = "The student index provided is invalid"; | |||
public static final String MESSAGE_PERSONS_LISTED_OVERVIEW = "%1$d students listed!"; | |||
public static final String MESSAGE_SESSION_DOES_NOT_EXIST = "The session does not exist"; |
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.
Perhaps missing a fullstop?
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.
Not sure about this, the punctuation isn't consistent for other message strings too. I guess we can clean this up after integration.
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.
Sure thing!
} | ||
|
||
/** | ||
* Standardize date string into the format of dd/MM/yyyy. |
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.
Perhaps "Standardizes" instead of "Standardize"?
* Signals that the operation will result in duplicate Classes (Classes are considered duplicates if they have the same | ||
* date). | ||
*/ | ||
public class SessionNotFoundException extends RuntimeException{} |
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.
Is there a missing space between RunTimeException and "{}"?
/** | ||
* Jackson-friendly version of {@link Attributes}. | ||
*/ | ||
public class JsonAdaptedAttributes { |
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.
Awesome!
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.
Amazing job! Just some minor nitpicks with regard to code styling (mostly just unnecessary line breaks/white spaces, a few naming alternatives to consider).
Stellar job nonetheless 😄 This is really top-notch effort.
public static final String COMMAND_WORD = "clearsession"; | ||
public static final String MESSAGE_SUCCESS = "The session in the current session list has been cleared"; | ||
|
||
|
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.
Should this unncessary extra line break be removed?
public static final Prefix PREFIX_SESSIONNAME = new Prefix("s/"); | ||
public static final Prefix PREFIX_SESSIONDATE = new Prefix("d/"); |
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.
Maybe these could be renamed to PREFIX_SESSION_NAME
and PREFIX_SESSION_DATE
?
if (sessions.size() != ((SessionList) other).getSessions().size()) { | ||
return false; | ||
} | ||
|
||
Session[] testArray1 = new Session[sessions.size()]; | ||
Session[] testArray2 = new Session[sessions.size()]; | ||
|
||
int i = 0; | ||
int j = 0; | ||
for (Session s: sessions) { | ||
testArray1[i] = s; | ||
i++; | ||
} | ||
for (Session s: ((SessionList) other).getSessions()) { | ||
testArray2[j] = s; | ||
j++; | ||
} | ||
|
||
for (int k = 0; k < sessions.size(); k++) { | ||
if (!testArray1[k].isSameSession(testArray2[k])) { | ||
return false; | ||
} | ||
} |
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.
Maybe some comments could be added here to more clearly explain the thought process?
*/ | ||
public class JsonAdaptedSession { | ||
|
||
|
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.
Unnecessary additional line break?
@@ -18,6 +19,7 @@ | |||
import seedu.address.model.person.NameContainsKeywordsPredicate; | |||
import seedu.address.testutil.AddressBookBuilder; | |||
|
|||
|
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.
Unnecessary line break?
|
||
import org.junit.jupiter.api.Test; | ||
|
||
|
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.
Unnecessary line break?
|
||
import org.junit.jupiter.api.Test; | ||
|
||
|
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.
Unnecessary line break?
|
||
|
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.
Unnecessary whitespaces?
|
||
|
||
|
||
|
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.
Unnecessary whitespaces?
} | ||
|
||
@Override | ||
public void addPerson(Person person) { | ||
for (Session s: sessionList.getSessions()) { |
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.
Should we remove this and use run in debug mode when its finalised
|
||
@Test | ||
public void execute_sessionAcceptedByModel_addSuccessful() throws Exception { | ||
ModelStubAcceptingSessionAdded modelStub = new ModelStubAcceptingSessionAdded(); |
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.
I like your usage of stubs!
* Returns if a given string is a valid index range. | ||
*/ | ||
public static boolean isValidIndexRange(String test) { | ||
return test.matches(VALIDATION_REGEX_1) || test.matches(VALIDATION_REGEX_2); |
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.
Pattern.matches throw some exceptions when dealing with some corner cases like. Perhaps String.matches() do as well?
@@ -17,16 +16,26 @@ | |||
*/ | |||
public class Session implements Comparable<Session> { | |||
|
|||
private final LocalDate date; | |||
private final SessionName sessionName; | |||
private final SessionDate sessionDate; | |||
private final Map<Integer, Attributes> studentList; |
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.
Perhaps studentAttributesList would be better here?
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.
LGTM
Implements new Attendance feature together with Session/SessionList.
This PR does not guarantee the functionality of the Participate and Presence command, as it can only be completely done during integration (It needs to 'enter a session' which will have to acquire SessionName internally).