org.activemath.statistics
Class StatisticsManager

java.lang.Object
  extended by org.activemath.statistics.StatisticsManager
All Implemented Interfaces:
EventListener, ActivemathEventListener

public class StatisticsManager
extends Object
implements ActivemathEventListener

This class holds a list of all ExerciseStatistics - for each exercise one. It listens on events and forwards them to the specific ExerciseStatistics, which updates itself then.

Since:
2009-10-04

Field Summary
protected static Logger log
           
 
Method Summary
 void clear()
          Clears all statistics
 void clear(String exerciseId)
          Removes statistics for an exercise
 ExerciseStatistics getExerciseStatistics(String exerciseId)
           
static StatisticsManager getInstance()
           
 UserFeedbackManager getUserFeedbackManager()
          Get the UserFeedbackManager associated with this StatisticsManager
 boolean isEnabled()
           
 void onActivemathEvent(ActivemathEvent event)
          Handle an Activemath event.
 void setEnabled(boolean enabled)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final transient Logger log
Method Detail

getInstance

public static StatisticsManager getInstance()
Returns:
The singleton instance

isEnabled

public boolean isEnabled()
Returns:
Whether the statistics module is enabled or not
See Also:
setEnabled(boolean)

setEnabled

public void setEnabled(boolean enabled)
Parameters:
enabled - Enable or disable the statistics module

onActivemathEvent

public void onActivemathEvent(ActivemathEvent event)
Description copied from interface: ActivemathEventListener
Handle an Activemath event.

This method must return as quickly as possible and must not block the calling thread for long.

Specified by:
onActivemathEvent in interface ActivemathEventListener
Parameters:
event - the event to respond to

getExerciseStatistics

public ExerciseStatistics getExerciseStatistics(String exerciseId)
Parameters:
exerciseId - The id of the exercise whose statistics is to be returned
Returns:
The class which holds statistics about this exercise, NULL if not existing or if the statistics manager is disabled

clear

public void clear()
Clears all statistics


clear

public void clear(String exerciseId)
Removes statistics for an exercise

Parameters:
exerciseId -

getUserFeedbackManager

public UserFeedbackManager getUserFeedbackManager()
Get the UserFeedbackManager associated with this StatisticsManager