Skip to content

Commit

Permalink
Merge branch 'master' into branch-add-diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
Incogdino authored Nov 12, 2024
2 parents 48827f2 + b2e666b commit efd3e59
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,24 @@ Note: While the diagram shows the lifeline of objects even after their deletion,

---

### Add Grade implementation

**Logic**:
1. `AddGradeCommand.java`
2. `AddGradeCommandParser.java`

The `addGrade` command is used by KonTActs to add an assignment and grade to a contact.
The added assignments and grades uses `HashMap` to store the assignments and grades in each person object.

This is illustrated in the activity diagram below:

<puml src="diagrams/AddGradeImpl.puml" width="450" />

* addGrade checks whether the assignment exists in the database, if the score is valid and if the person exists in the contacts.
* If the conditions are satisfied, the assignment is added to the `HashMap` in the person object which stores all the added assignments of that person.

---

### MarkCommand

<puml src="diagrams/MarkCommandActivityDiagram.puml" width="750" />
Expand Down
10 changes: 10 additions & 0 deletions docs/diagrams/AddGradeImpl.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@startuml
start
:User executes addGrade command with assignment name, score and name of person;
if () then ([AssignmentExists and ScoreValid and PersonExists])
:Specified assignment and score is added to specified person;
else ([else])
:addGrade command returns an error to the user;
endif
stop
@enduml

0 comments on commit efd3e59

Please sign in to comment.