Skip to content

Commit

Permalink
Merge branch 'master' into update-user-guide
Browse files Browse the repository at this point in the history
  • Loading branch information
Yufannnn committed Mar 30, 2023
2 parents 40781af + b58876a commit 891f03e
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 15 deletions.
54 changes: 40 additions & 14 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,31 +257,55 @@ Examples:

:exclamation: **Caution:** STUDENT_NAME, HOMEWORK_INDEX , and DEADLINE should all only appear at most once and should not be empty.

### Create a New Lesson Plan for the Upcoming Lesson
### Create a New Lesson for a Student

Creates a new lesson for a given student, with a lesson title and time.
Creates a new lesson for a given student, with a lesson title, start time, and end time.

Format: `new-lesson [name/STUDENT_NAME] [lesson/LESSON_TITLE] [start/START_TIME] [end/END_TIME]`
Format: `new-lesson [name/STUDENT_NAME_1] (optional)[name/STUDENT_NAME_2] [lesson/LESSON_TITLE] [start/START_TIME] [end/END_TIME]`

* All fields are mandatory.
* All fields, except for additional studetn names, are mandatory.

Examples:
`new-lesson name/John Doe lesson/The Water Cycle start/25-03-23-1300 end/25-03-23-1500`
`new-lesson name/John Doe lesson/The Water Cycle start/25-03-23-1300 end/25-03-23-1500` creates a new lesson for the student named `John Doe` with the lesson title `The Water Cycle` starting at `25 Mar 2023 13:00` and ending at `25 Mar 2023 15:00`.


### View Lessons History
### View Lessons

Displays the lesson history for a given student/all students.
Displays the lessons for a given student/all students, filtered by subject and/or student name and/or date and/or whether the lesson has been completed

Format: `view-lesson [name/STUDENT_NAME]`
Format: `view-lesson (optional)[name/STUDENT_NAME] (optional)[subject/SUBJECT] (optional)[date/DATE] (optional)[done/DONE]`

* Displays the lesson history for all the tutor’s students if no student name is specified.
* Displays the lesson history for a specific student if a student's name is specified with the `name/` prefix.
* The `STUDENT_NAME` must be an existing student of the tutor.

Examples:
* `view-lesson` Displays the lesson history for all the tutor’s students.
* `view-lesson name/John` Displays the lesson history for the student named John. If two students have the same name, then ask which one to show.
* `view-lesson name/John subject/Math date/2023-05-03` Displays the lessons for student John, which are of subject Math, on the day 2023-05-03.
* `view-lesson done/done` Displays all lessons that have been completed

### Remove a Lesson
Deletes a lesson for a given student.

Format: `delete-lesson [name/STUDENT_NAME] [index/LESSON_INDEX]`

* The `STUDENT_NAME` must be an existing student of the tutor. Note that there can only be one student's name.
* Deletes the lesson at the specified `LESSON_INDEX`.

Example:
* `delete-lesson name/John Doe index/1` deletes the first lesson for the student named John Doe.

### Update a Lesson
Updates a lesson for a given student. This includes the lesson title, start time, and end time.

Format: `update-lesson (optional)[name/STUDENT_NAME] (optional)[lesson/LESSON_TITLE] (optional)[start/START_TIME] (optional)[end/END_TIME]`

* The `STUDENT_NAME` must be an existing student of the tutor. Note that there can only be one student's name.
* Updates the specified Lesson with the new information (lesson name and/or start time and/or end time).
* At least one of the fields must be specified.

Example:
* `update-lesson name/John Doe lesson/The Water Cycle start/25-03-23-1300 end/25-03-23-1500` updates the lesson for John Doe with the new information.

### Add an Exam to be tracked: `add-exam`

