public static FeedbackSessionsAdditionalSettingsFormSegment getDefaultFormSegment(PageData data) {
    FeedbackSessionsAdditionalSettingsFormSegment additionalSettings =
        new FeedbackSessionsAdditionalSettingsFormSegment();

    additionalSettings.isSessionVisibleAtOpenChecked = true;
    additionalSettings.isSessionVisibleDateButtonChecked = false;
    additionalSettings.sessionVisibleDateValue = "";
    additionalSettings.isSessionVisibleDateDisabled = true;
    additionalSettings.sessionVisibleTimeOptions = data.getTimeOptionsAsElementTags(null);
    additionalSettings.isSessionVisiblePrivateChecked = false;

    additionalSettings.isResponseVisibleDateChecked = false;
    additionalSettings.responseVisibleDateValue = "";
    additionalSettings.isResponseVisibleDateDisabled = true;
    additionalSettings.responseVisibleTimeOptions = data.getTimeOptionsAsElementTags(null);
    additionalSettings.isResponseVisibleImmediatelyChecked = false;
    additionalSettings.isResponseVisiblePublishManuallyChecked = true;
    additionalSettings.isResponseVisibleNeverChecked = false;

    additionalSettings.isSendClosingEmailChecked = true;
    additionalSettings.isSendOpeningEmailChecked = true;
    additionalSettings.isSendPublishedEmailChecked = true;

    return additionalSettings;
  }
  private String getSubmissionOptionsHtmlForRankingOptions(int rankGiven) {
    StringBuilder result = new StringBuilder();

    ElementTag option = PageData.createOption("", "", rankGiven == Const.INT_UNINITIALIZED);
    result.append(
        "<option" + option.getAttributesToString() + ">" + option.getContent() + "</option>");
    for (int i = 1; i <= options.size(); i++) {
      option = PageData.createOption(String.valueOf(i), String.valueOf(i), rankGiven == i);
      result.append(
          "<option" + option.getAttributesToString() + ">" + option.getContent() + "</option>");
    }

    return result.toString();
  }
  private static void setResponseVisibleSettings(
      PageData data,
      FeedbackSessionAttributes feedbackSession,
      FeedbackSessionsAdditionalSettingsFormSegment additionalSettings) {
    boolean hasResultVisibleDate =
        !TimeHelper.isSpecialTime(feedbackSession.resultsVisibleFromTime);

    additionalSettings.isResponseVisibleDateChecked = hasResultVisibleDate;

    additionalSettings.responseVisibleDateValue =
        hasResultVisibleDate ? TimeHelper.formatDate(feedbackSession.resultsVisibleFromTime) : "";
    additionalSettings.responseVisibleTimeOptions =
        data.getTimeOptionsAsElementTags(
            hasResultVisibleDate ? feedbackSession.resultsVisibleFromTime : null);
    additionalSettings.isResponseVisibleDateDisabled = !hasResultVisibleDate;

    additionalSettings.isResponseVisibleImmediatelyChecked =
        Const.TIME_REPRESENTS_FOLLOW_VISIBLE.equals(feedbackSession.resultsVisibleFromTime);

    additionalSettings.isResponseVisiblePublishManuallyChecked =
        Const.TIME_REPRESENTS_LATER.equals(feedbackSession.resultsVisibleFromTime)
            || Const.TIME_REPRESENTS_NOW.equals(feedbackSession.resultsVisibleFromTime);

    additionalSettings.isResponseVisibleNeverChecked =
        Const.TIME_REPRESENTS_NEVER.equals(feedbackSession.resultsVisibleFromTime);
  }
  private static void setSessionVisibleSettings(
      PageData data,
      FeedbackSessionAttributes feedbackSession,
      FeedbackSessionsAdditionalSettingsFormSegment additionalSettings) {
    boolean hasSessionVisibleDate =
        !TimeHelper.isSpecialTime(feedbackSession.sessionVisibleFromTime);

    additionalSettings.isSessionVisibleAtOpenChecked =
        Const.TIME_REPRESENTS_FOLLOW_OPENING.equals(feedbackSession.sessionVisibleFromTime);
    additionalSettings.isSessionVisiblePrivateChecked =
        Const.TIME_REPRESENTS_NEVER.equals(feedbackSession.sessionVisibleFromTime);

    additionalSettings.isSessionVisibleDateButtonChecked = hasSessionVisibleDate;
    additionalSettings.sessionVisibleDateValue =
        hasSessionVisibleDate ? TimeHelper.formatDate(feedbackSession.sessionVisibleFromTime) : "";
    additionalSettings.isSessionVisibleDateDisabled = !hasSessionVisibleDate;
    additionalSettings.sessionVisibleTimeOptions =
        data.getTimeOptionsAsElementTags(
            hasSessionVisibleDate ? feedbackSession.sessionVisibleFromTime : null);
  }