From 181c6e44da43cc1d6b49b09b28554bdd4cfd4e2f Mon Sep 17 00:00:00 2001 From: Lim Ngee Yong Date: Mon, 23 Oct 2023 22:53:07 +0800 Subject: [PATCH 1/2] Add Class Details to DeveloperGuide --- docs/DeveloperGuide.md | 69 +++++++++++++++++++++++++++++++++ docs/diagrams/ClassDetails.puml | 23 +++++++++++ docs/diagrams/ClassGrades.puml | 29 ++++++++++++++ docs/diagrams/Trackers.puml | 30 ++++++++++++++ 4 files changed, 151 insertions(+) create mode 100644 docs/diagrams/ClassDetails.puml create mode 100644 docs/diagrams/ClassGrades.puml create mode 100644 docs/diagrams/Trackers.puml diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 8b20837288e..240c5efbf37 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -250,6 +250,75 @@ _{more aspects and alternatives to be added}_ _{Explain here how the data archiving feature will be implemented}_ +### \[Proposed\] Class Details feature + +#### Proposed Implementation + +The proposed class details mechanism for each student will be facilitated by `ClassDetails`. It allows for the tracking +of an `Student` 's class details, such as their tutorial group, tutorial attendance, class participation, and assignment +grades. It will be stored as 3 separate classes to model each of the 3 different types of class details, and a tracker +class to act as the manager for each of the classes, with the trackers composing the `ClassDetails` class. + + + +The 3 different types of class grades are: + +* `Attendance` - Stores the details for a students attendance in a specific tutorial. Attendance will be stored as +a boolean value. +* `ClassParticipation` - Stores the details for a students participation in a specific tutorial. Class participation +will be stored as a boolean value. +* `Assignment` - Stores the details for a students assignment grades for a specific tutorial. Assignment grades will be +stored as an integer value, with the total marks standardized to 100 marks. + + + +These classes will be stored in their respective tracker classes, using Java Arrays to store the objects. The position +of the classes in the array will correspond to the index of the tutorial or assignment. For example, the first index of +the array will correspond to either the first tutorial or assignment, depending on the tracker class. + +The tracker classes will be stored in the `ClassDetails` class, which will be composed of the following classes: +* `AttendanceTracker` - Stores the `Attendance` objects for a specific student. +* `ClassParticipationTracker` - Stores the `ClassParticipation` objects for a specific student. +* `AssignmentTracker` - Stores the `Assignment` objects for a specific student. + +* + +These tracker classes will inherit from a `tracker` *interface*. They will also support the following operations: +* `getPercentage()` - Returns the average grade of the student for the specific tracker class. For example, the average +tutorial attendance percentage, or the average assignment score. + +Each of these tracker classes will be able to be initialized with a specific size, which will be the number of tutorials +or assignment grade. + +#### Design considerations: + +**Aspect: Class grades classes** + +* **Alternative 1 (current choice):** Use a class for each type of class details. + * Pros: Easy to implement, follows OOP principle. If we want to edit the implementation of each of the classes or + change the data structure / details of each instance, it can be easily done. + * Cons: May have performance issues in terms of memory usage. + +* **Alternative 2:** Store class values as a primitive type (String or Integer). + * Pros: Will use less memory. + * Cons: We must ensure that the implementation of each individual class are correct. Implementation will be more + complicated as different class detail types will require different implementations for the same operation. + +**Aspect: Tracker classes** + +* **Alternative 1 (current choice):** Use a tracker class for each type of class details. + * Pros: Easy to implement. Shared functions can be abstracted out and polymorphism can be applied. + * Cons: May have performance issues in terms of memory usage. + +* **Alternative 2:** Store class values as an Object Array. + * Pros: Will use less memory. + * Cons: Will need to implement different functions for each type of class details. Implementation will be more + complicated. SLAP principle might not be able to be adhered to. + + + + + -------------------------------------------------------------------------------------------------------------------- diff --git a/docs/diagrams/ClassDetails.puml b/docs/diagrams/ClassDetails.puml new file mode 100644 index 00000000000..3295ba5a1c1 --- /dev/null +++ b/docs/diagrams/ClassDetails.puml @@ -0,0 +1,23 @@ +@startuml +!include style.puml +skinparam arrowThickness 1.1 +skinparam arrowColor LOGIC_COLOR_T4 +skinparam classBackgroundColor LOGIC_COLOR + +package Trackers as TrackerPackage { +Class "<>\nTracker" as Tracker +Class Tracker +Class AttendanceTracker +Class AssignmentTracker +Class ClassParticipationTracker +} + +AttendanceTracker .up.|> Tracker +AssignmentTracker .up.|> Tracker +ClassParticipationTracker .up.|> Tracker + +AttendanceTracker --* ClassDetails +AssignmentTracker --* ClassDetails +ClassParticipationTracker --* ClassDetails + +@enduml \ No newline at end of file diff --git a/docs/diagrams/ClassGrades.puml b/docs/diagrams/ClassGrades.puml new file mode 100644 index 00000000000..a5a75600e58 --- /dev/null +++ b/docs/diagrams/ClassGrades.puml @@ -0,0 +1,29 @@ +@startuml +!include style.puml +skinparam arrowThickness 1.1 +skinparam arrowColor LOGIC_COLOR_T4 +skinparam classBackgroundColor LOGIC_COLOR + +package Trackers as TrackerPackage { +Class "<>\nTracker" as Tracker +Class Tracker +Class AttendanceTracker +Class AssignmentTracker +Class ClassParticipationTracker +} + +package ClassGrades as ClassGradesPackage { +Class Attendance +Class Assignment +Class ClassParticipation +} + +AttendanceTracker .up.|> Tracker +AssignmentTracker .up.|> Tracker +ClassParticipationTracker .up.|> Tracker + +Attendance --* AttendanceTracker +Assignment --* AssignmentTracker +ClassParticipation --* ClassParticipationTracker + +@enduml \ No newline at end of file diff --git a/docs/diagrams/Trackers.puml b/docs/diagrams/Trackers.puml new file mode 100644 index 00000000000..54b89dd69f1 --- /dev/null +++ b/docs/diagrams/Trackers.puml @@ -0,0 +1,30 @@ +@startuml +!include style.puml +skinparam arrowThickness 1.1 +skinparam arrowColor LOGIC_COLOR_T4 +skinparam classBackgroundColor LOGIC_COLOR + +package Trackers as TrackerPackage { +Class "<>\nTracker" as Tracker +Class Tracker +Class AttendanceTracker +Class AssignmentTracker +Class ClassParticipationTracker +} + +package ClassGrades as ClassGradesPackage { +Class Attendance +Class Assignment +Class ClassParticipation +} + +AttendanceTracker .up.|> Tracker +AssignmentTracker .up.|> Tracker +ClassParticipationTracker .up.|> Tracker + +Attendance --* AttendanceTracker +Assignment --* AssignmentTracker +ClassParticipation --* ClassParticipationTracker + + +@enduml \ No newline at end of file From d1102edad9d0e8548f1f9399c75346299e97ecfc Mon Sep 17 00:00:00 2001 From: Lim Ngee Yong Date: Mon, 23 Oct 2023 23:33:58 +0800 Subject: [PATCH 2/2] Edit for checkstyle --- docs/diagrams/ClassDetails.puml | 2 +- docs/diagrams/ClassGrades.puml | 2 +- docs/diagrams/Trackers.puml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/diagrams/ClassDetails.puml b/docs/diagrams/ClassDetails.puml index 3295ba5a1c1..3137fa2e2c4 100644 --- a/docs/diagrams/ClassDetails.puml +++ b/docs/diagrams/ClassDetails.puml @@ -20,4 +20,4 @@ AttendanceTracker --* ClassDetails AssignmentTracker --* ClassDetails ClassParticipationTracker --* ClassDetails -@enduml \ No newline at end of file +@enduml diff --git a/docs/diagrams/ClassGrades.puml b/docs/diagrams/ClassGrades.puml index a5a75600e58..539a095f1a0 100644 --- a/docs/diagrams/ClassGrades.puml +++ b/docs/diagrams/ClassGrades.puml @@ -26,4 +26,4 @@ Attendance --* AttendanceTracker Assignment --* AssignmentTracker ClassParticipation --* ClassParticipationTracker -@enduml \ No newline at end of file +@enduml diff --git a/docs/diagrams/Trackers.puml b/docs/diagrams/Trackers.puml index 54b89dd69f1..356dc5c9b2c 100644 --- a/docs/diagrams/Trackers.puml +++ b/docs/diagrams/Trackers.puml @@ -27,4 +27,4 @@ Assignment --* AssignmentTracker ClassParticipation --* ClassParticipationTracker -@enduml \ No newline at end of file +@enduml