diff --git a/src/main/java/seedu/address/ui/ModuleListPanel.java b/src/main/java/seedu/address/ui/ModuleListPanel.java index ca8492a0723..cb76125198f 100644 --- a/src/main/java/seedu/address/ui/ModuleListPanel.java +++ b/src/main/java/seedu/address/ui/ModuleListPanel.java @@ -58,7 +58,7 @@ protected void updateItem(Module module, boolean empty) { setGraphic(null); setText(null); } else { - setGraphic(new ModuleSummaryCard(module).getRoot()); + setGraphic(new ModuleSummaryCard(module, getIndex() + 1).getRoot()); } } } diff --git a/src/main/java/seedu/address/ui/ModuleSummaryCard.java b/src/main/java/seedu/address/ui/ModuleSummaryCard.java index 2d881f58352..a1686f68bf9 100644 --- a/src/main/java/seedu/address/ui/ModuleSummaryCard.java +++ b/src/main/java/seedu/address/ui/ModuleSummaryCard.java @@ -41,11 +41,11 @@ public class ModuleSummaryCard extends UiPart { /** * Creates a {@code ModuleCode} with the given {@code Module} and index to display. */ - public ModuleSummaryCard(Module module) { + public ModuleSummaryCard(Module module, int displayedIndex) { super(FXML); this.module = module; + id.setText(displayedIndex + ". "); String moduleHeader = module.getCode().toString(); - if (module.getName().isPresent()) { moduleHeader += String.format(" %s", module.getName().get()); }