class QuestionGroupController extends QuestionnaireController {

    public String saveQuestionnaire(QuestionGroupDetails questionGroupDetails, int questionGroupIndex, RequestContext requestContext) {
        QuestionGroupDetail questionGroupDetail = questionGroupDetails.getDetails().get(questionGroupIndex);
        try {
            questionnaireServiceFacade.saveResponses(new QuestionGroupDetails(questionGroupDetails.getCreatorId(),
                    questionGroupDetails.getEntityId(), questionGroupDetails.getEventSourceId(), Arrays.asList(questionGroupDetail)));
        } catch (ValidationException e) {
            if (e.hasChildExceptions()) {
                for (ValidationException validationException : e.getChildExceptions()) {
                    if (validationException instanceof MandatoryAnswerNotFoundException) {
                        populateError(requestContext, (MandatoryAnswerNotFoundException) validationException);
                    } else if (validationException instanceof BadNumericResponseException) {
                        populateError(requestContext, (BadNumericResponseException) validationException);
                    }
                }
            }
            return "failure";
        }
        return "success";
    }

    @SuppressWarnings({"UnusedDeclaration"}) public  QuestionGroupController();
    public  QuestionGroupController(QuestionnaireServiceFacade questionnaireServiceFacade);

}