Class QuestionDAO

All Implemented Interfaces:
LogEnabled, Component, Contextualizable, Serviceable

public class QuestionDAO extends AbstractDAO
DAO for manipulating survey questions.
  • Field Details

    • ROLE

      public static final String ROLE
      The Avalon role
  • Constructor Details

  • Method Details

    • getQuestion

      Gets properties of a survey question
      Parameters:
      id - The id of the survey question
      Returns:
      The properties
    • getQuestion

      Gets properties of a survey question
      Parameters:
      question - The survey question
      Returns:
      The properties
    • createQuestion

      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

      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,String> copyQuestion(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

      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,Object> addRule(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,Object> deleteRule(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,Object> getRules(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