Skip to content

Commit d345c96

Browse files
authored
Merge branch 'master' into branch-add-DG
2 parents 970a537 + e116eba commit d345c96

11 files changed

+210
-114
lines changed

docs/DeveloperGuide.md

Lines changed: 44 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -218,17 +218,56 @@ The following **UML activity diagram** shows what happens when a user executes a
218218
<img src="images/AddLabCommandActivityDiagram.png" width="600" />
219219

220220

221-
### Filter Feature
221+
### `filter`: Filter Students by Labs Feature
222222

223-
#### Proposed Implementation
223+
The `filter` feature allows user to filter the list of students by their `Lab` and its `LabStatus`.
224224

225-
The Filter feature is implemented by updating the `listOfStudents` using `StudentHasLabPredicate` which extends
226-
`Predicate`. `StudentHasLabPredicate` contains the attribute `Lab` and overrides the `Predicate#test()` method to
225+
The Filter feature is implemented by updating `fitleredStudents` using `StudentHasLabPredicate` which extends
226+
`Predicate<Student>`. `StudentHasLabPredicate` contains the attribute `Lab` and overrides the `Predicate#test()` method to
227227
determine if a `Student` has a specific `Lab` in its `LabList`.
228228

229+
The command format for filter is `fitler l/LAB_NUMBER s/LAB_STATUS` where `LAB_NUMBER` should a `Lab` that exists within
230+
TAddressBook and `LAB_STATUS` should be one of the three values below:
231+
- `u` : UNSUBMITTED
232+
- `s` : SUBMITTED
233+
- `g` : GRADED
234+
229235
Given below is an example usage scenario and how the filter mechanism behaves at each step.
236+
1. When the user executes `filter` command, `FilterCommandParser#parse(String)` will be invoked to parse the given command
237+
and create a `StudentHasLabPredicate` with a dummy `Lab` with the given `LabStatus`. Then, a new `FilterCommand` is
238+
instantiated using the `StudentHasLabPredicate`.
239+
240+
241+
2. `FilterCommand#execute(Model)` will then execute the command on the current `Model` of the system.
242+
243+
244+
3. The `FilterCommand` object will check if the `Model` object contains the `Lab` carried by the `StudentHasLabPredicate`.
245+
If the `Lab` is not found, a `CommandException` will be thrown.
246+
247+
248+
4. The `StudentHasLabPredicate` is passed as a parameter into the `Model#addOnFilteredStudentList(Predicate)` method.
249+
250+
251+
5. `Model` object retrieves its original `Predicate<Student>` to perform `Predicate#and(Predicate)` with the
252+
`StudentHasLabPredicate` passed in. The new `Predicate<Student>` is used to filter the `filteredStudents` within
253+
the `Model` object.
254+
230255

231-
Step 1. The user executes `filter l/1 s/s` command.
256+
6. A `CommandResult` object is created with a feedback message and is returned.
257+
258+
The **UML sequence diagram** below shows the parsing of the user input using `FilterCommandParser` to create a
259+
`StudentHasLabPredicate` and subsequently a `FilterCommand` object.
260+
261+
<img src="images/FilterCommandParserSequenceDiagram.png" width="850" />
262+
263+
After the `FilterCommand` object is created, it is utilised to filter the student list.
264+
The following **UML sequence diagram** shows the interaction between the components during the execution of the `filter` command:
265+
266+
<img src="images/FilterCommandSequenceDiagram.png" width="850" />
267+
268+
The following **UML activity diagram** shows what happens when a `filter` command is executed:
269+
270+
<img src="images/FilterCommandActivityDiagram.png" width="850" />
232271

233272

234273
### `labedit`: Edit Lab Feature
@@ -303,57 +342,6 @@ Step 3. The user executes `add n/David …​` to add a new student. The `add` c
303342

304343
![UndoRedoState2](images/UndoRedoState2.png)
305344

