Skip to content

Commit

Permalink
Merge branch 'master' into branch-documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
SinhaVedant committed Nov 13, 2023
2 parents cbdfadd + 829bbaa commit 437ef95
Show file tree
Hide file tree
Showing 12 changed files with 316 additions and 36 deletions.
4 changes: 2 additions & 2 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ Note that Student, StudentGrade and GradeComponent classes have similar structur

Here are the class diagrams for Ssc (Student, StudentGrade, GradedComponent) classes respectively.
<puml src="diagrams/StudentModelDiagram.puml" width="450" />
<puml src="diagrams/StudentGradeModelDiagram.puml" width="450" />
<puml src="diagrams/GradedComponentModelDiagram.puml" width="450" />
<puml src="diagrams/StudentScoreModelDiagram.puml" width="300" />
<puml src="diagrams/GradedComponentModelDiagram.puml" width="300" />

The `Model` component,

Expand Down
50 changes: 40 additions & 10 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ pageNav: 3
_**Min-max your module management!**_

ModuLight is a **desktop app** built for **professors from National University of Singapore to manage students and
assessments** for a single module.
assessments** for a single module. This app is ideally designed for professors with intermediate technical knowledge,
who are comfortable using the Command Line Interface (CLI).

Here’s an overview of how Modulight can help you to streamline your module management process:
* Store and edit information about your students and various assessments.
* Calculate statistics on cohort performance for assessments and autograde based on customised parameters.
* Track qualitative information about your students and assessments using tags and comments.

Furthermore, we believe that module management should be **efficient**. Therefore, Modulight is **optimized for use
via a Command Line Interface (CLI)** while still having the benefits of a Graphical User Interface (GUI). If you can
via a Command Line Interface** while still having the benefits of a Graphical User Interface (GUI). If you can
type fast, ModuLight can get your student grading tasks done faster than traditional GUI apps.


Expand Down Expand Up @@ -87,7 +88,7 @@ The following section gives an overview of the parameters used for the commands

| Parameter | Description | Constraints | Valid Examples | Invalid Examples |
|-----------|-------------------------------|----------------------------------------------------------------------------|------------------------------|-----------------------------|
| n/ | Name of the student | Must only contain alphanumeric characters and must not be empty. | John, Lee Xiao Ming | 晓明, Xiao Ming@Lee, 이준 |
| n/ | Name of the student | Must only contain alphanumeric characters and must not be empty. | John1, Lee Xiao Ming | 晓明, Xiao Ming@Lee, 이준 |
| e/ | Email of the student | Must consist of a alphanumeric prefix, @ symbol and a domain | [email protected], [email protected] | 12@, 1234gmail |
| s/ | Student ID of the student | Must start and end with a capital letter and have 7 digits in between them | A1234567W | a1234567w, a123w, B1234567 |
| g/ | Tutorial group of the student | Must consist of a capital letter followed by 2 digits | T06, L10 | T1, t10, T111, @T11 |
Expand Down Expand Up @@ -122,18 +123,20 @@ The following section gives an overview of the parameters used for the commands

<box type="info" seamless>

**Notes on Graded Component and Student Score parameters for score calculation**<br>
##Notes on score calculation

* The maximum marks of a graded component and marks of a student score are both absolute values and are used together to
determine the relative performance of a student for a component. For instance, if the maximum marks for a component Midterms is 50, and the marks for the student is 35, then the student scored 35/50 =70% on this graded component.

* The weightage of a graded component is used to determine its contribution to a student’s overall score, and is calculated
relative to the sum of all other component weightages. For instance, if there are only 2 components in the system currently,
and component A has weightage 30, and component B weightage 20, then component A currently represents 20/(20+30) = 60% of
the student’s overall score. This is modified as components are added and removed. Note that the total weightage of all graded components should be less than or equal to 100.
the student’s overall score. This is modified as components are added and removed. However, the total weightage of all graded components should be less than or equal to 100, which is enforced as graded components are added/edited/deleted.

* If a graded component has a maximum mark of 0, the relative score for any associated student scores will be 0.

* If a student or graded component has no associated student scores, the average mark will be listed as 0.

</box>

## Navigating the Graphical User Interface (GUI)
Expand Down Expand Up @@ -225,16 +228,24 @@ Adds a graded component to the database. If successful, an acknowledgement messa

Upon successful creation of a graded component, a corresponding student score will be created for each student in the database. For instance, if a graded component with name “Midterms” is created and there are two students with student numbers “A1234567X” and “A1234567Y” in the database, then two student scores are created with titles “A1234567X - Midterm” and “A1234567Y - Midterm”.

