Examples of SurveySection


Examples of com.denimgroup.threadfix.data.entities.SurveySection

    return level;
  }

  private SurveySection constructSection(Element sectionElement) {
    SurveySection section = new SurveySection();
    section.setSectionName(sectionElement.attributeValue("name"));
    section.setColor(sectionElement.attributeValue("color"));
    section.setLightColor(sectionElement.attributeValue("lightColor"));

    for (Object practiceElement : sectionElement.elements("practice")) {
      section.getSurveyPractices().add(constructPractice((Element) practiceElement));
    }

    for (SurveyPractice practice : section.getSurveyPractices()) {
      practice.setSurveySection(section);
    }

    return section;
  }
View Full Code Here

Examples of org.encuestame.persistence.domain.survey.SurveySection

        try {
            if (sectionId == null) {
                log.debug("survey section id is missing");
            } else {
                final SurveySection section = getSurveyService()
                        .retrieveSurveySectionById(sectionId);
                final QuestionPattern questionPattern = QuestionPattern
                        .getQuestionPattern(pattern);
                final UserAccount account = getUserAccount();
                final Question questionAdded = getSurveyService().addQuestionToSurveySection(question,
View Full Code Here

Examples of org.encuestame.persistence.domain.survey.SurveySection

   */
  @Test
  public void testAddQuestionToSurveySection() throws ServletException,
      IOException {
    Assert.assertNotNull(survey);
    final SurveySection section1 = createDefaultSection("SurveySection 2",
        this.survey);
    final String question = "What is your marital status?";
    // Search All surveys.
    initService("/api/survey/addquestion.json", MethodJson.GET);
    setParameter("ssid", section1.getSsid().toString());
    setParameter("pattern", QuestionPattern.MULTIPLE_SELECTION.toString());
    setParameter("question", question);

    final JSONObject response = callJsonService();
    // assertSuccessResponse(response);
View Full Code Here

Examples of org.encuestame.persistence.domain.survey.SurveySection

     * Create Survey Section.
     * @param surveySectionBean
     */
  public SurveySection createSurveySection(
      final UnitSurveySection surveySectionBean, final Survey survey) {
    SurveySection surveySectionDomain = new SurveySection();
    
      surveySectionDomain = this
          .newSurveySection(surveySectionBean, survey);
    return surveySectionDomain;
  }
View Full Code Here

Examples of org.encuestame.persistence.domain.survey.SurveySection

     * @param sectionBean
     * @param survey
     * @return
     */
    private SurveySection newSurveySection(final UnitSurveySection sectionBean, final Survey survey){
      final SurveySection surveySection = new SurveySection();
    surveySection.setDescSection(sectionBean.getDescription());
    surveySection.setSectionName(sectionBean.getName());
    surveySection.setSurvey(survey);
    getSurveyDaoImp().saveOrUpdate(surveySection);
      return surveySection;
     
    }
View Full Code Here

Examples of org.encuestame.persistence.domain.survey.SurveySection

   * (non-Javadoc)
   * @see org.encuestame.core.service.imp.ISurveyService#retrieveSurveySectionById(java.lang.Long)
   */
  public SurveySection retrieveSurveySectionById(final Long sectionId)
      throws EnMeSurveyNotFoundException {
    final SurveySection section = getSurveyDaoImp()
        .retrieveSurveySectionById(sectionId);
    if (section == null) {
      throw new EnMeSurveyNotFoundException(
          "Section not found with this id: " + sectionId);
    } else {
View Full Code Here

Examples of org.encuestame.persistence.domain.survey.SurveySection

     * @param descSection
     * @return
     */
    public SurveySection createSurveySection(
            final String descSection){
        final SurveySection surveySection = new SurveySection();
        surveySection.setDescSection(descSection);
      /*  surveySection.getQuestionSection().add(createDefaultQuestion("Why is your favourite movie"));
        surveySection.getQuestionSection().add(createDefaultQuestion("Where do you live"));
        surveySection.getQuestionSection().add(createDefaultQuestion("What do you do at home"));*/
        getSurveyDaoImp().saveOrUpdate(surveySection);
        return surveySection;
View Full Code Here

Examples of org.encuestame.persistence.domain.survey.SurveySection

     * @param name
     * @param survey
     * @return
     */
    public SurveySection createDefaultSection(final String name, final Survey survey){
        final SurveySection surveySection = new SurveySection();
        surveySection.setDescSection(name);
        surveySection.setSurvey(survey);
        surveySection.setSectionName(name);
        getSurveyDaoImp().saveOrUpdate(surveySection);
        return surveySection;
    }
View Full Code Here

Examples of org.encuestame.persistence.domain.survey.SurveySection

  @Test
  public void testAddQuestionToSurveySection() throws EnMeExpcetion,
      NoSuchAlgorithmException, UnsupportedEncodingException {
    final String questionName = "What is your favorite superhero?";
    final Survey defaultSurvey = createDefaultSurvey(this.user);
    final SurveySection defaultSection = createDefaultSection("Comics",
        defaultSurvey);

    final Question questionAdded = surveyService
        .addQuestionToSurveySection(questionName, userSecondary,
            defaultSection, QuestionPattern.MULTIPLE_SELECTION,
            null);

    assertEquals("should be equals", defaultSection.getSsid(),
        questionAdded.getSection().getSsid());
  }
View Full Code Here

Examples of org.encuestame.persistence.domain.survey.SurveySection

    /**
     * Test Retrieve Survey Section by Id.
     */
    @Test
    public void testRetrieveSurveySectionById(){
        final SurveySection section = getSurveyDaoImp().retrieveSurveySectionById(surveySection.getSsid());
        assertEquals("Should be equals", "My Section", section.getDescSection());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.