306-
<div markdown="span" class="alert alert-info">:information_source: **Note:** If a command fails its execution, it will not call `Model#commitAddressBook()`, so the TAddressBook state will not be saved into the `addressBookStateList`.
307-
308-
</div>
309-
310-
Step 4. The user now decides that adding the student was a mistake, and decides to undo that action by executing the `undo` command. The `undo` command will call `Model#undoAddressBook()`, which will shift the `currentStatePointer` once to the left, pointing it to the previous TAddressBook state, and restores the TAddressBook to that state.
311-
312-
![UndoRedoState3](images/UndoRedoState3.png)
313-
314-
<div markdown="span" class="alert alert-info">:information_source: **Note:** If the `currentStatePointer` is at index 0, pointing to the initial TAddressBook state, then there are no previous TAddressBook states to restore. The `undo` command uses `Model#canUndoAddressBook()` to check if this is the case. If so, it will return an error to the user rather
315-
than attempting to perform the undo.
316-
317-
</div>
318-
319-
The following sequence diagram shows how the undo operation works:
320-
321-
![UndoSequenceDiagram](images/UndoSequenceDiagram.png)
322-
323-
<div markdown="span" class="alert alert-info">:information_source: **Note:** The lifeline for `UndoCommand` should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
324-
325-
</div>
326-
327-
The `redo` command does the opposite — it calls `Model#redoAddressBook()`, which shifts the `currentStatePointer` once to the right, pointing to the previously undone state, and restores the TAddressBook to that state.
328-
329-
<div markdown="span" class="alert alert-info">:information_source: **Note:** If the `currentStatePointer` is at index `addressBookStateList.size() - 1`, pointing to the latest TAddressBook state, then there are no undone TAddressBook states to restore. The `redo` command uses `Model#canRedoAddressBook()` to check if this is the case. If so, it will return an error to the user rather than attempting to perform the redo.
330-
331-
</div>
332-
333-
Step 5. The user then decides to execute the command `list`. Commands that do not modify the TAddressBook, such as `list`, will usually not call `Model#commitAddressBook()`, `Model#undoAddressBook()` or `Model#redoAddressBook()`. Thus, the `addressBookStateList` remains unchanged.
334-
335-
![UndoRedoState4](images/UndoRedoState4.png)
336-
337-
Step 6. The user executes `clear`, which calls `Model#commitAddressBook()`. Since the `currentStatePointer` is not pointing at the end of the `addressBookStateList`, all TAddressBook states after the `currentStatePointer` will be purged. Reason: It no longer makes sense to redo the `add n/David …​` command. This is the behavior that most modern desktop applications follow.
338-
339-
![UndoRedoState5](images/UndoRedoState5.png)
340-
341-
The following activity diagram summarizes what happens when a user executes a new command:
342-
343-
<img src="images/CommitActivityDiagram.png" width="250" />
344-
345-
#### Design considerations:
346-
347-
**Aspect: How undo & redo executes:**
348-
349-
* **Alternative 1 (current choice):** Saves the entire TAddressBook.
350-
* Pros: Easy to implement.
351-
* Cons: May have performance issues in terms of memory usage.
352-
353-
* **Alternative 2:** Individual command knows how to undo/redo by itself.
354-
* Pros: Will use less memory (e.g. for `delete`, just save the student being deleted).
355-
* Cons: We must ensure that the implementation of each individual command is correct.
356-
357345
--------------------------------------------------------------------------------------------------------------------
358346

359347
## **Documentation, logging, testing, configuration, dev-ops**

