Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update UG for info, calculateCAP, calculateMC #243

Merged
merged 16 commits into from
Nov 13, 2023
Merged
99 changes: 83 additions & 16 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@

This project is based on the AddressBook-Level3 project created by the [SE-EDU initiative](https://se-education.org).

<br>

Libraries used in this project:

- [Jackson](https://github.com/FasterXML/jackson)
- [JavaFX](https://openjfx.io/)
- [JUnit5](https://github.com/junit-team/junit5)
--------------------------------------------------------------------------------------------------------------------

## **Setting up, getting started**
Expand Down Expand Up @@ -271,6 +275,26 @@ This can be shown through following sequence diagram:


### Add Module Command
**Overview:**
The `add` command is used to add a module to the module plan with the information fields `Module Code`, `Year Taken`,
`Semester Taken`, and `Grade`.

The format for the `add` command can be found [here](#adding-a-module)

**Feature details:**
1. The user executes the `add` command.
2. If any of the fields are not provided, an error message with the appropriate command usage will be displayed.
3. If any of the command parameters are invalid, an error message with the appropriate parameter format will be displayed.
4. The `Module` is then searched in the `model` to see if it is an existing module that NUS offers. If the module is not
offered, an error message will be displayed.
5. The `Module` is then checked with `ModulePlan` to see if it has already been added to the module plan previously.
If the module has already been added the User's module plan, an error message will be displayed.
6. If all the previous stages complete without exceptions or errors, the `Module` will be added to the `ModulePlan`

The activity diagram for adding a `Module` into the module plan

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


### Edit Module Command

Expand Down Expand Up @@ -579,8 +603,8 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli

1. User searches a module that he wants to take next semester
2. Modcraft displays the information for the module.
3. User adds that module to his timetable
4. Modcraft shows the module in the User’s timetable
3. User adds that module to their module plan.
4. Modcraft shows the module in the User’s module plan.
Steps 1-4 are repeated for each module the User is interested in

Use case ends.
Expand All @@ -604,15 +628,15 @@ Use case resumes from step 1.
**MSS**

1. User inputs grades for a module that they have taken.
2. System shows the updated grade in the timetable.
2. Modcraft shows the updated grade in the timetable.
Steps 1-2 are repeated for each grade the user would like to update for.

Use case ends.

**Extensions**

* 1a. Grade is invalid
* 1a1. System shows the user the grade is invalid
* 1a1. Modcraft shows the user the grade is invalid
* 1a2. User inputs correct grade
Steps 1a1 and 1a2 are repeated until the user inputs the correct grade
Use case resumes from step 2.
Expand Down Expand Up @@ -657,6 +681,49 @@ Use case ends.

<br>

___
#### **Use Case: UC06 - Indicating Advanced Placement Modules**

**MSS**

1. User searches for the advanced placement module that they have taken or are planning to take using the info command.
2. User adds the module to the module plan.
3. Modcraft shows the module in the module plan.

Use case ends.

**Extensions**

* 1a. Modcraft detects that the module does not exist or not available for advanced placement.
* 1a1. Modcraft informs the user it is unavailable.
* 1a2. User searches another module.
Steps 1a1 to 1a2 are repeated until the module is available.
Use case resumes from step 2.

___

#### **Use Case: UC07 - Indicating Special Term Modules**

**MSS**

1. User searches for a special term module using the info command.
2. Modcraft shows that the module is available to be taken in the special term.
3. User adds the module to the module plan.
4. Modcraft shows the module in the User's module plan.

Use case ends.

**Extensions**
* 1a. Modcraft detects that the module does not exist or not available for advanced placement.
* 1a1. Modcraft informs the user it is unavailable.
* 1a2. User searches another module.
Steps 1a1 to 1a2 are repeated until the module is available.
Use case resumes from step 2.
* 3a. User wants to indicate that the module is taken or to be taken in Special Term 1 or Special Term 2
* 3a1. User uses the add command and specifies the semester to be `s/ST1` for Special Term 1 or `s/ST2` for Special Term 2
* Use case resumes from step 4.

___
### Non-Functional Requirements

1. Should work on any mainstream OS as long as it has Java 11 or above installed.
Expand Down Expand Up @@ -697,7 +764,7 @@ testers are expected to do more *exploratory* testing.

1. Download the jar file and copy into an empty folder

1. Open command terminal and `cd` into the folder where the jar file is in. Use the `java -jar ModCraft.jar` command to run the application.<br>
1. Open command terminal and `cd` into the folder where the jar file is in. Use the `java -jar ModCraft.jar` command to run the application.<br>
Expected: Shows the GUI with a set of sample modules. The window size may not be optimum.

1. Saving window preferences
Expand All @@ -720,13 +787,13 @@ testers are expected to do more *exploratory* testing.

1. Test case: `add CS3230 y/0 s/1 g/A`.<br>
Expected: A new column of semester named `Adv Placement` appears. The module `CS3230` is added to the list `Adv Placement`, with its grade as `A` in a green box. Details of the added module shown in the status message. The modules shown in the semester list is updated.

2. Test case: `add CS1010 y/1 s/ST1 g/F`.<br>
Expected: A new column of semester named `Year 1 ST1` appears. The module `CS1010` is added to the list `Year 1 ST1`, with its grade as `F` in a red box. Details of the added module shown in the status message. The modules shown in the semester list is updated.

3. Test case: `add CS1231S ...` when it is already in the semester list.<br>
Expected: No module is added. Error details shown in the status message. Status bar remains the same.

4. Test case: `add CS1010 y/1 s/ST1 g/a`.<br>
Expected: No module is added. Error details of wrong format of grade shown in the status message. Status bar remains the same.

Expand Down Expand Up @@ -766,8 +833,8 @@ testers are expected to do more *exploratory* testing.

2. Test case: `edit CS1010 s/ST1`.<br>
Expected: A new column of semester named `ST1` appears. The module `CS1010` is moved to the list `ST1`, while its grade and semester remain unchanged. Details of the added module shown in the status message. The modules shown in the semester list is updated.
3. Test case: `edit CS1010 g/a`.<br>

3. Test case: `edit CS1010 g/a`.<br>
Expected: No module is edited. Error details of wrong format of grade shown in the status message. Status bar remains the same.

3. Test case: `edit CS1101S ...` when it is not already present in the semester list.<br>
Expand Down Expand Up @@ -796,12 +863,12 @@ testers are expected to do more *exploratory* testing.

1. Test case: `calculateCAP` when there are no modules in the semester list.<br>
Expected: The CAP output is `0.0`.

2. Prerequisites: Multiple module in the list.

3. Test case: `calculateCAP`.<br>
Expected: The CAP output is a `float` of `0.0` $\leq$ CAP $\leq$ `5.0` with a status message.

4. Test case: `calculateCAP` when grades of all modules are marked as `IP`, `EXE`, `W`, `IC`, `S`, `U`, `CS` or `CU`.<br>
Expected: The CAP output is `0.0`.

Expand All @@ -813,7 +880,7 @@ testers are expected to do more *exploratory* testing.

1. Test case: `calculateMC` when there are no modules in all the semester lists.<br>
Expected: The Modular Credits output is `0.0`.

2. Prerequisites: Multiple modules in the list.

3. Test case: `calculateMC`.<br>
Expand All @@ -826,10 +893,10 @@ testers are expected to do more *exploratory* testing.
1. Dealing with missing/corrupted data files

1. Prerequisites: There are existing module and module plan files with existing stored modules.

2. Test Case: Close the application and delete `moduleplan.json`.
Expected: Upon the next application start, a new `moduleplan.json` is created.

3. Test Case: Close the application and edit `moduleplan.json` by changing the name of the first Module to `CS3230`.
Expected: Upon the next application start, the name of the first Module in chronological order in the list of years and semesters will appear as `CS3230`.

Expand Down
65 changes: 47 additions & 18 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Warnings in boxes like this contain information that are vital to the running of
2. Download the latest `ModCraft.jar` from [here](https://github.com/AY2324S1-CS2103T-T13-0/tp/releases/tag/v1.4).
3. Copy the downloaded jar file to the folder you want to use as the _home folder_ (the folder `ModCraft.jar` will be in) for ModCraft.


<div class="alert alert-warning"><md>:exclamation: **Caution:**
As ModCraft writes to files within the directory it is in, we recommend placing ModCraft in an empty directory to prevent unexpected behaviour.
</md></div>
Expand Down Expand Up @@ -195,15 +196,14 @@ The images below show you the process for adding a module to one of the Special


<div class="alert alert-warning"><md>:exclamation: **Caution:**

Currently, ModCraft has certain **limitations**.

* ModCraft **does not** check for pre-requisites, pre-clusions and co-requisites while adding, deleting and editing modules. For example, you can add modules into ModCraft without adding their prerequisite modules.

* ModCraft **does not** check for availability of modules for semesters. This means that you can add any module into any semester of your study plan, even though the module may not be offered in that semester.

* ModCraft **does not** check for the availability of Completed Satisfactory/Completed Unsatisfactory (CS/CU) options of modules, meaning that you can add a non-CS/CU module with a CS/CU grade.<br>
e.g. you can add the non-CS/CU module `CS2100` and input its grade as `CS`.<br>
e.g. you can add the non-CS/CU module `CS2100` and input its grade as `CS`.<br>
Likewise, you can add a CS/CU module with a non-CS/CU grade.<br>
e.g. you can mark the grade of `CFG1002` as `A`.

Expand Down Expand Up @@ -246,7 +246,7 @@ The images below show you the process for executing the `add` command in ModCraf

### Editing a module: `edit`

You can change an attribute of a module using this command. This command works **only if the module exists**.
You can change an attribute of a module using this command. This command works **only if the module exists**.

This command may be useful if you want to update information about a module or have made a mistake while adding a module.

Expand Down Expand Up @@ -314,16 +314,32 @@ The **module code, module title, modular credit and module description** of the

Format: `info MODULE`

Examples:
* `info CS2109S`
* `info CS1010`
<div class="alert alert-warning"><md>:gear: Example:

* info CS2109S

Displays information about the module CS2109S

The images below show you what ModCraft should look like for executing the `info` command. Information about the module `CS3230` is displayed.
* info CS1010

Displays information about the module CS1010
</md></div>

The images below show you what ModCraft should look like after executing the `info` command.

In the example below, the command `info CS3230` is executed. Information about the module `CS3230` is displayed.

<div style="display:flex; justify-content:space-around; align-items:center;">
<img src="images/ImagesForUG/info-before.png" alt="Before executing info command" style="height:400px; margin:20px;">
<img src="images/ImagesForUG/info-after.png" alt="After executing info command" style="height:400px; margin:20px;">
</div>
<p style="text-align: center;">
Information about the module searched being displayed.
</p>

<div class="alert alert-default" style="background-color: rgb(223, 240, 216); border-color: rgb(214, 233, 198);"><md>:information_source: **Note:**

The module information is taken from [NUSmods](https://github.com/nusmodifications/nusmods) for the current Academic Year 23/24 .
</md></div>

<br>

Expand All @@ -333,55 +349,68 @@ You can calculate the total current Cumulative Average Point (CAP), or Grade Poi

ModCraft will calculate your CAP according to the [NUS Modular System](https://www.nus.edu.sg/registrar/academic-information-policies/non-graduating/modular-system), and using the following formula:

$\Large\frac{\text{sum of all valid modules: (grade point of each valid module * Modular Credits of each valid module)}}{\text{total Modular Credits of valid modules}}$.

<p style="text-align: center;">
$\Large\frac{\text{For each module: Sum of(grade point of each module * Modular Credits of each module)}}{\text{total Modular Credits of modules}}$.
</p>

Displays you a `float` of `0.0` $\leq$ value $\leq$ `5.0`.

Format: `calculateCAP`


The images below show you what ModCraft should look like for executing the `calculateCAP` command.

<div style="display:flex; justify-content:space-around; align-items:center;">
<img src="images/ImagesForUG/cap-before.png" alt="Before executing calculateCAP command" style="height:400px; margin:20px;">
<img src="images/ImagesForUG/cap-after.png" alt="After executing calculateCAP command" style="height:400px; margin:20px;">
</div>
<p style="text-align: center;">
The cap calculated based on the existing modules and their respective grades in the module plan.
</p>

<div class="alert alert-default" style="background-color: rgb(223, 240, 216); border-color: rgb(214, 233, 198);"><md>:information_source: **Note:**

<div class="alert alert-primary"><md>:bulb: **Tip:**

The result displayed by the `calculateCAP` command **does not include** the modules with grades marked as
The result displayed by the `calculateCAP` command **does not include** the modules with grades marked as
`IP` (In Progress), `EXE` (Exempted), `W` (Withdrawn), `IC` (Incomplete), `S` (Satisfactory), `U` (Unsatisfactory), `CS` (Completed Satisfactory) and `CU` (Completed Unsatisfactory).

</md></div>

<br>

### Calculating the total current Modular Credits (MCs): `CalculateMC`
### Calculating the total current Modular Credits (MCs): `calculateMC`

You can calculate the total current Modular Credits (MCs) stored in all years and semesters using this command. ModCraft displays a float which is the sum of MCs of all modules in the module plan.
You can calculate the total current Modular Credits (MCs) stored in **all** years and semesters using this command.
ModCraft displays a float which is the sum of MCs of **all modules** in the **module plan**.

Format: `calculateMC`

The images below show you what ModCraft should look like for executing the `calculateMC` command.

<div style="display:flex; justify-content:space-around; align-items:center;">
<img src="images/ImagesForUG/mc-before.png" alt="Before executing calculateMC command" style="height:400px; margin:20px;">
<img src="images/ImagesForUG/mc-after.png" alt="After executing calculateMC command" style="height:400px; margin:20px;">
</div>
<p style="text-align: center;">
The total amount of modular credits obtained based on the module plan
</p>

<div class="alert alert-primary"><md>:bulb: **Tip:**

The result displayed by the `calculateMC` command **includes** the modular credits of modules with grades marked as `IP` (In progress).
The result displayed by the `calculateMC` command **includes** the modular credits of **all modules** in the module plan
including modules with non-passing grades

</md></div>


<br>

### Exiting the program: `exit`

You can exit ModCraft using this command.

Format: `exit`
Format:
```swift
exit
```

<br>

Expand Down
44 changes: 44 additions & 0 deletions docs/diagrams/AddModuleActivityDiagram.puml
marquestye marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
@startuml
skin rose
skinparam ActivityFontSize 15
skinparam ArrowFontSize 12
!pragma useVerticalIf on
start
:User enters Add Command;

'Since the beta syntax does not support placing the condition outside the
'diamond we place it as the true branch instead.

partition AddCommandParser{
if () then ([else])
:ParseException: Invalid module code format;
stop

( [valid module code format]) elseif () then ( [else])
:ParseException: Invalid command format;
stop
else ( [valid command format])

endif
}

partition AddCommand {

if () then ([else])
:ModuleNotFoundException: Module not found;
stop
( [module is in ModuleData]) elseif() then([else])
:DuplicateModuleException: Module already added;
stop
else ( [module not in ModulePlan] )

endif
}

:Add Command is executed successfully
Module is added to ModulePlan;
stop



@enduml
Loading