org.activemath.statistics
Class ExerciseStatistics

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

public class ExerciseStatistics
extends Object

This class holds statistics for a specific exercise, like how often it was started, average duration, ...

Since:
2009-09-29

Nested Class Summary
 class ExerciseStatistics.UserEntry
          Holds information about an unfinished exercise of a user, for tracking his actions
 
Field Summary
protected static Category log
           
protected static double MASTERY_LOW
           
protected static double MASTERY_MEDIUM
           
 
Constructor Summary
ExerciseStatistics(String exerciseId)
          Constructor
 
Method Summary
 long getDuration_AVG()
           
 int getDuration_MAX()
           
 int getDuration_MIN()
           
 double getDuration_STD()
           
 String getExerciseId()
           
 double getFailedMastery_AVG()
           
 int getNumFailed()
           
 int getNumFinished()
           
 int getNumRestarted()
           
 int getNumStarted()
           
 double getNumSteps_AVG()
           
 int getNumSteps_MAX()
           
 int getNumSteps_MIN()
           
 double getNumSteps_STD()
           
 int getNumSuccesses()
           
 double getSuccessMastery_AVG()
           
 double getSuccessRate_AVG()
           
 double getSuccessRate_AVG(double mastery)
           
 double getSuccessRate_MAX()
           
 double getSuccessRate_MIN()
           
 double getSuccessRate_STD()
           
 ExerciseStatistics.UserEntry getUserEntry(String userId)
           
 void handleEvent(ActivemathEvent event)
          Updates statistics using the events
 void reset()
          Resets all the stored statistics
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static Category log

MASTERY_LOW

protected static final double MASTERY_LOW
See Also:
Constant Field Values

MASTERY_MEDIUM

protected static final double MASTERY_MEDIUM
See Also:
Constant Field Values
Constructor Detail

ExerciseStatistics

public ExerciseStatistics(String exerciseId)
Constructor

Parameters:
exerciseId - The ID of the exercise to which these statistics belong to
Method Detail

reset

public void reset()
Resets all the stored statistics


getExerciseId

public String getExerciseId()
Returns:
The ID of the exercise to which these statistics belong to

handleEvent

public void handleEvent(ActivemathEvent event)
Updates statistics using the events

Parameters:
event - Exercise Events, based on which the statistics are updated

getUserEntry

public ExerciseStatistics.UserEntry getUserEntry(String userId)
Parameters:
userId -
Returns:
Null if user entry is not created, otherwise the user Entry

getNumStarted

public int getNumStarted()
Returns:
The number of times this exercise was started

getNumFinished

public int getNumFinished()
Returns:
The number of times this exercise was finished

getNumRestarted

public int getNumRestarted()
Returns:
The number of times this exercise was restarted (two ExerciseStarted Events without an ExerciseFinished event inbetween)

getDuration_AVG

public long getDuration_AVG()
Returns:
The average duration of this exercise in deci-seconds

getDuration_STD

public double getDuration_STD()
Returns:
The standard deviation of the duration
See Also:
ExerciseStatistics.getDuration_AVG()

getDuration_MIN

public int getDuration_MIN()
Returns:
The minimum duration (in deci-seconds) measured for this exercise

getDuration_MAX

public int getDuration_MAX()
Returns:
The maximum duration (in deci-seconds) measured for this exercise

getNumSteps_AVG

public double getNumSteps_AVG()
Returns:
The average number of steps required for this exercise

getNumSteps_STD

public double getNumSteps_STD()
Returns:
The standard deviation for needed steps

getNumSteps_MIN

public int getNumSteps_MIN()
Returns:
The minimum number of steps ever measured

getNumSteps_MAX

public int getNumSteps_MAX()
Returns:
The maximum number of steps ever measured

getSuccessRate_AVG

public double getSuccessRate_AVG()
Returns:
The average successRate for this exercise

getSuccessRate_STD

public double getSuccessRate_STD()
Returns:
The standard deviation of the successRate

getSuccessRate_MIN

public double getSuccessRate_MIN()
Returns:
The minimum successRate ever measured

getSuccessRate_MAX

public double getSuccessRate_MAX()
Returns:
The minimum successRate ever measured

getSuccessRate_AVG

public double getSuccessRate_AVG(double mastery)
Parameters:
mastery -
Returns:
The average successrate students had with a specific mastery (currently, the given mastery is sorted into 3 different groups, low, medium, high, so mastery values are not taken into account continously)

getSuccessMastery_AVG

public double getSuccessMastery_AVG()
Returns:
Average mastery of students who had "successful" achievements when doing this exercise (or a step of it)

getFailedMastery_AVG

public double getFailedMastery_AVG()
Returns:
Average mastery of students who had "failed" achievements when doing this exercise (or a step of it)

getNumSuccesses

public int getNumSuccesses()
Returns:
Number of successful achievements

getNumFailed

public int getNumFailed()
Returns:
Number of unsuccessful exercise runs