More than one question
michemon - July 4, 2007 - 16:58
| Project: | Advanced Poll |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Is it possible to have a Poll with more than one question?
For example, three questions, each with three possible choise.
Thanks,
Michele

#1
No, it's not possible. Could you give an practical example were this could be useful?
#2
How about an election ballot? Or how about "If you voted yes above, then select from these choices..."
#3
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.
#4
On third thoughts: VotingAPI, which advpoll depends on, would not support this.
#5
How about chaining questions? For example, if the answer to question 1 is "yes," then show question 2, otherwise show question 3 or stop.
#6
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?
#7
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.
#8
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.
#9
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 ;) ).
#10
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.
#11
I sort of created a multiple vote "ballot" by using a vocabulary and a taxonomy/term/xxx menu entry.
#12
What is "CPO-STV"
#13
I had no idea but I used google: http://en.wikipedia.org/wiki/CPO-STV
#14
I'm willing to help develop this, but I guess I need a little more direction before I do anything.
#15
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.
#16
Apparently I don't have time to get around to this. Sorry to anyone who's been waiting!
#17
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?
#18
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.
#19
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