Overhauling the Vote Up/Down module

Events happening in the community are now at Drupal community events on www.drupal.org.
lut4rp's picture

This project got selected in GSoC 2009. The abstract will be updated soon to reflect our latest plans.
Overview:
Vote Up/Down is a popular and widely used module for most of Drupal's voting requirements. The module was originally written way back in 2006 by Fredrik Jonsson (frjo). It is now maintained by me (lut4rp). I also ported the module to Drupal 6. This proposal aims to make Vote Up/Down the rockstar of all voting modules by accomplishing some very important pending tasks and feature requests.

Description:
The project can be divided into different parts -
Modularization - Voting is currently allowed on nodes and comments. This is hard-coded in the system. A feature request from a user that once came in required users to be able to vote on taxonomy terms. This kind of multi-dimensional voting has prompted the need for an abstracted voting system. Implementations of voting on different "objects" can be written separately and be plugged into core Vote Up/Down. This approach is already being followed by the UpDown module. This will require the existing node and comment voting implementations to be moved outside the main module file.

Widget API - The voting widget that is displayed to the user, is based on a fixed template, images and CSS. This makes it quite difficult for an implementer to customize the widget look as per his/her site design. A widget API will be on the lines of the Drupal theme system. In the manner of adding new themes to Drupal, users should be able to add a set of images and CSS to Vote Up/Down, which would then be selectable from the module settings page.

SimpleTest - The benefits of unit tests in Drupal core have already been seen and felt across the community. Since the rewrite of the Vote Up/Down will have a modular structure which can grow quite big in size, 100% test coverage will be provided to make debugging and testing of the code much easier at later stages.

