Hey guys,
I'm currently making a plugin, a sort of casting plugin where people can submit a project, others can show their intrest and the project owner can pick interested users and set them as a collaborater (this adds a relationship with the collaborator and the project).
When the project is finished the owner can fill in a review on their collaboration and upload a result.
at the moment I list all the collaborators in the review page and the owner can rate the collaborators, this happens with an annotation made on the collaborator.
The review itself is an object linked to the original project page.
Annotate the collaborators is nice, but the annotation entity guid is of course the collaborator, the namestring is collaborationrate for instance, the valuestring is the rating int. and the owner guid is the projectowner.
But...how do I link this with the review itself? Should I set the owner_guid of the annotation to be the object instead of the rater? Is that the best approach? I could fetch the rater then by getting the owner_guid of the owner_guid, but this all seems a bit of a hassle to me.
Or should I make an entity of each rating? That looks overkill to me as well, since it's just that where annotations are made for.
Maybe someone has an example how another plugin handles this.
Annyway, thanks
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- v06@new_hero
v06 - 0 likes
- Dries@driesdk
Dries - 0 likes
- v06@new_hero
v06 - 0 likes
- Dries@driesdk
Dries - 0 likes
- Matt Beckett@Beck24
Matt Beckett - 0 likes
- iionly@iionly
iionly - 0 likes
- (project = "project" object) and (offers of others = "offer" object),
- project owner selects collaborator(s) = relationship gets created between project and offer objects,
- rating is annotation on offer object (I think it's easier to handle when the same user works on more than a single project if the rating is not assigned to the user entity),
- review is annotation on offer object. Or, alternatively the review (project summary) is an annotation on the project object.
- Evan Winslow@ewinslow
Evan Winslow - 0 likes
- Dries@driesdk
Dries - 0 likes
You must log in to post replies.Example rating plugin
http://community.elgg.org/plugins/1276883/1.0/ajax-5-star-rating-18x
http://community.elgg.org/plugins/843333/1.8.6/elgg-1819-elggx-fivestar
Thanks, but have you read my post?
Rating isn't really the problem, I'm just asking for some advice how to handle the fact that I want the rating to be linked to 3 guids instead of 2.
oh...okay
I'm gonna json_encode an array with the extra guid and the annotationname as the annotation namestring, shout if that's a bad idea...
You could use a dynamically generated annotation name.
eg. 'collaborationrate:' . $entity->guid
How about:
Relationship between project object and offer object could be similar to friends relationship: "making an offer" would be a one-sided relationship between offer and project and "accepting as collaborator" would relate the objects the other way. "Retreating the offer" or "dismiss as collaborator" would mean to remove the corresponding relationship.
I recommend against either dynamic annotation names or json encoding anything.
Make the rating a property of the review entity.
Review container is the user.
Review owner is project owner.
Add new relationship between review and project that tells you the review is specifically about work done for the project.
Thanks for the advices, I'm gonna rethink the whole thing and see what would work the best in my case. I 'll post back with the results. Thanks