private static List<FeedbackParticipantType> getParticipantListFromParams(String params) {

    List<FeedbackParticipantType> list = new ArrayList<FeedbackParticipantType>();

    if (params.isEmpty()) {
      return list;
    }

    String[] splitString = params.split(",");

    for (String str : splitString) {
      list.add(FeedbackParticipantType.valueOf(str));
    }

    return list;
  }
  private static FeedbackQuestionAttributes extractFeedbackQuestionData(
      Map<String, String[]> requestParameters) {
    FeedbackQuestionAttributes newQuestion = new FeedbackQuestionAttributes();

    newQuestion.setId(
        HttpRequestHelper.getValueFromParamMap(
            requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_ID));
    Assumption.assertNotNull("Null question id", newQuestion.getId());

    newQuestion.courseId =
        HttpRequestHelper.getValueFromParamMap(requestParameters, Const.ParamsNames.COURSE_ID);
    Assumption.assertNotNull("Null course id", newQuestion.courseId);

    newQuestion.feedbackSessionName =
        HttpRequestHelper.getValueFromParamMap(
            requestParameters, Const.ParamsNames.FEEDBACK_SESSION_NAME);
    Assumption.assertNotNull("Null feedback session name", newQuestion.feedbackSessionName);

    // TODO thoroughly investigate when and why these parameters can be null
    // and check all possibilities in the tests
    // should only be null when deleting. might be good to separate the delete action from this
    // class

    // Can be null
    String giverType =
        HttpRequestHelper.getValueFromParamMap(
            requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_GIVERTYPE);
    if (giverType != null) {
      newQuestion.giverType = FeedbackParticipantType.valueOf(giverType);
    }

    // Can be null
    String recipientType =
        HttpRequestHelper.getValueFromParamMap(
            requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_RECIPIENTTYPE);
    if (recipientType != null) {
      newQuestion.recipientType = FeedbackParticipantType.valueOf(recipientType);
    }

    String questionNumber =
        HttpRequestHelper.getValueFromParamMap(
            requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_NUMBER);
    Assumption.assertNotNull("Null question number", questionNumber);
    newQuestion.questionNumber = Integer.parseInt(questionNumber);

    // Can be null
    String nEntityTypes =
        HttpRequestHelper.getValueFromParamMap(
            requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFENTITIESTYPE);
    if (numberOfEntitiesIsUserDefined(newQuestion.recipientType, nEntityTypes)) {
      String nEntities;
      nEntities =
          HttpRequestHelper.getValueFromParamMap(
              requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFENTITIES);
      Assumption.assertNotNull(nEntities);
      newQuestion.numberOfEntitiesToGiveFeedbackTo = Integer.parseInt(nEntities);
    } else {
      newQuestion.numberOfEntitiesToGiveFeedbackTo = Const.MAX_POSSIBLE_RECIPIENTS;
    }

    newQuestion.showResponsesTo =
        getParticipantListFromParams(
            HttpRequestHelper.getValueFromParamMap(
                requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_SHOWRESPONSESTO));
    newQuestion.showGiverNameTo =
        getParticipantListFromParams(
            HttpRequestHelper.getValueFromParamMap(
                requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_SHOWGIVERTO));
    newQuestion.showRecipientNameTo =
        getParticipantListFromParams(
            HttpRequestHelper.getValueFromParamMap(
                requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_SHOWRECIPIENTTO));

    String questionType =
        HttpRequestHelper.getValueFromParamMap(
            requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_TYPE);
    Assumption.assertNotNull(questionType);
    newQuestion.questionType = FeedbackQuestionType.valueOf(questionType);

    // Can be null
    String questionText =
        HttpRequestHelper.getValueFromParamMap(
            requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_TEXT);
    if (questionText != null) {
      FeedbackAbstractQuestionDetails questionDetails =
          FeedbackAbstractQuestionDetails.createQuestionDetails(
              requestParameters, newQuestion.questionType);
      newQuestion.setQuestionDetails(questionDetails);
    }

    return newQuestion;
  }