Upgrade path - It has been decided to deprecate the UpDown module (http://drupal.org/project/updown) in favor of Vote Up/Down. For that, an upgrade path will have to be provided, from UpDown to Vote Up/Down. Also, the UpDown voting widget will need to be included in the bundled widget themes.

Views API Integration - Currently, voting results can be viewed in some preset formats. These are not dynamic and the voting data can't be molded as per need. Integration with Views will provide this data to be mashed up and used anywhere across Drupal.

Mentors:
Simon Roberts (lyricnz) is mentoring this proposal.

Comments

Fantastic write-up and great

aaron's picture

Fantastic write-up and great ideas! This will be very useful to the community, and its implementation should serve as a model for other projects.

Aaron Winborn
Drupal Multimedia (book, in October!)
AaronWinborn.com (blog)
Advomatic (work)

Aaron Winborn
Drupal Multimedia (my book, available now!)
AaronWinborn.com
Advomatic

ingo86's picture

I think that my project idea requires Vote Up/Down module.
Look here: http://groups.drupal.org/node/20098

Previously I though about creating by myself the up and down stuff to vote using the voting API. I see just now that there's already a project, if you run this idea and you wanna rewrite it from the ground some problems may happen during the development of my idea.
With this I only mean: I could use the old stuff or write something by myself, but an integration of both projects should be really really interesting.
How can we solve this project overlap issue?

Thanks for this proposal - I

lyricnz's picture

Thanks for this proposal - I think that unifying the two vote up/down modules is a good idea, especially including an upgrade path. Also, allowing the ability to vote on two-dimensional subjects (eg: items within a node, for example multi-value fields, or taxonomy terms) would be really great - I can see a lot of applications for this!

Simon Roberts
Taniwha Solutions

Simon Roberts
Taniwha Solutions

Please add to the SoC site!

alex ua's picture

I think you are ready to at least move the idea over to the Summer of Code site. It may take some more refinement (I'll let dmitiri chime in there) but either way you should go ahead and put it on the SoC site.

--
Alex Urevick-Ackelsberg
ZivTech: Illuminating Technology

Alex Urevick-Ackelsberg
ZivTech: Illuminating Technology

This proposal needs to be

lyricnz's picture

This proposal needs to be written up "properly" (more concrete goals, and a plan for those) and submitted to GSoC code by the student.

Simon Roberts
Taniwha Solutions

From

lyricnz's picture

From http://socghop.appspot.com/document/show/program/google/gsoc2009/faqs#st... :

# What should a student application look like?
Your application should include the following: your project proposal, why you'd like to execute on this particular project, and the reason you're the best individual to do so. Your proposal should also include details of your academic, industry, and/or open source development experience, and other details as you see fit. An explanation of your development methodology is a good idea, as well. If the organization you want to work with has a specific application template they would like you to use, it will be made available to you to fill in when submitting your proposal via the GSoC web app.

Simon Roberts
Taniwha Solutions

Pretty good, some comments

dmitrig01's picture

I have a couple of questions about some part. Please don't answer these directly, just put them in your proposal.

Modularization - Are you going to implement voting on anything else besides nodes and comments?

Widget API - Are you going to implement any widgets besides the UpDown widget? if so, could you send us mockups?

Views API Integration - How in expenses is the integration going to be? Are you going to do it like five-star? Do you plan to go further? Or less?

Taking a step back

mitchell's picture

Since Vote Up/Down and Fivestar seem to stand out as the best voting widgets/apis, how about focusing on merging them into a Evaluation/Rating Widgets module?

This way, you could use the same code base for organizing vote widgets/displays and their values (not sure if I worded that correctly), but as an example of fivestar running into a similar limitation: http://drupal.org/node/335530

  • Views integration: Fivestar already has: "Easy-to-use integration with Views module for lists sorted by rating, or filtered by min/max ratings."
  • Upgrade path: I really like your idea of having an upgrade path to the overhauling you end up doing.
  • Modularization: Not sure, but I think fivestar already has this too.

I don't think this is a good idea

dmitrig01's picture

Fivestar and UpDown are different modules, that represent votes in different ways. Fivestar does ranking, while UpDown does +1 and optionally -1. Fivestar results only make sense when averaged, but UpDown results only make sense when they're cumulative.

Integration with Triggers and Actions

frjo's picture

Nice initiative lut4rp. Vote up/down seems to be heading in a good direction.

One of the things that originally made Vote up/down popular was, I believe, its integration with Actions and Voting Actions. It made it fairly simply to e.g. make a post with more than 10 votes automatically be promoted to the front page.

Do you have any plans in this direction?

Possible!

lut4rp's picture

Its certainly possible to do this, but I am not really sure if its possible to fit it all in the Summer of Code timeframe. We might end up in scope creep :-)
What I think is possible, is to put it as a tentative feature. That way, I am able to accommodate it, I will. Else, I can always do it after GSoC

Rules module

dmitrig01's picture

I don't think it would be beyond the scope of this proposal to provide rules integration

Votes based on role

sandipdev's picture

Is there any Drupal module which separates votes based on roles? I am making a Drupal site where I want votes to be displayed based on user type.Like in my case, Peer votes, Researcher vote, Corporate votes. basically various types of users can vote on a particular node(in my case its a project) and I need to display votes based on user role. Say 100 votes from Peers, 30 from researchers/faculty etc.

Is there any modules that already does that? My search did not yield anything. So I am doing it myself. I will also apply for this Vote Up/Down in GSoC and add the above mentioned feature into it.

Yay!

niklp's picture

Yup, this is great. Given that it was me who (from a project idea, in conjunction with LyricNZ) decided I needed to vote on terms, this is great news. Hopefully some code will arrive soon enough! :)

Web Development in Nottingham, UK by Kineta Systems / Follow me on Twitter! @NikLP

Yes!

joshk's picture

Please feel free to take the code from http://drupal.org/project/updown also. The vote-up-down maintainer has already signalled his willingness to merge, so someone just needs to put in the hard yards.

http://www.chapterthree.com | http://www.outlandishjosh.com

looks good

vivekkhurana's picture

The idea looks good... I am interested in the upgrade path and the views integration. Lack of views integration has been a barrier in using vote up/down module in few of my projects.

