Skip to content

Commit 3b7abdd

Browse files
authored
Merge pull request #218 from yeekian/branch-UserGuide
Modify user guide according to issues from dry pe run
2 parents 8ddc31c + 6088914 commit 3b7abdd

File tree

7 files changed

+63
-20
lines changed

7 files changed

+63
-20
lines changed

docs/UserGuide.md

Lines changed: 48 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,27 @@
44

55
**TutorLink** is a streamlined, offline application developed for professors at NUS who manage single-staffed classes. It is designed to simplify the management of class assignments, and other administrative tasks, allowing professors to focus on teaching and curriculum development. By automating repetitive tasks and providing quick access to essential information, TutorLink saves valuable time and reduces the burden of administrative work.
66

7+
## Table of Contents
8+
9+
- [Quick Start](#quick-start)
10+
- [Important Notes on Commands](#important-notes-on-commands)
11+
- [Features](#Features)
12+
- [Viewing help: `help`](#Viewing-help-help)
13+
- [Adding a Student: `add_student`](#adding-a-student-add_student)
14+
- [Deleting a Student: `delete_student`](#deleting-a-student-delete_student)
15+
- [Listing All Students: `list_student`](#listing-all-students-list_student)
16+
- [Finding a Student: `find_student`](#finding-a-student-find_student)
17+
- [Adding a Component: `add_component`](#adding-a-component-add_component)
18+
- [Deleting a Component: `delete_component`](#deleting-a-component-delete_component)
19+
- [Listing Components: `list_component`](#listing-components-list_component)
20+
- [Adding a Grade of a Component for a Student: `add_grade`](#adding-a-grade-of-a-component-for-a-student-add_grade)
21+
- [Deleting a Grade of a Component for a Student: `delete_grade`](#deleting-a-grade-of-a-component-for-a-student-delete_grade)
22+
- [Listing Grades: `list_grade`](#listing-grades-list_grade)
23+
- [Exiting the Program: `bye`](#exiting-the-program-bye)
24+
- [Saving the Data](#saving-the-data)
25+
- [FAQ](#faq)
26+
- [Command Summary](#command-summary)
27+
728
## Quick Start
829

930
1. Ensure you have Java 17 or above installed in your Computer.
@@ -26,21 +47,30 @@ Rouge spaces in between the prefix *i.e* `i/ MATRIC_NUMBER` will invalidate the
2647
- Parameters can be supplied in any order. *i.e* `add_student n/John i/A1234567X` is the same as `add_student i/A1234567X n/John`
2748
- **IMPORTANT**: Descriptions should **NOT** contain any separator tokens: `|` as this character is used for storage).
2849
Including these may yield unpredictable results with the `Storage` component.
29-
- Matric Number (`i/` argument) is case insensitive. Therefore, `A1234567X` is the same as `a1234567x`. Matric numbers
30-
will be converted to uppercase for storage.
50+
- Matric Number (`i/` argument) is case-sensitive. Therefore, only `A1234567X` is the accepted and not `a1234567x`. Matric numbers
51+
will be remain in uppercase for storage.
3152
- Similarly, all other fields will be converted to lowercase for storage.
32-
## Features
53+
54+
## Features
3355

3456
<div style="page-break-after: always;"></div>
3557

58+
### Viewing help: `help`
59+
60+
Shows a message explaining different features of the app.
61+
62+
- **Format**: `help`
63+
64+
---
65+
3666
### Adding a Student: `add_student`
3767

3868
Adds a student to your class.
3969

4070
- **Format**: `add_student i/MATRIC_NUMBER n/STUDENT_NAME`
4171
- **Parameters**:
4272
- `STUDENT_NAME`: The full name of the student.
43-
- `MATRIC_NUMBER`: A unique identifier for the student.
73+
- `MATRIC_NUMBER`: The unique identifier of the student. It should start with "A", followed by 7 digits, and end with an uppercase letter (e.g., A1234567X)
4474

4575
- **Example**:
4676
- `add_student i/A1234567X n/John Doe ` adds a new student named John Doe with the matric number of A1234567X to the class.
@@ -52,7 +82,7 @@ Removes a student from the class. Note that a student can only be deleted using
5282

5383
- **Format**: `delete_student i/MATRIC_NUMBER`
5484
- **Parameters**:
55-
- `MATRIC_NUMBER`: The unique identifier of the student to be deleted.
85+
- `MATRIC_NUMBER`: The unique identifier of the student. It should start with "A", followed by 7 digits, and end with an uppercase letter (e.g., A1234567X)
5686

5787
- **Example**:
5888
- `delete_student i/A1234567X` deletes a student with the matric number of A1234567X.
@@ -79,14 +109,14 @@ Adds a student to your class.
79109
- **Format**: `find_student i/MATRIC_NUMBER n/STUDENT_NAME`
80110
- **Parameters**:
81111
- `STUDENT_NAME`: The full name of the student.
82-
- `MATRIC_NUMBER`: A unique identifier for the student.
112+
- `MATRIC_NUMBER`: The unique identifier of the student. It should start with "A", followed by 7 digits, and end with an uppercase letter (e.g., A1234567X)
83113

84114
- **Example**:
85115
- `find_student i/A1234567X n/John Doe ` find the student named John Doe with the matric number of A1234567X among the list of students and prints out the student information.
86116
#### Note:
87117
`find_student` accepts the following combination of parameters:
88-
- `find_student i/matric_number`: Query by matric number
89-
- `find_student n/name`: Query by name
118+
- `find_student i/MATRIC_NUMBER`: Query by matric number
119+
- `find_student n/STUDENT_NAME`: Query by name
90120

91121
If both `matric number` and `name` are supplied together: *i.e* `find_student i/matric_number n/name`, **`name` is ignored**
92122

@@ -97,7 +127,7 @@ Adds a new grading component to the class (e.g., "Homework," "Midterm," "Final E
97127

98128
- **Format**: `add_component c/COMPONENT w/WEIGHT m/MAX_SCORE`
99129
- **Parameters**:
100-
- `COMPONENT`: The name of the grading component. Note that component name is insensitive, *i.e* `Test` is the same as `test`.
130+
- `COMPONENT`: The name of the grading component to add. Note that when adding, the component name is case-sensitive, *i.e* `Quiz` is different from `quiz`.
101131
Moreover, whitespace after the component string is trimmed.
102132
- `WEIGHT`: The weight of the component as a percentage, input as an integer from 0 - 100 (inclusive).
103133
- `MAX_SCORE`: The max_score of the component. **Must be a `double` between 0 and 10,000 (inclusive).**
@@ -114,8 +144,8 @@ Removes an existing grading component from the class.
114144

115145
- **Format**: `delete_component c/COMPONENT`
116146
- **Parameters**:
117-
- `COMPONENT`: The name of the grading component to delete.
118-
147+
- `COMPONENT`: The name of the grading component to delete. Note that component name is case-insensitive, *i.e* `Test` is the same as `test`.
148+
Moreover, whitespace after the component string is trimmed.
119149
- **Example**:
120150
- `delete_component c/Quiz 1` deletes Quiz 1 component from the list of components that form the final grade.
121151

@@ -139,8 +169,9 @@ Displays all grading components and their respective weights for a class.
139169
Records a grade for a specific student in a particular assignment or exam component.
140170
- **Format**: `add_grade i/MATRIC_NUMBER c/COMPONENT s/SCORE`
141171
- **Parameters**:
142-
- `MATRIC_NUMBER`: The unique identifier of the student.
143-
- `COMPONENT`: The assignment or exam component.
172+
- `MATRIC_NUMBER`: The unique identifier of the student. It should start with "A", followed by 7 digits, and end with an uppercase letter (e.g., A1234567X)
173+
- `COMPONENT`: The name of the grading component. Note that component name is case-insensitive, *i.e* `Test` is the same as `test`.
174+
Moreover, whitespace after the component string is trimmed.
144175
- `SCORE`: The score to be recorded. Note that score cannot exceed the max score of the component.
145176

146177
- **Example**:
@@ -156,9 +187,9 @@ Removes a previously recorded grade for a specific student and component.
156187

157188
- **Format**: `delete_grade i/MATRIC_NUMBER c/COMPONENT`
158189
- **Parameters**:
159-
- `MATRIC_NUMBER`: The unique identifier of the student.
160-
- `COMPONENT`: The assignment or exam component.
161-
190+
- `MATRIC_NUMBER`: The unique identifier of the student. It should start with "A", followed by 7 digits, and end with an uppercase letter (e.g., A1234567X)
191+
- `COMPONENT`: The name of the grading component. Note that component name is case-insensitive, *i.e* `Test` is the same as `test`.
192+
Moreover, whitespace after the component string is trimmed.
162193
- **Example**:
163194
- `delete_grade i/A1234567X c/Quiz 1` deletes the grade of Quiz 1 for the student with the matric number of A1234567X.
164195

@@ -174,7 +205,7 @@ Views all recorded grades for a specific student or all students, and final perc
174205
- Lists all recorded grades and the final percentage for the specified student.
175206
- **Format**: `list_grade i/MATRIC_NUMBER`
176207
- **Parameters**:
177-
- `MATRIC_NUMBER`: The unique identifier of the student.
208+
- `MATRIC_NUMBER`: The unique identifier of the student. It should start with "A", followed by 7 digits, and end with an uppercase letter (e.g., A1234567X)
178209
- **Example**:
179210
- `list_grade i/A1234567X`
180211

docs/diagrams/Architecture.png

2.49 KB
Loading

docs/diagrams/Architecture.puml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,7 @@ Command ..> AppState
2929
TutorLink -down-> Storage
3030
Parser.>CommandResult
3131

32+
file "Data Files" as DataFiles #lightgreen
33+
DataFiles <.right. Storage
34+
3235
@enduml

src/main/java/tutorlink/command/AddStudentCommand.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ public CommandResult execute(AppState appState, HashMap<String, String> hashmap)
2222
if (matricNumber == null || name == null) {
2323
throw new IllegalValueException(Commons.ERROR_NULL);
2424
}
25-
matricNumber = matricNumber.toUpperCase();
2625
Pattern pattern = Pattern.compile(Commons.MATRIC_NUMBER_REGEX);
2726
Matcher matcher = pattern.matcher(matricNumber);
2827
if (!matcher.find()) {

src/main/java/tutorlink/command/DeleteStudentCommand.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public CommandResult execute(AppState appState, HashMap<String, String> hashmap)
2121
if (matricNumber == null) {
2222
throw new IllegalValueException(Commons.ERROR_NULL);
2323
}
24-
matricNumber = matricNumber.toUpperCase();
2524
Pattern pattern = Pattern.compile(Commons.MATRIC_NUMBER_REGEX);
2625
Matcher matcher = pattern.matcher(matricNumber);
2726
if (!matcher.find()) {

src/main/java/tutorlink/lists/StudentList.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
package tutorlink.lists;
22

3+
import tutorlink.commons.Commons;
34
import tutorlink.exceptions.DuplicateMatricNumberException;
5+
import tutorlink.exceptions.IllegalValueException;
46
import tutorlink.exceptions.StudentNotFoundException;
57
import tutorlink.exceptions.TutorLinkException;
68
import tutorlink.student.Student;
79

810
import java.util.ArrayList;
11+
import java.util.regex.Matcher;
12+
import java.util.regex.Pattern;
913
import java.util.stream.Collectors;
1014
import java.util.stream.IntStream;
1115

@@ -65,6 +69,13 @@ public String toString() {
6569

6670
public StudentList findStudentByMatricNumber(String matricNumber) throws TutorLinkException {
6771
StudentList filteredList = new StudentList();
72+
73+
Pattern pattern = Pattern.compile(Commons.MATRIC_NUMBER_REGEX);
74+
Matcher matcher = pattern.matcher(matricNumber);
75+
if (!matcher.find()) {
76+
throw new IllegalValueException(Commons.ERROR_ILLEGAL_MATRIC_NUMBER);
77+
}
78+
6879
filteredList.studentArrayList = studentArrayList
6980
.stream()
7081
.filter(student -> student.getMatricNumber().equals(matricNumber.toUpperCase()))

text-ui-test/EXPECTED.TXT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Student Ethan Chua (A0276007H) added successfully!
1717
Student John Doe (A9999999Z) added successfully!
1818
-------------------------------------------------------------
1919
------------------------- Error -------------------------
20-
Error! Student with Matric Number, A1111111B, already exists in the list!
20+
Error! Matric Number should start with "A", followed by 7 digits, and end with an uppercase letter (e.g., A1234567X)
2121
-------------------------------------------------------------
2222
------------------------- Result -------------------------
2323
1: John Smith (matric no: A1111111B, percentage score: 80.00)

0 commit comments

Comments
 (0)