class QuestionSetupCompetitionServiceImpl extends BaseTransactionalService implements QuestionSetupCompetitionService {

    @Override
    @Transactional
    public ServiceResult<CompetitionSetupQuestionResource> update(CompetitionSetupQuestionResource competitionSetupQuestionResource) {
        Long questionId = competitionSetupQuestionResource.getQuestionId();
        Question question = questionRepository.findById(questionId).get();

        if (question.getQuestionSetupType() != QuestionSetupType.APPLICATION_DETAILS) {
            question.setShortName(competitionSetupQuestionResource.getShortTitle());
        }
        question.setName(competitionSetupQuestionResource.getTitle());
        question.setDescription(competitionSetupQuestionResource.getSubTitle());
        question.setAssessorMaximumScore(competitionSetupQuestionResource.getScoreTotal());

        /* form inputs */
        markTextAreaAsActiveOrInactive(questionId, competitionSetupQuestionResource);
        markMultipleChoiceAsActiveOrInactive(questionId, competitionSetupQuestionResource);
        markAppendixAsActiveOrInactive(questionId, competitionSetupQuestionResource);
        markTemplateUploadAsActiveOrInactive(questionId, competitionSetupQuestionResource);
        markScoredAsActiveOrInactive(questionId, competitionSetupQuestionResource);
        markWrittenFeedbackAsActiveOrInactive(questionId, competitionSetupQuestionResource);
        markResearchCategoryQuestionAsActiveOrInactive(questionId, competitionSetupQuestionResource);
        markScopeAsActiveOrInactive(questionId, competitionSetupQuestionResource);

        return serviceSuccess(competitionSetupQuestionResource);
    }

}