in the result management system a trainer can add the marks to particular student who is enrolled for the course he is teching. In my project the trainer can add the marks to other students too who are enrolled for other courses. How to solve this problem
@GetMapping("/addMarks")
public String showAddMarksForm(Model model) {
model.addAttribute("students", studentService.findAllStudents());
model.addAttribute("courses", courseService.findAllCourses());
model.addAttribute("mark", new Mark());
return "add-marks.html";
}
@PostMapping("/saveMark")
public String saveMark(@ModelAttribute Mark mark, Model model) {
markService.saveMark(mark);
model.addAttribute("message", "Marks added successfully");
return "trainer-dashboard.html";
}
I am expecting that trainer can add marks to only students who enrolled for particular trainer courses.
New contributor
SathishSegu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2