3
votes

I have a list in Sharepoint 2010 with ratings enabled and working fine. When I hover the mouse over the rating stars it provides me information weather I already voted or not and what was my rating. Because of that I assume that Sharepoint stores user info together with rating data.

I would like to create a list view containing only those items that were not yet rated by the current user. Thanks to that he will be able to make sure he voted on every item on the list without having to highlight every entry in a long list. Can you help me with that?

1

1 Answers

2
votes

The individual rating information is stored in social database and it is not stored along with list items.. list items only contains average rating values and number of ratings.. you can create custom webparts and display rating information of current user through class model..

use following code:

using Microsoft.Office.Server.SocialData;    
using Microsoft.Office.Server.UserProfiles;

SPSite oSite = SPContext.Current.Site;
SPServiceContext context = SPServiceContext.GetContext(oSite);
UserProfileManager profileManager = new UserProfileManager(context);
UserProfile profile = profileManager.GetUserProfile(user.LoginName.ToString());
SocialRatingManager socialRatingManager = new SocialRatingManager(context);
socialRatingManager.GetRatings(profile)