docs/UserGuide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ If you can type fast, TAddressBook can get your lab management tasks done faster
5353
- [Find students](#locating-students-by-name--find)
5454
- [Delete students](#deleting-a-student--delete)
5555
- [Clear students](#clearing-all-entries--clear)
56-
- [Filter students based on status of lab tags](#filter-by-status-of-individual-labs--filter)
56+
- [Filter students by labs](#filter-by-status-of-individual-labs--filter)
5757
- [View student details](#view-student-details--view)
5858

5959
- [Manage labs](#lab-related-features)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@startuml
2+
'https://plantuml.com/activity-diagram-beta
3+
4+
start
5+
:User executes filter command with LAB_NUMBER and LAB_STATUS;
6+
:Dummy Lab created with the same LAB_NUMBER and LAB_STATUS;
7+
if () then ([Lab exists in Model])
8+
:Create StudentHasLabPredicate using dummy Lab;
9+
:Add on filter to studentList with StudentHasLabPredicate;
10+
else ([else])
11+
:Displays error message;
12+
endif
13+
stop
14+
15+
@enduml
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
@startuml
2+
!include style.puml
3+
4+
box Logic LOGIC_COLOR_T1
5+
participant "p:FilterCommandParser" as FilterCommandParser LOGIC_COLOR
6+
participant "f:FitlerCommand" as FilterCommand LOGIC_COLOR
7+
end box
8+
9+
box Model MODEL_COLOR_T1
10+
participant "s:StudentHasLabPredicate" as StudentHasLabPredicate MODEL_COLOR
11+
end box
12+
13+
[-> FilterCommandParser : parse("l/1 s/s")
14+
activate FilterCommandParser
15+
16+
create StudentHasLabPredicate
17+
FilterCommandParser -> StudentHasLabPredicate : StudentHasLabPredicate(labToFilter)
18+
activate StudentHasLabPredicate
19+
StudentHasLabPredicate --> FilterCommandParser
20+
deactivate StudentHasLabPredicate
21+
22+
create FilterCommand
23+
FilterCommandParser -> FilterCommand : FilterCommand(s)
24+
activate FilterCommand
25+
FilterCommand --> FilterCommandParser
26+
deactivate FilterCommand
27+
28+
[<-- FilterCommandParser : f
29+
30+
@enduml

docs/diagrams/FilterCommandSequence.puml

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
@startuml
2+
!include style.puml
3+
4+
box Logic LOGIC_COLOR_T1
5+
participant "f:FilterCommand" as FilterCommand LOGIC_COLOR
6+
participant "c:CommandResult" as CommandResult LOGIC_COLOR
7+
end box
8+
9+
box Model MODEL_COLOR_T1
10+
participant "m:Model" as Model MODEL_COLOR
11+
12+
[-> FilterCommand : execute(m)
13+
activate FilterCommand
14+
15+
FilterCommand -> Model : hasLab(toFilter)
16+
activate Model
17+
Model --> FilterCommand
18+
deactivate Model
19+
20+
FilterCommand -> Model : addOnFilteredStudentList(predicate)
21+
activate Model
22+
Model --> FilterCommand
23+
deactivate Model
24+
25+
create CommandResult
26+
FilterCommand -> CommandResult
27+
activate CommandResult
28+
CommandResult --> FilterCommand
29+
deactivate CommandResult
30+
31+
[<-- FilterCommand : c
32+
33+
@enduml
22.9 KB
Loading
13.5 KB
Loading
12.7 KB
Loading

docs/team/channne.md

Lines changed: 48 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,56 @@ title: Channe Chwa's Project Portfolio Page
55

66
### Project: TAddressBook
77

8-
TAddress Book is a desktop app for CS2030S TAs to manage students and labs, optimized for use via a Command Line
9-
Interface. It is based on [AddressBook Level 3](https://se-education.org/addressbook-level3/).
8+
[TAddress Book](https://github.com/AY2122S2-CS2103-F10-1/tp) is a desktop app for CS2030S Teaching Assistants (TAs) to manage students and labs, in particular the grading process of lab assignments.
9+
It is based on [AddressBook Level 3](https://se-education.org/addressbook-level3/).
1010

11-
Given below are my contributions to the project.
11+
Given below are my contributions to the project. The code contributed can be found at this [Reposense link](https://nus-cs2103-ay2122s2.github.io/tp-dashboard/?search=channne&breakdown=true&sort=groupTitle&sortWithin=title&since=2022-02-18&timeframe=commit&mergegroup=&groupSelect=groupByRepos&checkedFileTypes=docs~functional-code~test-code~other).
1212

13-
**Features**
14-
1. Implemented ability to store marks associated with individual labs for individual students.
15-
* Allows TA to keep track of marks given when grading labs.
16-
2. Implemented commands to allow for submission of labs, grading of labs and editing of lab details (status and/or marks).
17-
* Allows TA to keep track of students' progress in labs as well as his/her own grading progress.
18-
19-
**Code contributed**: [Reposense link](https://nus-cs2103-ay2122s2.github.io/tp-dashboard/?search=channne&breakdown=true&sort=groupTitle&sortWithin=title&since=2022-02-18&timeframe=commit&mergegroup=&groupSelect=groupByRepos&checkedFileTypes=docs~functional-code~test-code~other)
13+
### Features
2014

21-
**Project management**: to be added soon
15+
#### New features
2216

23-
**Documentation**: to be added soon
17+
* Added `LabMark` class ([#91](https://github.com/AY2122S2-CS2103-F10-1/tp/pull/91))
18+
* **Description**: Each `Lab` is associated with a `LabMark` which is `Unknown` when `LabStatus` is `UNSUBMITTED`/`SUBMITTED` and an integer from 0 to 100 when `LabStatus` is `GRADED`
19+
* **Motivation**: Allows TA to keep track of marks given to individual labs when grading labs of students.
20+
* **Highlights**: Involved multiple defensive checks comparing `LabMark` and `LabStatus` in order to ensure that invalid labs (e.g. `GRADED` labs with `Unknown` marks) did not exist
21+
* Implemented `SubmitLabCommand`, `GradeLabCommand`, `EditLabCommand` ([#91](https://github.com/AY2122S2-CS2103-F10-1/tp/pull/91))
22+
* **Description**:
23+
* `SubmitLabCommand` allows for updating of `LabStatus` from `UNSUBMITTED` to `SUBMITTED`
24+
* `GradeLabCommand` allows for updating of `LabStatus` from `UNSUBMITTED` or `SUBMITTED` to `GRADED` and updates `LabMark` from `Unknown` to a given integer from 0 to 100
25+
* `EditLabCommand` allows for editing of `LabStatus` and/or `LabMark` (provided that the resultant lab is not invalid, e.g. `LabMark` is not `Unknown` yet `LabStatus` is not `GRADED`)
26+
* **Motivation**:
27+
* Allows TA to keep track of students' progress in labs as well as his/her own grading progress.
28+
* Allows TA to modify previous data which may have been incorrectly entered.
29+
* **Highlights**:
30+
* `SubmitLabCommand` and `GradeLabCommand` are subclasses of `EditLabCommand` with an identical `Command#execute` method, which calls other methods that perform validity checks on the labs to be edited and return class-specific error messages. Differing behavior is implemented using the OOP principle of polymorphism by overriding of superclass methods.
31+
* Originally was `EditLabStatusCommand` ([#71](https://github.com/AY2122S2-CS2103-F10-1/tp/pull/71)), but refactored to three different commands after addition of `LabMark`
32+
33+
#### Enhancements to existing features
34+
* Refactored `Person` from AddressBook Level 3 to `Student`
35+
* Added `StudentId` attribute ([#50](https://github.com/AY2122S2-CS2103-F10-1/tp/pull/50)), deleted `Phone` and `Address` attributes ([#52](https://github.com/AY2122S2-CS2103-F10-1/tp/pull/52))
36+
* Renamed class, variable and method names ([#76](https://github.com/AY2122S2-CS2103-F10-1/tp/pull/76))
37+
* Updated `AddCommand`, `EditCommand` and relevant tests
38+
* Fix bugs from PE-D: [#122](https://github.com/AY2122S2-CS2103-F10-1/tp/pull/122)
39+
40+
### Other contributions
41+
42+
#### Documentation
43+
* User Guide (UG):
44+
* Added documentation for `labsub`, `labgrad`, `labedit` ([#96](https://github.com/AY2122S2-CS2103-F10-1/tp/pull/96))
45+
* Added sample screenshots ([#133](https://github.com/AY2122S2-CS2103-F10-1/tp/pull/133))
46+
* Refined UG by standardizing formatting and parameter constraint descriptions (e.g. for `INDEX` and `LAB_MARK`)
47+
* Developer Guide (DG):
48+
* Contributed to user stories and use cases UC1, UC3, UC4, UC5 ([#33](https://github.com/AY2122S2-CS2103-F10-1/tp/pull/33), [#85](https://github.com/AY2122S2-CS2103-F10-1/tp/pull/85))
49+
* Added implementation details for `labedit` ([#143](https://github.com/AY2122S2-CS2103-F10-1/tp/pull/143))
50+
* Added instructions for manual testing of `labedit`
51+
* Ensured that PDF versions of UG and DG looked and worked as expected
52+
53+
#### Project management
54+
* Managed issue tracker by converting user stories and other features to issues and assigning them to relevant team members
55+
* Helped to manage milestones by adding deadlines and labeling issues
56+
57+
#### Review and mentoring
58+
* Helped to review team members' PRs, e.g. [#67](https://github.com/AY2122S2-CS2103-F10-1/tp/pull/67), [#77](https://github.com/AY2122S2-CS2103-F10-1/tp/pull/77), [#90](https://github.com/AY2122S2-CS2103-F10-1/tp/pull/90)
59+
* Contributed 11 bug reports/suggestions for another team during [PE-D](https://github.com/channne/ped/issues)
2460

25-
**Community**: to be added soon

0 commit comments

Comments
 (0)