Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 13 additions & 3 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Examples:

### Marking a student's attendance: `mark'

Denotes an existing student as present. The student may either be identified by index number
Denotes an existing student as paid. The student may either be identified by index number
in the edulog (starting from 1) or name (this is both case-sensitive and space-sensitive within the name provided).

Format: `mark <INDEX - must be a positive integer>` OR `mark <STUDENT NAME>`
Expand All @@ -156,9 +156,19 @@ Examples:
* `mark 3`
* `mark Alex Yeoh`

### Marking all students' attendance: `markall'

Denotes all existing students as paid.

Format: `markall`

Examples:
* `markall`
* `markall ofoeofn4334f30f04a3dr34r` (all subsequent inputs are ignored)

### Unmarking a student's attendance: `unmark'

Denotes an existing student as absent. The student may either be identified by index number
Denotes an existing student as unpaid. The student may either be identified by index number
in the edulog (starting from 1) or name (this is both case-sensitive and space-sensitive within the name provided).

Format: `unmark <INDEX - must be a positive integer>` OR `unmark <STUDENT NAME>`
Expand All @@ -169,7 +179,7 @@ Examples:

### Unmarking all students' attendance: `unmarkall'

Denotes all existing students as absent.
Denotes all existing students as unpaid.

Format: `unmarkall`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import seedu.edulog.model.Model;

