org.activemath.statistics
Class UserFeedback

java.lang.Object
  extended by org.activemath.statistics.UserFeedback

public class UserFeedback
extends Object

UserFeedbackis a data class containing information about which items a given User likes resp. dislikes. The like/dislike sets are intended to be filled with MBase identifiers in String form. Only UserFeedbackManager is supposed to write to UserFeedbacks, hence all methods changing state are package-protected. The public methods are limited to doesUserLike(String) and doesUserDislike(String) to query whether a user likes or dislikes a given item. This is at the time of this writing (Aug 2010) only used in the view rendering the content items.

See Also:
ItemFeedback, UserFeedbackManager

Method Summary
 boolean addExerciseSolved(String itemId)
           
 boolean addPageViewed(String pageId)
           
 int calcNumExercisesSolved(List<String> exercisesOnPage)
           
 boolean doesUserDislike(String itemId)
          returns true iff this UserFeedbacks set of dislikes contains the given itemId
 boolean doesUserLike(String itemId)
          returns true iff this UserFeedbacks set of likes contains the given itemId
 boolean hasSolvedExercise(String itemId)
           
 boolean hasViewedPage(String pageId)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

toString

public String toString()
Overrides:
toString in class Object

doesUserLike

public boolean doesUserLike(String itemId)
returns true iff this UserFeedbacks set of likes contains the given itemId

Parameters:
itemId - the Mbase identifier of the item to query the like state of
Returns:
true if this UserFeedbacks set of likes contains the given itemId, false otherwise

doesUserDislike

public boolean doesUserDislike(String itemId)
returns true iff this UserFeedbacks set of dislikes contains the given itemId

Parameters:
itemId - the Mbase identifier of the item to query the dislike state of
Returns:
true if this UserFeedbacks set of dislikes contains the given itemId, false otherwise

addPageViewed

public boolean addPageViewed(String pageId)

hasViewedPage

public boolean hasViewedPage(String pageId)

addExerciseSolved

public boolean addExerciseSolved(String itemId)

hasSolvedExercise

public boolean hasSolvedExercise(String itemId)

calcNumExercisesSolved

public int calcNumExercisesSolved(List<String> exercisesOnPage)