class AssessorCompetitionDashboardController {

    @PostMapping("/dashboard/competition/{competitionId}")
    public String submitAssessments(Model model,
                                    @PathVariable("competitionId") Long competitionId,
                                    UserResource loggedInUser,
                                    @ModelAttribute(FORM_ATTR_NAME) @Valid AssessorCompetitionDashboardAssessmentForm form,
                                    @SuppressWarnings("UnusedParameters") BindingResult bindingResult,
                                    ValidationHandler validationHandler) {

        Supplier<String> renderDashboard = () -> competitionDashboard(model, loggedInUser, competitionId, form);

        return validationHandler.failNowOrSucceedWith(
                renderDashboard,
                () -> {
                    ServiceResult<Void> serviceResult = assessmentService.submitAssessments(form.getAssessmentIds());

                    return validationHandler.addAnyErrors(serviceResult, asGlobalErrors())
                            .failNowOrSucceedWith(renderDashboard, renderDashboard);
                }
        );
    }

}