Package org.encuestame.persistence.domain.survey

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


                    model.put("message", getMessage("poll.closed"));
                    pathVote = "poll/" + isEmbedded + "bad";
                } else {
                    try {
                        model.put("pollAnswer", poll);
                        final PollResult result = getPollService().validatePollIP(IP, poll);
                        if (result == null) {
                            if (poll.getMultipleResponse().equals(AbstractSurvey.MultipleResponse.MULTIPLE)) {
                                for (int i = 0; i < multiplesVotes.length; i++) {
                                    try {
                                        final Long responseIdMultiple = Long.valueOf(multiplesVotes[i]);
View Full Code Here


        log.trace("vote "+poll);
        log.trace("vote "+slug);
        log.trace("vote "+ipAddress);
        log.trace("vote "+answerId);

        final PollResult pr = new PollResult();
        pr.setAnswer(this.getQuestionAnswerById(answerId));
        //validate IP address.
        pr.setIpaddress(ipAddress);
        pr.setPoll(poll);
        pr.setVotationDate(Calendar.getInstance().getTime());
        getPollDao().saveOrUpdate(pr);
    }
View Full Code Here

     * @param questionAnswer {@link QuestionAnswer}
     * @param poll {@link Poll}
     * @return state
     */
    public PollResult createPollResults(final QuestionAnswer questionAnswer, final Poll poll){
        final PollResult pollRes = new PollResult();
        pollRes.setAnswer(questionAnswer);
        pollRes.setIpaddress("127.0.0."+RandomStringUtils.random(10));
        pollRes.setPoll(poll);
        pollRes.setVotationDate(new Date());
        getPollDao().saveOrUpdate(pollRes);
        return pollRes;

    }
View Full Code Here

     * @return
     */
    public PollResult createDefaultPollResults(
            final QuestionAnswer questionAnswer, final Poll poll,
            final String ip) {
        final PollResult result = this.createPollResults(questionAnswer, poll);
        result.setIpaddress(ip);
        getPollDao().saveOrUpdate(result);
        return result;
    }
View Full Code Here

                this.initDate.minusHours(8).toDate());
        final QuestionAnswer qAsnwer = createQuestionAnswer("possible",
                this.question, "3fak34");
        createDefaultPollResults(qAsnwer, poll1, ip);

        final PollResult result = getPollDao().validateVoteIP(ip, poll1);
        assertNotNull(result);
        final PollResult resultNull = getPollDao().validateVoteIP(ip2, poll1);
        Assert.assertNull(resultNull);
    }
View Full Code Here

TOP

Related Classes of org.encuestame.persistence.domain.survey.PollResult

Copyright © 2018 www.massapicom. 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.