Examples of QuestionAnswerBean


Examples of org.encuestame.utils.web.QuestionAnswerBean

            log.debug("action ANSWER--->"+type);
            if ("add".equals(type)) {
                if ((answer.isEmpty()) || (answer == null)) {
                       throw new EnmeFailOperation("Answer can not valid");
                } else {
                     final QuestionAnswerBean answerBean = new QuestionAnswerBean(answer);
                     if (shortUrl == null || shortUrl.isEmpty()) {
                         shortUrl = EnMePlaceHolderConfigurer.getProperty("short.default");
                     }
                     answerBean.setShortUrlType(ShortUrlProvider.get(shortUrl));
                     log.debug("new answer bean:{ "+answerBean.toString());
                     final TweetPollSwitch tweetPollSwitch = getTweetPollService()
                           .createTweetPollQuestionAnswer(answerBean, tweetPoll, request);
                     log.debug("new answer bean DOMAIN "+tweetPollSwitch.toString());
                     //log.debug("action questionAnswer "+questionAnswer);
                     jsonResponse.put("newAnswer", ConvertDomainBean.convertTweetPollSwitchToBean(tweetPollSwitch, request));
View Full Code Here

Examples of org.encuestame.utils.web.QuestionAnswerBean

    /**
    * Test {@link QuestionAnswerBean}.
    **/
    @Test
    public void testUnitAnswerBean() {
        final QuestionAnswerBean unitAnswer = createUnitAnswerBean(1L, "yes",
                "HASH", 2L);
        assertNotNull(unitAnswer.getAnswerHash());
        assertNotNull(unitAnswer.getAnswers());
        assertNotNull(unitAnswer.getAnswerId());
        assertNotNull(unitAnswer.getUrl());
        assertNotNull(unitAnswer.getQuestionId());
    }
View Full Code Here

Examples of org.encuestame.utils.web.QuestionAnswerBean

     * Test {@link PollBeanResult}.
     */
    @Test
    public void testUnitPollResult(){
        final PollBeanResult pollResult =  new PollBeanResult();
        pollResult.setAnswerBean(new QuestionAnswerBean());
        pollResult.setResult(1L);
        pollResult.setVotedDate(new Date());
        assertNotNull(pollResult.getAnswerBean());
        assertNotNull(pollResult.getResult());
        assertNotNull(pollResult.getVotedDate());
View Full Code Here

Examples of org.encuestame.utils.web.QuestionAnswerBean

     */
    @Test
    public void testHomeBean(){
        final Date myDate = new Date();
        // QuestionAnswerBean
        final QuestionAnswerBean qAnswer2 = createUnitAnswerBean(2L, "No",
                "defg", null);

        // Add QuestionAnswerBean
        final List<QuestionAnswerBean> qAnswerBean = new ArrayList<QuestionAnswerBean>();
        qAnswerBean.add(this.questionAnswer);
View Full Code Here

Examples of org.encuestame.utils.web.QuestionAnswerBean

        final QuestionBean questionBean = new QuestionBean();
        questionBean.setQuestionName(questionName);
        questionBean.setUserId(user.getUid());
        // setting Answers.
        for (int row = 0; row < answers.length; row++) {
            final QuestionAnswerBean answer = new QuestionAnswerBean();
            answer.setAnswers(answers[row].trim());
            answer.setAnswerHash(RandomStringUtils.randomAscii(5));
            questionBean.getListAnswers().add(answer);
        }
        final Question questionDomain = getSurveyService().createQuestion(
                questionBean);
        return questionDomain;
View Full Code Here

Examples of org.encuestame.utils.web.QuestionAnswerBean

    public QuestionAnswerBean createUnitAnswerBean(
        final Long answerId,
        final String answers,
        final String answerHash,
        final Long questionId){
        final QuestionAnswerBean unitAnswerBean = new QuestionAnswerBean();
        unitAnswerBean.setAnswerHash(answerHash);
        unitAnswerBean.setAnswerId(answerId);
        unitAnswerBean.setAnswers(answers);
        unitAnswerBean.setQuestionId(questionId);
        unitAnswerBean.setUrl("http://www.encuestame.org");
        return unitAnswerBean;
    }
View Full Code Here

Examples of org.encuestame.utils.web.QuestionAnswerBean

     *
     * @param text
     * @return
     */
    private QuestionAnswerBean createAnswer(String text) {
        final QuestionAnswerBean answer1 = new QuestionAnswerBean();
        answer1.setAnswers(text);
        return answer1;
    }
View Full Code Here

Examples of org.encuestame.utils.web.QuestionAnswerBean

                List<QuestionAnswerBean> listOfAnswers = question.getListAnswers();
                log.debug("Ansswers in this questions  "+listOfAnswers.size());

                for (QuestionAnswerBean questionAnswerBean : listOfAnswers) {
                    final QuestionAnswerBean answerBean = new QuestionAnswerBean(questionAnswerBean.getAnswers());
                    answerBean.setShortUrlType(ShortUrlProvider.NONE);
                    //create tweetpoll swithch
                    final TweetPollSwitch tweetPollSwitch = getTweetPollService().createTweetPollQuestionAnswer(answerBean, tweetPollDomain, null);
                    double totalVotes = getRandomNumberRange(0, EnMePlaceHolderConfigurer.getIntegerProperty("demo.votes.by.tppoll")) - 1;
                    log.debug(totalVotes+" Votes for this tweetpolls switch id "+tweetPollSwitch.getSwitchId());
                    for (int i = 0; i < totalVotes; i++) {
View Full Code Here

Examples of org.encuestame.utils.web.QuestionAnswerBean

        myTpBean, "What is your favourite city?",
        getSpringSecurityLoggedUserAccount(), null);
    final Question myQuestion = createQuestion(
        "What is your favourite city", "pattern");

    final QuestionAnswerBean qAnswerBean = createAnswersBean("26354",
        "Yes", myQuestion.getQid());
    final QuestionAnswerBean qAnswerBean2 = createAnswersBean("26355",
        "No", myQuestion.getQid());

    final TweetPollSwitch pollSwitch = tweetPollService
        .createTweetPollQuestionAnswer(qAnswerBean, myTweetPoll, null);
    final TweetPollSwitch pollSwitch2 = tweetPollService
View Full Code Here

Examples of org.encuestame.utils.web.QuestionAnswerBean

        dt.toDate(), this.userAccount, myQuestion);
    myTweetPoll.setLimitVotesEnabled(Boolean.TRUE);
    myTweetPoll.setLimitVotes(2);
    getTweetPoll().saveOrUpdate(myTweetPoll);

    final QuestionAnswerBean qAnswerBean = createAnswersBean("26354",
        "Yes", myQuestion.getQid());
    final QuestionAnswerBean qAnswerBean2 = createAnswersBean("26355",
        "No", myQuestion.getQid());

    final TweetPollSwitch pollSwitch = tweetPollService
        .createTweetPollQuestionAnswer(qAnswerBean, myTweetPoll, null);
    final TweetPollSwitch pollSwitch2 = tweetPollService
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.