Provide the api for reading and pushing Ratings of apps as well as storage of said ratings

Comments

e2thex’s picture

Issue tags: +sprint candidate

tagging for sprint

jec006’s picture

Assigned: Unassigned » jec006
jec006’s picture

StatusFileSize
new1.6 KB

Here's a first attempt - seems to work pretty well

Vote via a call to: apps/vote/{app machine_name}/{rating (0-5)}
Votes are recorded for each app once per ip - meaning if an ip votes again for an app their initial vote will be overwritten.

Votes are returned from the call in the format:

{
  status: "Vote Successfull",
  message: {
    count: 1,
    average: 4
  }
}

and is also added to the manifests returned from the server like:

[
  {
    name: "dude",
    description: "not a real app",
    screenshots: [ ],
    logo: "http://localhost:8888/drupal/",
    rating: {
      count: 1,
      average: 4
    }
  }
]

This adds a dependency on voting api

jec006’s picture

StatusFileSize
new5.73 KB

Oops, didn't get the new file

Here's a new patch

jec006’s picture

Assigned: jec006 » Unassigned
Status: Active » Needs review
jec006’s picture

StatusFileSize
new5.83 KB

Ok, So I've switch the vote_source to be the client id, which should be unique even if things are hosted on the same server.

Here's the new patch

jec006’s picture

TODO:
1. Change the voting metric from being 1-5 to being percentage based - this way everything will also work with fivestar
2. Add fivestar fields to apps

jec006’s picture

For easier review and testing - i've put the code (including 1 from #7 but not 2) into the branch 7.x-1.0-voting.

see commit here: http://drupalcode.org/project/appserver.git/commitdiff/c7ef6b655bd480942...

jec006’s picture

Obvious issue: Tabs instead of spaces.

Will fix.

jec006’s picture

Fixed tabs issue and pushed to 7.x-1.0-voting

jec006’s picture

It should also be noted that this adds a dependency on voting api - it is in the .info file, but should also be updated on the module page when committed.

febbraro’s picture

Status: Needs review » Reviewed & tested by the community

We did a good amount of testing on this Friday. I think it is good to merge in and iron the rest of the kinks out.

jec006’s picture

Status: Reviewed & tested by the community » Fixed

Merged into 7.x-1.x

Automatically closed -- issue fixed for 2 weeks with no activity.