/**
* Mark all students, usually after attendance is taken
* Mark all students, usually after student has paid
*/
public class MarkAllCommand extends Command {
public static final String COMMAND_WORD = "markall";
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/edulog/logic/commands/MarkCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import seedu.edulog.model.Model;

/**
* Marks a student identified using it's displayed index from the edulog book.
* Marks a student identified using their displayed index from the edulog book.
*/
public abstract class MarkCommand extends Command {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import seedu.edulog.model.student.Student;

/**
* Marks a student as present identified using its displayed index from the edulog book.
* Marks a student as has paid, identified using their displayed index from the edulog book.
*/
public class MarkIndexCommand extends MarkCommand {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import seedu.edulog.model.Model;

/**
* Unmark all students, usually after attendance is taken
* Unmark all students, usually when students have not paid.
*/
public class UnmarkAllCommand extends Command {
public static final String COMMAND_WORD = "unmarkall";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import seedu.edulog.model.Model;

/**
* Unmarks a student identified using its displayed index from the edulog book.
* Unmarks a student identified using their displayed index from the edulog book.
*/
public abstract class UnmarkCommand extends Command {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import seedu.edulog.model.student.Student;

/**
* Marks a student as absent identified using its displayed index from the edulog book.
* Marks a student as unpaid identified using their displayed index from the edulog book.
*/
public class UnmarkIndexCommand extends UnmarkCommand {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import seedu.edulog.model.student.Student;

/**
* Unmarks a student identified using its displayed name from the edulog book.
* Unmarks a student identified using their displayed name from the edulog book.
*/
public class UnmarkNameCommand extends UnmarkCommand {

Expand Down
12 changes: 6 additions & 6 deletions src/main/java/seedu/edulog/model/EduLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,34 +108,34 @@ public void removeStudent(Student key) {
}

/**
* Marks given student as present.
* Marks given student as paid.
*
* @param student the student to mark as present.
* @param student the student to mark as paid.
*/
public void markStudent(Student student) {
requireNonNull(student);
student.mark();
}

/**
* Marks all students as present.
* Marks all students as paid.
*/
public void markAllStudents() {
students.forEach(Student::mark);
}

/**
* Marks given student as absent.
* Marks given student as unpaid.
*
* @param student the student to mark as absent.
* @param student the student to mark as unpaid.
*/
public void unmarkStudent(Student student) {
requireNonNull(student);
student.unmark();
}

/**
* Marks all students as absent.
* Marks all students as unpaid.
*/
public void unmarkAllStudents() {
students.forEach(Student::unmark);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/seedu/edulog/model/Model.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public interface Model {
void deleteStudent(Student target);

/**
* Marks the given student as present.
* Marks the given student as paid.
* The student must exist in the address book.
*/
void markStudent(Student target);
Expand All @@ -77,7 +77,7 @@ public interface Model {
void markAllStudents();

/**
* Marks the given student as absent.
* Marks the given student as unpaid.
* The student must exist in the address book.
*/
void unmarkStudent(Student target);
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/seedu/edulog/model/ModelManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ public void deleteStudent(Student target) {
}

/**
* Marks the given student as present.
* Marks the given student as paid.
* The student must exist in the address book.
*
* @param target the student to mark as present.
* @param target the student to mark as paid.
*/
@Override
public void markStudent(Student target) {
Expand All @@ -124,10 +124,10 @@ public void markAllStudents() {
}

/**
* Marks the given student as absent.
* Marks the given student as unpaid.
* The student must exist in the address book.
*
* @param target the student to mark as absent.
* @param target the student to mark as unpaid.
*/
@Override
public void unmarkStudent(Student target) {
Expand Down
22 changes: 11 additions & 11 deletions src/main/java/seedu/edulog/model/student/Student.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
// Data fields
private final seedu.edulog.model.student.Address address;
private final Set<Tag> tags = new HashSet<>();
private boolean isPresent = false;
private boolean hasPaid = false;

/**
* Every field must be present and not null except isPresent.
Expand All @@ -36,7 +36,7 @@
this.email = email;
this.address = address;
this.tags.addAll(tags);
this.isPresent = false;
this.hasPaid = false;
}

public Name getName() {
Expand Down Expand Up @@ -68,22 +68,22 @@
*
* @return {@code true} if the student is present, {@code false} otherwise
*/
public boolean getIsPresent() {
return isPresent;
public boolean getHasPaid() {
return hasPaid;
}

/**
* Marks the student as present.
* Marks the student as paid.
*/
public void mark() {
isPresent = true;
hasPaid = true;
}

/**
* Marks the student as absent.
* Marks the student as unpaid.
*/
public void unmark() {
isPresent = false;
hasPaid = false;
}

/**
Expand Down Expand Up @@ -120,13 +120,13 @@
&& email.equals(otherStudent.email)
&& address.equals(otherStudent.address)
&& tags.equals(otherStudent.tags)
&& isPresent == otherStudent.isPresent;
&& hasPaid == otherStudent.hasPaid;
}

@Override
public int hashCode() {
// use this method for custom fields hashing instead of implementing your own
return Objects.hash(name, phone, email, address, tags, isPresent);
return Objects.hash(name, phone, email, address, tags, hasPaid);

Check warning on line 129 in src/main/java/seedu/edulog/model/student/Student.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/seedu/edulog/model/student/Student.java#L129

Added line #L129 was not covered by tests
}

@Override
Expand All @@ -137,7 +137,7 @@
.add("email", email)
.add("edulog", address)
.add("tags", tags)
.add("isPresent", isPresent)
.add("hasPaid", hasPaid)
.toString();
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/seedu/edulog/model/student/StudentTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void equals() {
public void toStringMethod() {
String expected = Student.class.getCanonicalName() + "{name=" + ALICE.getName() + ", phone=" + ALICE.getPhone()
+ ", email=" + ALICE.getEmail() + ", edulog=" + ALICE.getAddress() + ", tags=" + ALICE.getTags()
+ ", isPresent=" + ALICE.getIsPresent() + "}";
+ ", hasPaid=" + ALICE.getHasPaid() + "}";
assertEquals(expected, ALICE.toString());
}
}
14 changes: 7 additions & 7 deletions src/test/java/seedu/edulog/testutil/StudentBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ public class StudentBuilder {
public static final String DEFAULT_PHONE = "85355255";
public static final String DEFAULT_EMAIL = "[email protected]";
public static final String DEFAULT_ADDRESS = "123, Jurong West Ave 6, #08-111";
public static final boolean DEFAULT_PRESENT = false;
public static final boolean DEFAULT_PAID = false;

private Name name;
private Phone phone;
private Email email;
private Address address;
private Set<Tag> tags;
private boolean isPresent;
private boolean hasPaid;

/**
* Creates a {@code StudentBuilder} with the default details.
Expand All @@ -38,7 +38,7 @@ public StudentBuilder() {
email = new Email(DEFAULT_EMAIL);
address = new Address(DEFAULT_ADDRESS);
tags = new HashSet<>();
isPresent = DEFAULT_PRESENT;
hasPaid = DEFAULT_PAID;
}

/**
Expand All @@ -50,7 +50,7 @@ public StudentBuilder(Student studentToCopy) {
email = studentToCopy.getEmail();
address = studentToCopy.getAddress();
tags = new HashSet<>(studentToCopy.getTags());
isPresent = studentToCopy.getIsPresent();
hasPaid = studentToCopy.getHasPaid();
}

/**
Expand Down Expand Up @@ -94,10 +94,10 @@ public StudentBuilder withEmail(String email) {
}

/**
* Sets the {@code isPresent} of the {@code Student} that we are building.
* Sets the {@code hasPaid} of the {@code Student} that we are building.
*/
public StudentBuilder withIsPresent(boolean isPresent) {
this.isPresent = isPresent;
public StudentBuilder withhasPaid(boolean hasPaid) {
this.hasPaid = hasPaid;
return this;
}

Expand Down