Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Zhouyirui/tp into branch_UG
Browse files Browse the repository at this point in the history
# Conflicts:
#	docs/UserGuide.md
  • Loading branch information
Zhouyirui committed Oct 29, 2021
2 parents e8ebfa8 + 26bc374 commit dd7bf94
Show file tree
Hide file tree
Showing 17 changed files with 298 additions and 44 deletions.
12 changes: 6 additions & 6 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,11 @@ Execution of the `AddClassCommand`
* Alternative 1 (current choice): Find Tutorial Classes by selecting all classes with classcodes matching the search keyword
* Pros: Shorter keyword to type, therefore increasing user typing speed. User is also able to find multiple classes
* Cons: Lower Accuracy in searching for a specific class, having to search through multiple classes

* Alternative 2: Find tutorial class by exact class code
* Pros: Higher Accuracy in search
* Cons: Takes longer for user to type commands, less user-friendly

#### Aspect: Student and Tutorial Class lists
* Alternative 1 (current choice): Use two separate lists to store students and tutorial classes
* Pros: Faster, simpler command executions for student and tutorial class commands.
Expand Down Expand Up @@ -439,7 +439,7 @@ The class `Classmate` facilitates all operations related to tutorial groups. It
tutorial group list to be displayed to the user. TutorialGroups are identical only if all its attributes, Group name, Class code and Group type are the same.
The `Classmate` contains a summary of all the logic of the tutorial group commands which can be split into two parts,
adding tutorial groups to tutorial classes (e.g. `AddGroupCommand`) executed on the `UniqueTutorialGroupList`, and adding students to tutorial groups.
Displaying of groups in the UI has not been implemented yet.
Displaying of groups in the UI has not been implemented yet.

The following operations are implemented:
* `Classmate#hasTutorialGroup(TutorialGroup tutorialGroup)` - Checks if tutorial group is in ClassMATE
Expand Down Expand Up @@ -476,7 +476,7 @@ it checks whether the specified tutorial class exists before invoking the `model
* Pros: Simpler to implement, without the use of multiple lists to store tutorial groups of different types ("OP1" or "OP2").
Storing tutorial groups as arrays in JSON is less complicated.
* Cons: Searching or filtering the list of tutorial groups by group types may take a longer time.

* Alternative 2: Use multiple lists to store groups of different categories (by class or type)
* Pros: Faster when performing find functions and groups are better organised.
* Cons: Splitting groups based on a category makes it harder to extend to support filtering groups with a different category from what is implemented. Deleting of groups may also become more complicated.
Expand Down Expand Up @@ -519,9 +519,9 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
| `* * *` | user | add a new student | |
| `* * *` | user | view a student's details | easily check the details and progress of the students |
| `* * *` | user | add a new class | |
| `* * ` | user | add a class schedule | plan my week in advance
| `* * ` | user | add a class schedule | plan my week in advance |
| `* * *` | user | view a class' details | easily check the details of a particular class |
| `* * *` | user | delete a student | remove entries that I no longer need
| `* * *` | user | delete a student | remove entries that I no longer need |
| `* * *` | user | delete a class | remove classes that I no longer need |
| `* * *` | user | find a student by name | locate details of students without having to go through the entire list |
| `* * *` | user | find a class by code | locate details of a class without having to go through the entire list |
Expand Down
101 changes: 81 additions & 20 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ title: User Guide
---

ClassMATE is a **desktop app designed for CS2101 tutors to manage student contacts and organize them into their tutorial classes and groups, as well as
other administrative matters including recording of students' class participation. It is optimized for use via a Command Line Interface** (CLI) while
other administrative matters including recording of students' class participation. It is optimized for use via a Command Line Interface** (CLI) while
still having the benefits of a Graphical User Interface (GUI). If you can type fast, ClassMATE can get your contact management tasks done faster than traditional GUI apps.

This guide will get you started on how to create students, classes and groups,
assigning students to their respective classes and groups and covers other functionalities for users
This guide will get you started on how to create students, classes and groups,
assigning students to their respective classes and groups and covers other functionalities for users
such as filtering and searching students. Finally, it will also guide
you through on how you can add class participation marks for your students.

Expand Down Expand Up @@ -44,24 +44,42 @@ We hope you find this User Guide helpful in using ClassMATE!
1. Ensure you have Java `11` or above installed in your Computer. (Go to [this website](https://codejava.net/java-se/download-and-install-java-11-openjdk-and-oracle-jdk) and follow the instructions to download and install Oracle JDK 11, which is _basically_ Java 11.)
1. Download the latest `classmate.jar` from [here](https://github.com/AY2122S1-CS2103T-W15-1/tp/releases).
1. Copy the file to the folder you want to use as the _home folder_ for your ClassMATE.
1. Double-click the file to start the app. The GUI similar to the below should appear in a few seconds. Note how the app contains some sample data.<br>
1. Double-click the file to start the app. The GUI similar to the image below should appear in a few seconds. Note how the app contains some sample data.<br>
![Ui](images/Ui-annotated.png)
1. Type the command in the **Command-Line Input** and press Enter to execute it. e.g. typing **`help`** and pressing Enter will open the help window.<br>
Some example commands you can try:
* **`liststu`** : Lists all students.

* **`addstu n/John Doe p/98765432 e/[email protected] a/John street, block 123, #01-01 c/G06`**: Adds a student named `John Doe` to ClassMATE.

