Download & Extend

More than one question

Project:Advanced Poll
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

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

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

Thanks,
Michele

Comments

#1

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?

#2

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

#3

Category:support request» feature request

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

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.

#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

#20

Status:active» needs review

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.

AttachmentSize
advpoll-multirate_polls-156783-20.patch 26.21 KB

#21

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,

#22

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.

#23

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.

#24

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

#25

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...:)

#26

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

#27

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"

AttachmentSize
advpoll.install.txt 16.37 KB
multirate.inc_.txt 10.4 KB
advpoll-display-multirate-form.tpl_.php_.txt 637 bytes
advpoll.pages_.inc_.txt 8.05 KB
advpoll.module.txt 65.25 KB
advpoll.css_.txt 2.3 KB

#28

and patch

AttachmentSize
advpoll-multirate_polls-156783-20.patch 26.83 KB

#29

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....

nobody click here