lml / quadbase

Quadbase.org - Question Banking Made Easy
quadbase.org
Other
18 stars 11 forks source link

Add ability to vote "+1, -1 / thumbs up or down" on more things #12

Open jpslav opened 13 years ago

jpslav commented 13 years ago

I think we already have votes for solutions. We also want votes for published questions and comments. Others?

zapcannon99 commented 12 years ago

I think that would all that we would vote for, unless you want a thumbs up/down for the website in it's entirety.

This seems ok, let me try to do this issue

Dantemss commented 12 years ago

Take a look at all the "votable" stuff in routes.rb and in the solutions.

zapcannon99 commented 12 years ago

thanks I will take a look at them

zapcannon99 commented 12 years ago

do you want to be able to vote on individual question parts of multipart questions?

Dantemss commented 12 years ago

I would say just allow voting on the questions themselves (not the question_part objects) if they are published. You would have to change the multipart UI to make this easier for the user.

Let's see what JP thinks.

zapcannon99 commented 12 years ago

mkay, for not I will just do the questions themselves It also seems like comments already have voting implemented

jpslav commented 12 years ago

Just vote on multiparts as a whole, not the individual parts.

Voting on comments really doesn't work?

On May 30, 2012, at 10:55 AM, zapcannon99 wrote:

except that the voting on comments doesn't work....


Reply to this email directly or view it on GitHub: https://github.com/lml/quadbase/issues/12#issuecomment-6013590

zapcannon99 commented 12 years ago

well for some reason I get a red bar saying "user has already been taken" what's that supposed to mean?

zapcannon99 commented 12 years ago

I was logged on as Alice btw all the other users seem to work

Dantemss commented 12 years ago

It seems to be complaining about the validation:

validates_uniqueness_of :user_id, :scope => :votable_id

in vote.rb

We probably want to keep this validation (one vote per user per votable), so if you can figure out why it's failing.

zapcannon99 commented 12 years ago

sure thing

jpslav commented 12 years ago

I think you shouldn't even be allowed to click thumbs up or down if you've already voted. So the validation check in the model is correctly preventing you from voting again, but we should change the UI so that you can't even try to vote again (gray out the thumbs, etc).

Dantemss commented 12 years ago

The vote methods are supposed to automatically update any existing votes when used or create a new vote if it doesnt exist. So it's strange that the vote created that way would fail this validation.

zapcannon99 commented 12 years ago

I can't write tests for views right?

Dantemss commented 12 years ago

Validation occurs in the model, so unit tests should test that.

You can't test how a view "looks" in a test, but you can test that it renders at all in a functional (controller) test. If the view fails to render, the functional test should fail.

zapcannon99 commented 12 years ago

imo 1) I like voting on individual questions, because somewhile the question may be great as a whole, a single part can suck. In addition, if someone imports another question, the voting is carried over. However, I see the merit in only having the main part having the voting. 2) I'm wishy washy, so I like being able to change my vote

Things to add, since we have voting for questions, we should probably add a column that shows the likes/dislikes on the side when searching for questions

zapcannon99 commented 12 years ago

^^^^^ my late opinion

zapcannon99 commented 12 years ago

then I'll be running some tests then