Skip to content

Extend voting interface to allow score #609

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 25, 2017
Merged

Conversation

hvr
Copy link
Member

@hvr hvr commented Aug 21, 2017

This extends the package voting mechanism from boolean "stars"
to integral "lambdas", and using the statistical method outlined
in

to compute an overall score.

This has been factored out of the HSoC work #514 by @sooryan

The code has been refactored & cleaned up by Duncan, Gershom and myself.


TODOs:

  • Validate vote-update HTTP request data (you can currently vote an arbitrary rating other than {1,2,3})

This extends the package voting mechanism from boolean "stars"
to integral "lambdas", and using the statistical method outlined
in

  http://www.evanmiller.org/how-not-to-sort-by-average-rating.html

to compute an overall score.

This has been factored out of the HSoC work haskell#514 by @sooryan

The code has been refactored & cleaned up by Duncan, Gershom and myself.

NOTE: Detecting non-anonymous users to display the user's current vote
      doesn't work yet. This will be fixed at some later point.
@hvr hvr requested a review from gbaz August 21, 2017 21:43
Copy link
Contributor

@gbaz gbaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, aside from the vote checking issue you mentioned. I suggest just capping scores at 1 and 3 -- i.e. normalize "too big" things rather than bothering to fail.

Actually: one other issue. the new auth functions that return a userid seem broken... investigating.

@gbaz
Copy link
Contributor

gbaz commented Aug 22, 2017

Ok, it turns out the "new auth" thing i did never worked right. Sigh. In particular, we can only ever guard and not check authentication, as browsers don't necessarily send an auth header unless challenged.

That means we can't check if a user is logged-in opportunistically on a page and display different content in either case. However, in this case we could write some further javascript to fix it up. I propose for now just deleting the new Auth stuff and the code that uses it to insert userRating into page, as its broken.

I think we can merge without it, and I can add the displaying stuff back as a feature the "right" way.

@hvr hvr merged commit 8cd49e0 into haskell:master Aug 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants