PROJECT: CAPTracker


Overview

CapTracker is a desktop application. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 10 kLoC.

Summary of contributions

  • Major enhancement: Implemented the CAP & Target Grade Calculation feature in Model.

    • What it does: Calculates the current CAP of the user and also calculate the target grades the user have to achieve in order to achieve their CAP Goal.

    • Justification: This is one of the must-have User Story of the application, to allow users to verify if they are able to graduate with their desired CAP Goal

    • Highlights:

      • Calculation of target grades are triggered when changes are made to the list of modules in the transcript and updated on the UI.

      • Users may further adjust the target grade and obtain a updated list of target grades

  • Minor enhancement:

    • Added adjust and goal command in Logic

  • Code Contributed: https://nus-cs2103-ay1819s1.github.io/cs2103-dashboard/#=undefined&search=jeremiah-ang

  • Other contributions:

    • Project management:

      • Maintained issue tracker, milestones and review/merger of pull requests.

    • Documentation:

      • Updated existing content of the Model Section of Developer Guide

      • Updated Use Cases to follow the proper format

      • Added Sequence Diagrams for Target Grade and CAP Calculations

      • Added Activity Diagram for Target Grade Calculations

      • Updated User Guide for goal and adjust commands

      • Added Manual Testing Guide for Target Grade and CAP Calculations

    • Community:

      • PRs reviewed (with non-trivial review comments): #76, #78, #102, #133, #135, #190, #216

Contributions to the User Guide

Setting Cap Goal : goal

Set the CAP goal you want to achieve.
Format: goal CAP_GOAL

  • Sets and updates the CAP goal.

Examples:

  • goal 4.5
    Update your CAP goal to 4.5

Adjusting target goals: adjust

Removal of adjustment will be made available in v1.5.

Adjust the grade of an incomplete module
Format:

  • Module code is unique: adjust MODULE_CODE GRADE

  • Otherwise: adjust MODULE_CODE YEAR SEM GRADE

Examples:

  • adjust CS2103 A
    Adjusts the grade with module code CS2103 to have grade A

  • adjust CS2103 1 1 A
    Adjusts the grade with module code CS2103 taken in year 1 sem 1 to have grade A

Contributions to the Developer Guide

Model component

ModelClassDiagram Transcript
Figure 1. Structure of the Model Component

API : Model.java

The Model,

  • stores a UserPref object that represents the user’s preferences.

  • stores the Transcript data.

  • exposes an unmodifiable ObservableList<Module> that can be 'observed' e.g. the UI can be bound to this list so that the UI automatically updates when the data in the list change.

  • does not depend on any of the other three components.

  • provides filter function to filter Module with different kind of Grade

CAP & Target Grades Calculation

The two calculations are triggered upon an change to the list of modules in Transcript i.e. add/update/delete.

SDTranscriptModulesUpdate
Figure 2. Sequence Diagram of updating modules in Transcript

CAP Calculation

The CAP calculation is handled by Transcript.

The pseudo-code for CAP is the following:

all_points <- sum(credits(m) * points(m) for all completed modules m)
all_credits <- sum(credits(m) for all completed modules m)

CAP <- all_points/all_credits
SDTranscriptCalculateCap
Figure 3. Sequence Diagram of CAP calculation

CAP Calculation is triggered by:

Target Grades Calculation

The target Grade calculation is facilitated by Transcript. The returned list of modules with target Grade assures the following properties:

  • Reducing the Grade of any proposed target will result in the increase of another.

  • If x is the minimum Grade required when assigned to all modules to obtain the desired CAP Goal, none of the proposed target Grade will be greater than x

    i.e. if assigning B+ to all module is the minimal requirement to obtain the desired CAP Goal, none of the proposed target Grade will be A- or above.

Below is the pseudo-code for Target Grade Calculation:

CG <- CAP goal of user.
TC <- total credit of completed and incomplete modules.
PO <- total points achieved from completed and adjusted modules.
P <- CG * TC - PO // total points needed to achieve from incomplete modules.

mc_remaining <- sum of module credit of all incomplete modules
accumulated_points <- 0
for every incomplete Module m:
    avg_point_per_mc <- (P - accumulated_points) / mc_remaining
    target(m) <- ceiling(avg_point_per_mc)
    mc_remaining <- mc_remaining - credits(m)
    accumulated_points <- accumulated_points + (credits(m) * target(m))

This sequence diagram shows the interaction of the different classes involved in the process of creating a new Module with updated target grade

SDTranscriptTargetCalculation
Figure 4. Sequence Diagram of Target Grade calculation

And below the activity diagram to further illustrate several exceptional cases.

activityDiagramTargetGradeCalculationWhenChanged
Figure 5. Activity Diagram of High level view of Target Grade Calculation
activityDiagramTargetGradeCalculationActualCalculation
Figure 6. Activity Diagram of Calculate New Target Grade

Use case: [UC1] Calculating current CAP

MSS

  1. User enter modules

  2. System recalculates CAP

  3. System displays CAP

    Use case ends.

Extensions

  • 1a. User enters invalid parameters

    • 1a1. System shows an Invalid entry error message

      Use case ends.

  • 1b. User enters duplicate Module

    • 1b1. System shows an Duplicate Module error message

      Use case ends

Use case: [UC2] View grades needed to achieve CAP goal

MSS

  1. User enters completed Modules

  2. User enters incomplete Modules

    Step 1-2 are repeated until user is satisfied.

  3. User enter CAP goal

  4. System calculated target grades

  5. System displays target grades for ungraded modules

    Use case ends.

Extensions

  • 3a. CAP goal is invalid

    • 3a1. System shows an Invalid CAP Goal error message

      Use case ends.

  • 4a. There are no incomplete Modules and current CAP is lesser than CAP Goal

    • 4a1. Go to step 5a

      Use case ends.

  • 5a. CAP goal is not achievable

    • 5a1. System inform that it is not achievable

      Use case ends.

Use case: [UC3] Updating target grades

Pre-condition: [UC2] completed

MSS

  1. User modify modules entries

  2. System recalculates target grades for ungraded modules

  3. System displays new target grades for ungraded modules

    Use case ends.

Extensions

  • 2a. CAP goal is not achievable with new set of modules

    • 2a1. System inform that it is not achievable

      Use case ends.

Use case: [UC4] Save entered module

MSS

  1. User enters module

  2. System saves the modules

    Use case ends.

Use case: [UC5] Loading saved modules

Pre-conditions: [UC4] completed

MSS

  1. User restarts the application

  2. User list entered modules

  3. System displays saved modules

    Use case ends

Use case: [UC6] Adjusting target grades

Pre-conditions:

  • [UC2] completed

  • There are targets given to incomplete modules

MSS

  1. User adjust target

  2. System recalculates target grades for remaining ungraded modules

  3. System displays new target grades for remaining ungraded modules

Extensions

  • 2a. CAP goal is not achievable with new set of modules

    • 2a1. System inform that it is not achievable

      Use case ends.