Is it possible to have a Poll with more than one question?

For example, three questions, each with three possible choise.

Thanks,
Michele

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

anders.fajerson’s picture

Version: 5.x-1.0-beta4 » 5.x-1.x-dev

No, it's not possible. Could you give an practical example were this could be useful?

NancyDru’s picture

How about an election ballot? Or how about "If you voted yes above, then select from these choices..."

anders.fajerson’s picture

Category: support » feature

Thinking about it, it might such a big shift in the codebase after all, at least not database wise. The title that we now use for the question has to be changed to a regular title, something I support anyway (currently I write the question at the end in the description field for my polls).

Database wise we introduce a new field, e.g. 'qid' (question id) and 'question' in the advpoll table to support many questions.

anders.fajerson’s picture

On third thoughts: VotingAPI, which advpoll depends on, would not support this.

NancyDru’s picture

How about chaining questions? For example, if the answer to question 1 is "yes," then show question 2, otherwise show question 3 or stop.

michemon’s picture

Normally when a poll is organized, it is never composed by one question.
You have a set of questions and for each question some choisis...

More than this (but this is not my initial request) you can have different questions depending of your preceding answers, as nancyw wrote.

Now the Poll content or the AdvPoll content are simply a part o a real poll.
So maybe constructing a content composed by different advpoll content, could give an answer to my question??

What do you thik about it?

g011um’s picture

Elections is what I was hoping to use this module for as well. We hold a lot of online elections (for committee representation etc) but would need a system that would allow more than one question on a single "ballot". The original "three questions, each with three possible choices" is an excellent example -- 3 positions open on the committee, each with 3 different staff members running for election.

We'd also see the ability to pick differing numbers of candidates for each ballot question a must. i.e. For "Position One" on the ballot, allow the choice of your top 2 candidates; for "Position Two" and "Position Three", allow only 1.

If VotingAPI really only supports a single "poll", then I think michemon's suggestion of pulling together multiple AdvancedPoll questions into a single "ballot". Voting would then just loop through the questions using VotingAPI to register the votes for each individually.

ChrisKennedy’s picture

I suspect this would basically be possible if we supported cck and/or interfaced with http://drupal.org/project/webform

But, I should point out that if you're electing multiple positions to the same committee, it's better to do so by creating a single poll and then electing the top N candidates to those positions. Ideally you would use CPO-STV rather than the currently supported ranking algorithms; IRV or BC are okay though.

anders.fajerson’s picture

UI wise CCK would work for this. I don't know much about CCK, but I still can't see how the votes would be recorded by Voting API, as the recording of votes is using the node id (content_id). If there are several polls on the same node, which conten_id would you save in Voting API? Can you save the same id and still calculate the result?