* **`deletestu 3`**: Deletes the 3rd student shown in the current list.

* **`clear`** : Deletes all students.

* **`exit`** : Exits the app.
1. Refer to the [Features](#features) below for details of each command.
1. Refer to the [Features](#Features) below for details of each command.

--------------------------------------------------------------------------------------------------------------------

## Features
## CLI Tutorial

In this section, you will familiarize yourself with the use of CLI to facilitate your experience when using ClassMATE.
All commands would be typed in the **Command-Line Input** located at the top of the user interface as shown in the image below.

![Command Line Input](images/CommandLineInput.png)

Once you have familiarised yourself with the layout of the application, try out some example commands!

Some example commands you can try:
* **`liststu`** : Lists all students. All students currently stored in ClassMATE will be displayed in the **Student Panel**.

* **`addc c/G99 s/Tuesday 2 to 4pm, Friday 2 to 4pm`**: Adds a tutorial class with the code `G99`. The **Tutorial Class Panel**
should reflect the updated list of tutorial classes including your new class, `G99`.

* **`addstu n/John Doe p/98765432 e/[email protected] a/John street, block 123, #01-01 c/G99`**: Adds a student named `John Doe` to ClassMATE.
The **Student Panel** Should reflect the updated list of students including your new student, `John Doe`.

* **`deletestu 3`**: Deletes the 3rd student shown in the current list.

* **`clear`** : Deletes all students.

* **`exit`** : Exits the app.

Once you have attempted these commands, you're ready to go!

### Command format

This section will help you understand the syntax used to describe the command features in this guide better.

<div markdown="block" class="alert alert-info">
**:information_source: Notes about the command format:**<br>
Expand All @@ -86,16 +104,27 @@ We hope you find this User Guide helpful in using ClassMATE!

</div>

### Viewing help : `help`
## Features

Shows a message explaning how to access the help page.
Here, you can find instructions on how to use ClassMATE's various features. The features are divided into three main subsections,
each covering different subsections, namely the Student features, Tutorial Class Features and Tutorial Group Features. Each
subsection will provide you with an overview of the section, followed by the individual commands' formats, instructions on how to use them,
examples of use and the expected outcome of executing these commands.

![help message](images/helpMessage.png)

Format: `help`

## Student Commands

This part of the guide covers all the features you can use to manage student information.These features include:
1. Add a new Student
1. Edit and existing Student
1. View a student's details
1. Delete a student
1. List all students
1. Find students by name
1. Add Class participation marks
1. Delete all students

### Adding a student: `addstu`

Adds a student to ClassMATE.
Expand Down Expand Up @@ -251,18 +280,28 @@ Examples:

Deletes a class from ClassMATE

![Deletec](images/DeleteCommandScreenshot.png)
Format: `deletec INDEX`

* Deletes the class at the specified INDEX.
* The index refers to the index number shown in the displayed list of classes.
The index **must be a positive integer** 1, 2, 3, …​
* Students assinged to that class will have thier clascode replaced by `No Class`. They can be edited
to be added to another class.

Examples:
* `listc` followed by `deletec 2` deletes the 2nd class in the list of classes.
* `findc G06` followed by `deletec 1` deletes the 1st class in the results of the `findc` command.

## Tutorial Group Commands

This part of the guide covers all the features you can use to manage Groups within a tutorial class. These features include:
1. Add a group
1. View all groups in a class
1. Delete a group
1. Add a student to a group
1. Remove a student from a group

### Adding a group: `addcg`

Adds a group to a particular tutorial class
Expand Down Expand Up @@ -308,7 +347,11 @@ Format: `deletecg INDEX`
Examples:
* `listg n/G06` followed by `deleteg 2` deletes the 2nd group in the list of group in class G06

<<<<<<< HEAD
### Adding Student to a group: `addsg`
=======
### Adding Student to a group: `addsg` [Coming Soon]
>>>>>>> 26bc37482e0c6a7ebb59d6753eae335409cadb55
Adds student to a group.

Expand All @@ -334,6 +377,15 @@ Example:
* `liststu c/G06`shows that Betsy is a student in class G06 with Index 1.
`deletesg 1 g/A c/G06 type/OP1` then removes Betsy from OP1 Group A in class G06

## Additional Commands

### Viewing help : `help`

Shows a message explaning how to access the help page.

![help message](images/helpMessage.png)

Format: `help`

### Exiting the program : `exit`

Expand Down Expand Up @@ -378,8 +430,13 @@ Action | Format, Examples
**View class** | `viewc INDEX`<br> e.g., `listc` followed by `viewc 3`
**List all classes** | `listc`
**Find class** | `findc KEYWORD [MORE_KEYWORDS]`<br> e.g., `findc A02`
<<<<<<< HEAD
**Add Tutorial Group** | `addcg gn/GROUP_NAME c/CLASS_CODE type/TYPE` <br> e.g.,`addcg gn/1 c/G11 type/OP1`
**Delete Tutorial Group** | `deletecg INDEX` <br> e.g., `deletecg 2`
=======
**Add Tutorial Group** | `addcg gn/GROUP_NAME c/CLASS_CODE type/TYPE` <br> e.g.,`addsg n/Betsy tp/OP1 g/A`
**Delete Tutorial Group** | `deletecg INDEX` <br> e.g., `deletecg 2`
>>>>>>> 26bc37482e0c6a7ebb59d6753eae335409cadb55
**List Tutorial Group** | `listg`
**Add Student to Group** | `addsg INDEX g/GROUP_NAME c/CLASSCODE type/TYPE` <br> e.g., `addsg 1 gn/Group 1 c/G01 type/OP1`
**Delete Student from Group** | `deletesg INDEX g/GROUP_NAME c/CLASSCODE type/TYPE` <br> e.g., `deletesg 1 gn/Group 1 c/G01 type/OP1`
Expand All @@ -390,3 +447,7 @@ Action | Format, Examples

**Java 11** | Java is a programming language, more on it [here](https://en.wikipedia.org/wiki/Java_(programming_language)).
**JSON** | a JSON file is an open standard file format, more on it [here](https://en.wikipedia.org/wiki/JSON).
**CLI** | Command Line Interface (CLI) enables users to interact with a program by typing in text commands following
visual prompts from the program.
**GUI** | Graphical User Interface (GUI) is a system of interactive visual components that allows users to interact with
a program through graphical icons.
Binary file added docs/images/CommandLineInput.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/DeleteCommandScreenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions src/main/java/seedu/address/commons/core/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ public class Messages {
public static final String MESSAGE_INVALID_COMMAND_FORMAT = "Invalid command format! \n%1$s";
public static final String MESSAGE_INVALID_STUDENT_DISPLAYED_INDEX = "The student index provided is invalid";
public static final String MESSAGE_INVALID_CLASS_DISPLAYED_INDEX = "The class index provided is invalid";
public static final String MESSAGE_INVALID_GROUP_DISPLAYED_INDEX = "The group index provided is invalid";
public static final String MESSAGE_STUDENTS_LISTED_OVERVIEW = "%1$d students listed!";
public static final String MESSAGE_TUTORIAL_CLASSES_LISTED_OVERVIEW = "%1$d classes listed!";

public static final String MESSAGE_TUTORIAL_CLASSES_LISTED_OVERVIEW = "%1$d tutorial classes listed!";
public static final String MESSAGE_TUTORIAL_GROUP_LISTED_OVERVIEW = "%1$d students from tutorial group listed!";
public static final String MESSAGE_CLASS_DOES_NOT_EXIST = "This class does not exist in Classmate";
public static final String MESSAGE_GROUP_DOES_NOT_EXIST = "This group does not exist in Classmate";
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package seedu.address.logic.commands;

import static java.util.Objects.requireNonNull;
import static seedu.address.commons.core.Messages.MESSAGE_CLASS_DOES_NOT_EXIST;
import static seedu.address.logic.parser.CliSyntax.PREFIX_CLASSCODE;
import static seedu.address.logic.parser.CliSyntax.PREFIX_GROUPNUMBER;
import static seedu.address.logic.parser.CliSyntax.PREFIX_TYPE;
Expand All @@ -15,17 +16,16 @@ public class AddGroupCommand extends Command {

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a group to a class to Classmate. "
+ "Parameters: "
+ PREFIX_GROUPNUMBER + "GROUPNAME "
+ PREFIX_CLASSCODE + "CLASSCODE "
+ PREFIX_TYPE + "TYPE "
+ PREFIX_GROUPNUMBER + "GROUPNUMBER "
+ "Example: " + COMMAND_WORD + " "
+ PREFIX_GROUPNUMBER + "1 "
+ PREFIX_CLASSCODE + "G06 "
+ PREFIX_TYPE + "OP1 ";

public static final String MESSAGE_SUCCESS = "New group added: %1$s";
public static final String MESSAGE_DUPLICATE_GROUP = "This group already exists in Classmate";
public static final String MESSAGE_CLASS_NOT_EXIST = "The class does not exist in Classmate";

private final TutorialGroup toAdd;
private final TutorialClass toAddTutorialClass;
Expand All @@ -46,7 +46,7 @@ public CommandResult execute(Model model) throws CommandException {

// check if tutorial class already exists in ClassMATE
if (!model.hasTutorialClass(toAddTutorialClass)) {
throw new CommandException(MESSAGE_CLASS_NOT_EXIST);
throw new CommandException(MESSAGE_CLASS_DOES_NOT_EXIST);
}

if (model.hasTutorialGroup(toAdd)) {
Expand Down
71 changes: 71 additions & 0 deletions src/main/java/seedu/address/logic/commands/ViewGroupCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package seedu.address.logic.commands;

import static java.util.Objects.requireNonNull;
import static seedu.address.logic.parser.CliSyntax.PREFIX_CLASSCODE;
import static seedu.address.logic.parser.CliSyntax.PREFIX_GROUPNUMBER;
import static seedu.address.logic.parser.CliSyntax.PREFIX_TYPE;

import seedu.address.commons.core.Messages;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.model.Model;
import seedu.address.model.student.GroupMemberPredicate;
import seedu.address.model.tutorialclass.TutorialClass;
import seedu.address.model.tutorialgroup.TutorialGroup;

/**
* Lists all students in a tutorial group in ClassMATE given a class code, tutorial group type and tutorial group name
* Keyword matching is case-insensitive.
*/
public class ViewGroupCommand extends Command {

public static final String COMMAND_WORD = "viewg";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Finds all students in a tutorial group given a class "
+ "code, tutorial group type and tutorial group name (case-insensitive) and displays them as a list"
+ "with index numbers.\n"
+ "Parameters: "
+ PREFIX_CLASSCODE + "CLASSCODE "
+ PREFIX_TYPE + "TYPE "
+ PREFIX_GROUPNUMBER + "GROUPNUMBER "
+ "Example: " + COMMAND_WORD + " "
+ PREFIX_GROUPNUMBER + "3 "
+ PREFIX_CLASSCODE + "G06 "
+ PREFIX_TYPE + "OP2 ";

private final TutorialGroup toView;
private final TutorialClass toViewTutorialClass;

/**
* Creates a ViewGroupCommand to show the students in the specified {@code TutorialGroup}
*/
public ViewGroupCommand(TutorialGroup tutorialGroup) {
requireNonNull(tutorialGroup);
toView = tutorialGroup;
// new class with the same class code created to check whether it exists in ClassMATE
toViewTutorialClass = TutorialClass.createTestTutorialClass(toView.getClassCode());
}

@Override
public CommandResult execute(Model model) throws CommandException {
requireNonNull(model);

// check if tutorial class exists in ClassMATE
if (!model.hasTutorialClass(toViewTutorialClass)) {
throw new CommandException(Messages.MESSAGE_CLASS_DOES_NOT_EXIST);
}



model.updateFilteredStudentList(new GroupMemberPredicate(toView));
return new CommandResult(
String.format(Messages.MESSAGE_TUTORIAL_GROUP_LISTED_OVERVIEW,
model.getFilteredStudentList().size()));
}

@Override
public boolean equals(Object other) {
return other == this // short circuit if same object
|| (other instanceof ViewGroupCommand // instanceof handles nulls
&& toView.equals(((ViewGroupCommand) other).toView)); // state check
}
}
4 changes: 4 additions & 0 deletions src/main/java/seedu/address/logic/parser/ClassmateParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import seedu.address.logic.commands.ListClassCommand;
import seedu.address.logic.commands.ListStudentCommand;
import seedu.address.logic.commands.ViewClassCommand;
import seedu.address.logic.commands.ViewGroupCommand;
import seedu.address.logic.commands.ViewStudentCommand;
import seedu.address.logic.parser.exceptions.ParseException;

Expand Down Expand Up @@ -97,6 +98,9 @@ public Command parseCommand(String userInput) throws ParseException {
case ViewClassCommand.COMMAND_WORD:
return new ViewClassCommandParser().parse(arguments);

case ViewGroupCommand.COMMAND_WORD:
return new ViewGroupCommandParser().parse(arguments);

case ViewStudentCommand.COMMAND_WORD:
return new ViewStudentCommandParser().parse(arguments);

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/logic/parser/CliSyntax.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
public class CliSyntax {

/* Student Prefix definitions */
// Student Prefix definitions
public static final Prefix PREFIX_NAME = new Prefix("n/");
public static final Prefix PREFIX_PHONE = new Prefix("p/");
public static final Prefix PREFIX_EMAIL = new Prefix("e/");
Expand Down
Loading

0 comments on commit dd7bf94

Please sign in to comment.