Class QuestionDAO

    • Field Detail

      • ROLE

        public static final String ROLE
        The Avalon role
    • Method Detail

      • getQuestion

        public Map<String,​ObjectgetQuestion​(String id)
        Gets properties of a survey question
        Parameters:
        id - The id of the survey question
        Returns:
        The properties
      • createQuestion

        public Map<String,​StringcreateQuestion​(Map<String,​Object> values)
        Creates a survey question.
        Parameters:
        values - The question's values
        Returns:
        The id of the created survey question, the id of the page and the id of the survey
      • editQuestion

        public Map<String,​StringeditQuestion​(Map<String,​Object> values)
        Edits a survey question.
        Parameters:
        values - The question's values
        Returns:
        The id of the edited survey question, the id of the page and the id of the survey
      • copyQuestion

        public Map<String,​StringcopyQuestion​(String pageId,
                                                     String questionId)
        Copies and pastes a survey question.
        Parameters:
        pageId - The id of the page, target of the copy
        questionId - The id of the question to copy
        Returns:
        The id of the created question, the id of the page and the id of the survey
      • deleteQuestion

        public Map<String,​StringdeleteQuestion​(String id)
        Deletes a survey question.
        Parameters:
        id - The id of the survey question to delete
        Returns:
        The id of the deleted survey question, the id of the page and the id of the survey
      • addRule

        public Map<String,​ObjectaddRule​(String id,
                                                String option,
                                                String rule,
                                                String page)
        Adds a new rule to a question.
        Parameters:
        id - _resolver.resolveById(id);
        option - The option
        rule - The rule type
        page - The page to jump or skip
        Returns:
        An empty map, or an error
      • deleteRule

        public Map<String,​ObjectdeleteRule​(String id,
                                                   String option)
        Deletes a rule to a question.
        Parameters:
        id - _resolver.resolveById(id);
        option - The option to delete
        Returns:
        An empty map
      • getRules

        public Map<String,​ObjectgetRules​(String id,
                                                 int number)
        Gets the rules for a survey question.
        Parameters:
        id - The id of the survey question.
        number - The question number
        Returns:
        The rules