From 4816e14f3b8e22b76a9ee49129cae6818c5127da Mon Sep 17 00:00:00 2001 From: qinxutan Date: Wed, 10 Apr 2024 14:30:33 +0800 Subject: [PATCH] Append studentid for class list students --- .../address/logic/commands/ListStudentsOfClassCommand.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/seedu/address/logic/commands/ListStudentsOfClassCommand.java b/src/main/java/seedu/address/logic/commands/ListStudentsOfClassCommand.java index 3807ed835c2..749993db3fc 100644 --- a/src/main/java/seedu/address/logic/commands/ListStudentsOfClassCommand.java +++ b/src/main/java/seedu/address/logic/commands/ListStudentsOfClassCommand.java @@ -54,7 +54,8 @@ public CommandResult execute(Model model) throws CommandException { StringBuilder result = new StringBuilder(); result.append("Module: ").append(module).append(", Tutorial Class: ") .append(tutorialClass).append("\nStudents: "); - existingTutorialClass.getStudents().forEach(student -> result.append(student.getName()).append(", ")); + existingTutorialClass.getStudents().forEach(student -> result.append(student.getName()) + .append(" (ID: ").append(student.getStudentId()).append("), ")); model.getAddressBook().setStudentsInTutorialClass(existingTutorialClass); return new CommandResult(result.toString().trim()); }