Format: `addComp c/COMP_NAME w/WEIGHTAGE mm/MAX_MARKS`
* When adding the component, you must ensure that the total weightage of all components does not exceed 100.
* Weightage is a relative value calculated relative to the sum of all other weightage values. For more details, view [the notes on score calculations](#notes-on-score-calculation).
* Please refrain from entering numbers with more than 2 decimal places of precision.

* The graded component name (case-sensitve) cannot match any other existing graded component names in the database.
* Weightage represents how much this component contributes when tabulating students’ total marks, and is calculated relative to the sum of all other component weightages. For instance, if there are only 2 components in the system currently, and component A has weightage 30, and component B weightage 20, then component A currently represents 60% of the grade. This is modified as components are added and removed.
Format: `addComp c/COMP_NAME w/WEIGHTAGE mm/MAX_MARKS`

Examples: `addComp c/Midterm w/30 mm/70` adds a graded component called “Midterm” with a weightage of 30 and a maximum mark of 70.

### Edit a graded component: `editComp`
Edits an existing graded component’s details in the database, based on the 1-based index of the graded component shown in the Graded Components list. If successful, an acknowledgement message will be shown in the output box and data is saved. Otherwise, a failure message is shown instead specifying the cause of failure.
1 or more fields to be edited must be provided in the command. The index provided must be more than 0 and not exceed the number of graded components displayed in the Graded Components list. If the component name is being edited, the component name cannot match the component name of any other graded component already in the database.

* 1 or more fields to be edited must be provided in the command.
* The index provided must be more than 0 and not exceed the number of graded components displayed in the Graded Components list.
* If the component name is being edited, the component name cannot match the component name of any other graded component already in the database.
* When editing the component, you must ensure that the total weightage of all components does not exceed 100.
* If editing the maximum marks, ensure none of the current student scores exceed the new maximum marks.
* Weightage is a relative value calculated relative to the sum of all other weightage values. For more details, view [the notes on score calculations](#notes-on-score-calculation).
* Please refrain from entering numbers with more than 2 decimal places of precision.

Format: `editComp INDEX [c/COMP_NAME] [w/WEIGHTAGE] [mm/MAX_MARKS]`

Expand All @@ -244,9 +255,11 @@ Examples: `editComp 4 c/Midterm Exam mm/55` edits the fourth graded component in

### Delete a graded component: `deleteComp`

Deletes an existing graded component in the database, based on the 1-based index of the graded component shown in the displayed Graded Components list.
Deletes an existing graded component and its associated student scores in the database, based on the 1-based index of the graded component shown in the Graded Components list.
If successful, an acknowledgement message will be shown in the output box and data is saved. Otherwise, a failure message is shown instead specifying the cause of failure.

* The index provided must be more than 0 and not exceed the number of graded components displayed in the Graded Components list.

Format: `deleteComp INDEX`

* The index provided must be more than 0 and not exceed the number of graded components displayed in the Graded Components list.
Expand All @@ -259,6 +272,11 @@ Edits a student’s mark for a certain graded component, based on the 1-based in

Note: a StudentScore will be automatically added when a graded component is created or when a new student is added. Similarly, student scores will be automatically deleted when its associated graded component or student is deleted.

* 1 or more fields to be edited must be provided in the command.
* The index provided must be more than 0 and not exceed the number of student scores displayed in the Student Scores list.
* The mark given cannot exceed the maximum marks for that graded component.
* Please refrain from entering numbers with more than 2 decimal places of precision.

Format: `editScore INDEX [m/SCORE] [x/comment]`

* if the mark is being edited, the new mark should be more than 0 and not exceed the associated component's maximum marks.
Expand Down Expand Up @@ -466,6 +484,18 @@ _Details coming soon ..._

--------------------------------------------------------------------------------------------------------------------

## FAQ
**Q**: How do I transfer my data to another Computer?<br>
**A**: Install the app in the other computer and overwrite the empty data file it creates with the file that contains the data of your previous Modulight home folder.

**Q**: How does the calculation of scores work?<br>
**A**: Refer to the [notes on score calculations](#notes-on-score-calculation).

**Q**: Does the display update information (eg. name, mean) in real time?<br>
**A**: Yes.

--------------------------------------------------------------------------------------------------------------------

## Command summary

| Action | Format, Examples |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class DeleteGradedComponentCommand extends Command {
+ "Parameters: INDEX (must be a positive integer)\n"
+ "Example: " + COMMAND_WORD + " 1";

public static final String MESSAGE_DELETE_PERSON_SUCCESS = "Deleted GradedComponent: %1$s";
public static final String MESSAGE_DELETE_GC_SUCCESS = "Deleted graded component: %1$s";

private final Index targetIndex;

Expand All @@ -56,14 +56,13 @@ public CommandResult execute(Model model) throws CommandException {
for (int i = studentScoreList.size() - 1; i >= 0; i--) {
StudentScore curScore = studentScoreList.get(i);
if (curScore.getGcName().equals(gradedComponentToDelete.getName())) {
// somewhat inefficient, to change
Student student = studentBook.getStudentById(curScore.getStudentId());
student.deleteScore(curScore);
studentBook.setStudent(student, student);
studentScoreBook.removeStudentScore(curScore);
}
}
return new CommandResult(String.format(MESSAGE_DELETE_PERSON_SUCCESS,
return new CommandResult(String.format(MESSAGE_DELETE_GC_SUCCESS,
Messages.formatGradedComponent(gradedComponentToDelete)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ public class EditGradedComponentCommand extends Command {
+ PREFIX_COMPONENT_NAME + "Midterm Project "
+ PREFIX_WEIGHTAGE + "20";

public static final String MESSAGE_EDIT_PERSON_SUCCESS = "Edited graded component: %1$s";
public static final String MESSAGE_EDIT_GC_SUCCESS = "Edited graded component: %1$s";
public static final String MESSAGE_NOT_EDITED = "At least one field to edit must be provided.";
public static final String MESSAGE_DUPLICATE_GRADED_COMPONENT = "This graded component already "
+ "exists in the address book.";
+ "exists in the database.";
public static final String MESSAGE_ASSOCIATED_SCORE_EXCEEDS = "Graded component could not be edited."
+ " An associated student score has marks that exceeds the maximum marks provided.";

Expand Down Expand Up @@ -100,7 +100,7 @@ public CommandResult execute(Model model) throws CommandException {
}
}

return new CommandResult(String.format(MESSAGE_EDIT_PERSON_SUCCESS,
return new CommandResult(String.format(MESSAGE_EDIT_GC_SUCCESS,
Messages.formatGradedComponent(editedGradedComponent)));
}

Expand Down Expand Up @@ -140,7 +140,7 @@ private EditStudentScoreDescriptor createStudentScoreDescriptor(StudentScore sc,
* Creates and returns a {@code GradedComponent} with the details of {@code gradedComponentToEdit}
* edited with {@code editGradedComponentDescriptor}.
*/
private static GradedComponent createEditedGradedComponent(GradedComponent gradedComponentToEdit,
public static GradedComponent createEditedGradedComponent(GradedComponent gradedComponentToEdit,
EditGradedComponentDescriptor editGradedComponentDescriptor) {
assert gradedComponentToEdit != null;

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/seedu/modulight/model/student/Student.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ public boolean equals(Object other) {

Student otherStudent = (Student) other;
return sid.equals(otherStudent.sid) && name.equals(otherStudent.name) && email.equals(otherStudent.email)
&& tg.equals(otherStudent.tg) && tags.equals(otherStudent.tags)
&& scoreList.equals(otherStudent.scoreList);
&& tg.equals(otherStudent.tg) && tags.equals(otherStudent.tags);
}

@Override
Expand Down
9 changes: 3 additions & 6 deletions src/main/java/seedu/modulight/ui/GradedComponentCard.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package seedu.modulight.ui;

import java.text.DecimalFormat;

import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
Expand Down Expand Up @@ -55,10 +53,9 @@ public GradedComponentCard(GradedComponent gradedComponent, int displayedIndex)

float meanAbsoluteScore = gradedComponent.getMeanAbsoluteScore();
float meanRelativeScore = gradedComponent.getMeanRelativeScore();
DecimalFormat df = new DecimalFormat("#.#");
Label meanScoreLabel =
new Label("Mean: " + df.format(meanAbsoluteScore) + "/"
+ gradedComponent.getMaxMarks() + " (" + df.format(meanRelativeScore) + "%)");

Label meanScoreLabel = new Label(String.format("Mean: %.1f", meanAbsoluteScore) + "/"
+ gradedComponent.getMaxMarks() + " (" + String.format("%.1f", meanRelativeScore) + "%)");
meanScoreLabel.getStyleClass().add("cell_small_label");
gradedComponentBox.getChildren().add(meanScoreLabel);

Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/view/MainWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<VBox styleClass="pane-with-border" VBox.vgrow="ALWAYS" HBox.hgrow="ALWAYS" minHeight="500">
<VBox VBox.vgrow="ALWAYS" HBox.hgrow="ALWAYS">
<HBox minHeight="40" maxHeight="40" VBox.vgrow="ALWAYS" HBox.hgrow="ALWAYS">
<VBox styleClass="pane-with-border-custom" minWidth="120" prefWidth="220" alignment="BASELINE_CENTER" HBox.hgrow="ALWAYS" VBox.vgrow="ALWAYS">
<VBox styleClass="pane-with-border-custom" minWidth="200" prefWidth="300" alignment="BASELINE_CENTER" HBox.hgrow="ALWAYS" VBox.vgrow="ALWAYS">
<Label text="Graded Components" styleClass="pane-header-text"></Label>
</VBox>
<VBox styleClass="pane-with-border-custom" minWidth="200" prefWidth="300" alignment="BASELINE_CENTER" HBox.hgrow="ALWAYS" VBox.vgrow="ALWAYS">
Expand All @@ -62,7 +62,7 @@
</VBox>
</HBox>
<HBox fx:id="ppl2" minWidth="520" prefWidth="820" HBox.hgrow="ALWAYS" styleClass="pane-with-border" VBox.vgrow="ALWAYS">
<VBox fx:id="gradedComponentList" styleClass="pane-with-border" minWidth="120" prefWidth="220" HBox.hgrow="ALWAYS" VBox.vgrow="ALWAYS" >
<VBox fx:id="gradedComponentList" styleClass="pane-with-border" minWidth="200" prefWidth="300" HBox.hgrow="ALWAYS" VBox.vgrow="ALWAYS" >
<padding>
<Insets top="10" right="10" bottom="10" left="10" />
</padding>
Expand Down
Loading

0 comments on commit 437ef95

Please sign in to comment.