customizing and views

tatere's picture

What you have written up so far sounds pretty good to me. A couple of points - these might be based on misconceptions of the current module, apologies if that's so:

  • We were able to customize the voting widget without too much trouble, except that we have to do theme coding for new content types, since the "disable default" setting is system-wide. What you describe does sound easier. We also ended up needing to customize the ajax javascript file as well, though. As things are now, we had to do that by patching the module code. Someway of allowing a theme to override the default javascript would be helpful.

  • I am not sure what "integration with Views" entails. If it means that I won't have to create a node and vote on it at least once in order to get the vote summary sorting functions enabled in a view on that content type, that would be great. I'd think that's Voting API's problem, though. You're talking about supplying or supplementing those functions?

Do It With Drupal - Digg Screencast

philbar's picture

It should be a goal at some point to create a screencast showing how to duplicate Digg.com using Drupal. This will provide some much needed documentation to drive adoption of this module.

http://www.doitwithdrupal.com/

This screencast can include:

I am looking for the same.

aac's picture

I am looking for the same.

---~~~***~~~---
aac

Recommender system integration?

danithaca's picture

I'm not sure if Vote Up/Down works well with CRE. But I'm working on another SoC project this summer (http://groups.drupal.org/node/19894). Maybe we can join force and submit a patch that add native recommendation support to Vote Up/Down? It shouldn't be that hard, just call functions in the Recommender API like use VotingAPI.

Comments?

Extra voting forms already

Flying Drupalist's picture

Extra voting forms already has a widgety thing. Though I'm not sure if it's up to the standards you're proposing.

This is a nice module, but

Blaze-gdo's picture

This is a nice module, but there is one quite serious fault in my oppinion.
It lacks option to NOT display the voting widget on users own comments. It makes no
sense for that to be as there is an open window for users malpratice with userpoints.
What are your opinion on this matter. Does anyone know how to hide it before I digg
myself into the code.

KirkCaraway's picture

I am currently working on a site where I am trying to use Drupalit, which is similar to Vote Up/Down. However, it seems development on that module has ceased, and that maybe it should turn things over to Vote Up/Down.

The one thing I really need the module to do is to promote items to the front page when a certain number of votes are cast in favor of a node. Since Voting Actions has not been upgraded to D6, it leaves me looking for other solutions. Is there currently a way with Vote Up/Down to do this in D6?

The one thing I liked about Druplit was that it allowed you to give increased voting power to certain roles. In my case, this would allow me to empower designated editors to promote nodes to the front page by simply clicking on the vote widget as they browsed the site. I also want to give paid members of my site increased voting power over non-paid members.

I look forward to seeing this module advance. Thanks.

Youtube style?

tallryn's picture

Would it be possible to user Vote up/down module to create comment system similar to this on youtube.com? What I mean is a system in which comment is collapsed after 5 negative (down) votes.

Is it possible with a different module?

Vote display

Neil Adair's picture

I'd like the option to display the voting results as discrete up and down votes

eg. '-10 +15' instead of '5'

This would provide information about how many votes had been cast plus and minus. It's also clearer and more transparent than the alternative.

eg. '25 votes +5'

Up/Down - as a CCK widget?

tierecke's picture

What about if I want to have Up/Down in a content type -
I'd like to give the user an option to vote up/down on more than one issue.
For instance, I create a Lecture content type and let the student rate:
Was the lecture interesting? (Up/Down)
Did the lecture give you new information? (Up/Down)
Did the lecture start on time? (Up/Down)
Did the lecturer supply enough examples? (Up/Down)
Did the lecturer answered questions? (Up/Down)

etc.

Or "Do you like this photo?" (Yes/No) - this could also be nice...

Wouldn't this be a good feature or do you think that it belongs to another module?

I second this

prabhakarsun's picture

I want to vote on a node reference field, in CCK.

SoC 2009

Group categories

Admin Tags

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: