Forum OpenACS Q&A: Re: Ratings package status?

Collapse
Posted by Dave Bauer on
Let's ignore the unfinished work on 5.2 that is not compatible with Oracle.
Collapse
Posted by Don Baccus on
I don't see evidence that this package has ever supported Oracle. In my checkout of HEAD, at least, ratings/sql/oracle is empty.

And since it was written by Jeff Davis, who chose to personally ignore Oracle a year or so before he left the project, I'm sure that as committed by him it did not support Oracle.

Is there a port lying around that I'm missing?

Regarding the Viaro stuff, my feeling is to leave it out. The duplicate functionality sucks, and the fact that they've not maintained it by merging it to 5.3 and HEAD isn't a good sign either.

And I'm not sure I like the way they're trying to aggregate ratings together. For forums, of course, the right thing to do is to average ratings over messages with the forums' forum_id, NOT context_id. This kind of thing should be package-specific, with perhaps some ratings package help in the form of an API or the like (there is some help for aggregating ratings in Jeff's original code, it appears).

Collapse
Posted by Emmanuelle Raffenne on
In my checkout of HEAD, at least, ratings/sql/oracle is empty.

Ooops! Looking at what's inside the sql/oracle would have been a good idea... or cvs co -Pd :)

The "context_object_id" column is not fill automatically with the context_id of the object but with whatever is passed as context_object_id by the page that uses ratings. So if you use the ratings proc (should be an include btw), say, in forums package in the page that display 1 thread, you can pass the forum_id as context_object_id.

The aggregating stuff in Jeff's original code aggregates ratings by type of users (registered, anonymous, all), if I understood correctly the identifiers:

create table rating_aggregates (
dimension_id integer
constraint ratings_dimension_id_fk
references rating_dimensions(dimension_id) on delete cascade,
object_id integer
constraint ratings_object_id_fk
references acs_objects(object_id) on delete cascade
constraint ratings_object_id_nn
not null,
all_ratings integer,
all_rating_sum integer,
all_rating_ave float,
anon_ratings integer,
anon_rating_sum integer,
anon_rating_ave float,
reg_ratings integer,
reg_rating_sum integer,
reg_rating_ave float,
rated_on timestamptz,
constraint rating_aggregates_pk
primary key (object_id, dimension_id)
);

Regarding other Viaro's changes: the duplication of code can be cleaned up and I forgot to mention that they added scripts to view a summary (or details) of the ratings (by object, by user who rated), that can be interesting. The question is if those summaries should be restricted to users with admin privilege or not.

Collapse
Posted by Don Baccus on
Oh, I see, I thought you meant it was hard-wired for context_id.

Still seems a bit odd to me. Since it only supports PG, it would be easy enough to say "average the ratings for all the child objects of child forum_id" when you want to display that, and cache the result if you're worried about performance.

Anyway, it's not a dotlrn or core package obviously, so you guys at UNED should just do what you want, right?

Since Oracle support obviously is not an issue for this package :)