Expand All @@ -299,8 +323,8 @@ Format: `new-exam [name/STUDENT_NAME_1] (optional)[name/STUDENT_NAME_2].. [exam/
See `calculate-grade` below:

Examples:
* `new-exam name/John Doe exam/Math MYE start/2023-05-21 12:00 end/2023-05-21 14:00`
* `new-exam name/John Doe name/Faye Doe exam/Science MYE start/2023-05-22 12:00 end/2023-05-22 14:00`
* `new-exam name/John Doe exam/Math MYE start/2023-05-21 12:00 end/2023-05-21 14:00` creates an exam named `Math MYE` for the student named John Doe, which starts at 12:00 on 21 May 2023 and ends at 14:00 on 21 May 2023.
* `new-exam name/John Doe name/Faye Doe exam/Science MYE start/2023-05-22 12:00 end/2023-05-22 14:00` creates an exam named `Science MYE` for the students named John Doe and Faye Doe, which starts at 12:00 on 22 May 2023 and ends at 14:00 on 22 May 2023.

### Remove an exam: `delete-exam`

Expand All @@ -312,8 +336,8 @@ Format: `delete-exam [name/STUDENT_NAME_1] (optional)[name/STUDENT_NAME_2].. [in
student.

Examples:
* `delete-exam name/John Doe index/1`
* `delete-exam name/John Doe name/Faye Doe index/1`
* `delete-exam name/John Doe index/1` deletes the first exam for the student named John Doe.
* `delete-exam name/John Doe name/Faye Doe index/1` deletes the first exam for the students named John Doe and Faye Doe.

### View exams tracked by TutorPro: `view-exam`

Expand Down Expand Up @@ -342,7 +366,9 @@ Format: `update-exam [name/STUDENT_NAME] [index/INDEX] (optional)[exam/NEW_EXAM_
student.

Examples:
* `update-exam name/John index/1 grade/20/25`
* `update-exam name/John index/1 grade/20/25` updates the grade of the first exam for the student named John Doe to 20/25.
* `update-exam name/John index/1 exam/Science MYE` updates the name of the first exam for the student named John Doe to Science MYE.
* `update-exam name/John index/1 start/2023-05-21 12:00 end/2023-05-21 14:00` updates the start and end time of the first exam for the student named John Doe to 12:00 on 21 May 2023 and ends at 14:00 on 21 May 2023.

### Calculate grade: `calculate-grade`

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/seedu/address/commons/core/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public class Messages {
public static final String MESSAGE_INVALID_EXAM_TIME = "Exam start time cannot be after exam end time";
public static final String MESSAGE_INVALID_EXAM_DURATION =
"The exam duration is too short(< 30 min)/long(> 3 hours)";
public static final String MESSAGE_INVALID_DONE_INPUT = "Invalid input for done/ field. Accepted inputs:"
+ "done, not done";
public static final String MESSAGE_DEADLINE_IN_PAST = "Deadline cannot be in the past!";
public static final String MESSAGE_ONLY_ONE_STUDENT = "Only one student name is allowed!";
public static final String MESSAGE_EMPTY_STUDENT = "Student name cannot be empty!";
Expand All @@ -68,5 +70,4 @@ public class Messages {
public static final String MESSAGE_EMPTY_DEADLINE = "Deadline cannot be empty!";
public static final Object MESSAGE_ONLY_ONE_STATUS = "Only one status is allowed!";
public static final Object MESSAGE_EMPTY_STATUS = "Status cannot be empty!";

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.util.List;
import java.util.function.Predicate;

import seedu.address.commons.core.Messages;
import seedu.address.logic.commands.exam.ViewExamCommand;
import seedu.address.logic.parser.ArgumentMultimap;
import seedu.address.logic.parser.ArgumentTokenizer;
Expand Down Expand Up @@ -86,6 +87,9 @@ public ViewExamCommand parse(String args) throws ParseException {

if (argMultimap.getValue(PREFIX_DONE).isPresent()) {
String done = argMultimap.getValue(PREFIX_DONE).get();
if (!done.equals("done") && !done.equals("not done")) {
throw new ParseException(Messages.MESSAGE_INVALID_DONE_INPUT);
}
donePredicate = new ExamDonePredicate(done);
}

Expand Down

0 comments on commit 891f03e

Please sign in to comment.