There is a poll field for CCK though (I don't know how it records its votes): http://drupal.org/project/pollfield. That might be an option for some people (and let us focus on more important stuff ;) ).

ChrisKennedy’s picture

I was thinking that we might be able to store a field_id in content_id and then have a separate id for each field instance, as well as a mapping of node ids to field ids.

NancyDru’s picture

I sort of created a multiple vote "ballot" by using a vocabulary and a taxonomy/term/xxx menu entry.

NancyDru’s picture

What is "CPO-STV"

anders.fajerson’s picture

I had no idea but I used google: http://en.wikipedia.org/wiki/CPO-STV

jdleonard’s picture

I'm willing to help develop this, but I guess I need a little more direction before I do anything.

anders.fajerson’s picture

vinegar5: nice!

I'm no sure if this qualifies as direction, but here are some thoughts:

I first thought that CCK would be perfect for this: be able to create a custom node type that could hold e.g. 5 binary polls and 3 ranking polls. Then I realised that the functionality people is asking for may not be that but instead is more similair to e.g. quiz module: be able to create a node and then add X number of polls to it. I suspect the latter (quiz style) to be more complicated to implement (but maybe not).

Chris had some ideas how to store the votes in comment #10.

jdleonard’s picture

Apparently I don't have time to get around to this. Sorry to anyone who's been waiting!

jdleonard’s picture

I know it has been a while, but perhaps people are ready for another look at this. Would it be possible to provide a new content type, "Multi-poll" or something, that would allow the user to select and order existing advpoll nodes. In the use case of elections, the multi-poll would combine each selected node into one "ballot" with only one submit button. Validation would have to pass for all of the selected nodes for the vote to be registered. I have no idea how to implement this strategy though. Thoughts and suggestions?

ChrisKennedy’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev

I think the easiest way to figure this out is to look at how http://drupal.org/project/webform handles this issue and apply it to Advpoll, provided that webform works well. We might need to support advpoll-as-a-field first though, which would be awesome.

ericbroder’s picture

Thank you ChrisKennedy for your generous contributions to the Drupal community. I am curious what you mean by "if we supported cck". Does this have something to do with the issue I filed?

#584018: CCK field won't save when I create a new node

Thanks,
Eric

Agileware’s picture

Status: Active » Needs review
FileSize
26.21 KB

A while ago I created this patch for a client but never had time to submit it back to drupal.org.

Now I have to upgrade the site to drupal 6 so I have ported my old patch to drupal 6.
So here it is.

I see lots of different ideas about what this issue would implement but I think my patch is relevant to this issue.

The patch adds a new poll type multirate, which allows voting on multiple criteria.
For example, a poll might be:
How would you rate drupal.org on the following?
Performance: 1 2 3 4 5
Ease of use: 1 2 3 4 5
Accessibility: 1 2 3 4 5
Design: 1 2 3 4 5

Then the user votes on each criteria and submits.

Admins can choose the criterion, how many options there will be for each criteria, whether or not to display an overall score in addition to the individual criteria scores, the labels for the min and max vote etc.

Currently it doesn't support write ins but that would not be that hard to add I would imagine.
Users could be able to add write ins, which would each be a new criteria.

Hitby’s picture

Thanks for the patch Agileware...I've run it against 6.x-1.x-dev and it doesn't throw any errors but I don't get the added multirate option in my create content menu. Caches all flushed etc. Am I missing something simple?

Thanks again,

Agileware’s picture

Did all of the patch apply cleanly without any fails?
You also have to run update.php (but that shouldn't stop you from getting the new poll type).

Other than that I can't think of anything else you have to do.

The module has had commits since I posted this so I guess it is possible something has changed in the module that breaks this patch but I'd have to try it out to be sure.

I don't have much time for that at the moment but when I do I'll post my findings back here.

Maedi’s picture

When applying this patch multirate.inc wasn't correctly moved into the modes directory. Moving into this directory will enable the Multirate option (clear cache). I've modified this module to enable Yes or No answers rather than rating. Will submit a patch if I can figure out a nicer way to access Yes and No votes. Currently they are represented as 1's and 2's and a custom function is required to convert them back to yes and nos.

matdab’s picture

Hi, subsrcibing!
Also u can use panel page to make poll-page - just pick-up "existing node" option while building. But there are a few cons:
- view - u have to disable i.e. user name and date of node creation in template
- u won't associate each answers with the responder

Of course the latter is not able now anyway, but... if we would get multianswer advpoll and add to it a "Results tab" (this feature is in decisions module) - then it would be very advanced poll...:)
I have added an issue about that in: http://drupal.org/node/1297194

matdab’s picture

I implemented manually the patch, there was a typo in line 246:
@@ -515,14 +574,14 @@ function advpoll_form(&$node, $form_stat
sholud be:
@@ -515,14 +574,14 @@ function advpoll_form(&$node, $form_state

everything works fine.
I hope some time there will be a way to merge or get all the best from webform, advpoll, decisions, pollfield and quiz...:)

miro_dietiker’s picture

matdab, best you would provide a new patch version...

matdab’s picture

I'm not professional on patches nad their versions, so to happiness of those who, like me, have problems with patch soft (Patch, CVS, SVN, cmd and god knows what else) I will provide also ready files;) Delete endings "txt"

matdab’s picture

and patch

miro_dietiker’s picture

matdab - i think (and most other developers do) ppl need to learn deal with patches in order to successfully participate in development / issues.
Think about ... every single patch ... what happens if developers would upload every changed file separately. That's so much file spam for drupal.org....

Spokenbird’s picture

Issue summary: View changes

Hello,

I realize this conversation is quite old but it seems to be the most in depth as far as discussion of the possibility of multi questions polls. This is a functionality I am looking for and everywhere I search leads back to this conversation. I realize the original conversation is now more than 8 years old, but I wonder, if in that time anyone has figured out a good way to do multi question polls or if another module exists that may have such a functionality?

Thanks!

tripper54’s picture

Status: Needs review » Closed (works as designed)

HI @Spokenbird,

The advanced poll module does not provide what you're looking for.

Without knowing the specifics of your requirements, my advice would be to explore these options:

1. Use webform
2. Quiz module
3. Create your own custom solution using either a node type or a custom entity with fields for questions.

I'm marking this thread 'works as designed', because:

1. No further development is happening on the 6.x branch
2. No new features will be added to the 7.x branch until we have a stable release on and complete test coverage
3. Requests for multiple question polls appear elsewhere in the issue queue.