org.activemath.webapp.report.data
Class ExerciseRun

java.lang.Object
  extended by org.activemath.events.ActivemathEvent
      extended by org.activemath.events.types.ExerciseRunEvent
          extended by org.activemath.webapp.report.data.ExerciseRun
All Implemented Interfaces:
Serializable, Comparable, BookEventTag, InteractionEventTag, InteractionExerciseEventTag, ItemEventTag, SessionEventTag, UserEventTag

public class ExerciseRun
extends ExerciseRunEvent

Represents a user having run an exercise Encapsulates an ExerciseRunEvent, which is also used as a real event (e.g. from external systems like STACK). Adds additional functionality to it, such as parsing a stream of exercise started|step|finished events. This class is an event so that we can put it into event lists. NOTE: All getters must be public for Velocity!

See Also:
Serialized Form

Field Summary
protected static Logger log
           
 
Fields inherited from class org.activemath.events.types.ExerciseRunEvent
EVENT_TYPE, FINISHED, GAVE_UP, UNFINISHED, wasFinished, wasGivenUp
 
Fields inherited from class org.activemath.events.ActivemathEvent
bookId, groupId, id, itemId, sessionId, source, timestamp, type, userId
 
Constructor Summary
ExerciseRun(ExerciseRunEvent event)
           
ExerciseRun(ExerciseStartedEvent event)
           
 
Method Summary
 void addEvent(ActivemathEvent event)
          Parse an event and update the state of this run.
 double getAvgStepSuccess()
           
 int getDurationMillisecs()
           
 int getDurationSecs()
           
 ExerciseFinishedEvent getEndEvent()
           
 long getEndTime()
           
 Item getItem()
          Provided for the view layer
 ExerciseStartedEvent getStartEvent()
           
 long getStartTime()
           
 ExerciseStepEvent getStep(int i)
           
 List<ExerciseStepEvent> getSteps()
           
 int getSuccessPercentage()
           
 User getUser()
          Provided for the view layer
 
Methods inherited from class org.activemath.events.types.ExerciseRunEvent
getBookId, getEndState, getExerciseSystem, getItemId, getMetadata, getMetadataText, getNumHints, getNumSteps, getSessionId, getSuccessRate, getUserId, getWasGivenUp, isWasFinished, isWasGivenUp, setBookId, setDurationSecs, setEndState, setExerciseSystem, setItemId, setMetadataText, setNumHints, setNumSteps, setSessionId, setSuccessRate, setUserId, setWasFinished, setWasGivenUp, wasFinished, wasGivenup
 
Methods inherited from class org.activemath.events.ActivemathEvent
compareTo, dispatchFinished, getGroupId, getId, getSource, getTimestamp, getType, setGroupId, setId, setSource, setTimestamp, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.activemath.events.tags.UserEventTag
getGroupId, setGroupId
 

Field Detail

log

protected static Logger log
Constructor Detail

ExerciseRun

public ExerciseRun(ExerciseStartedEvent event)

ExerciseRun

public ExerciseRun(ExerciseRunEvent event)
Method Detail

addEvent

public void addEvent(ActivemathEvent event)
Parse an event and update the state of this run.


getDurationMillisecs

public int getDurationMillisecs()

getDurationSecs

public int getDurationSecs()
Overrides:
getDurationSecs in class ExerciseRunEvent

getStep

public ExerciseStepEvent getStep(int i)

getSteps

public List<ExerciseStepEvent> getSteps()

getSuccessPercentage

public int getSuccessPercentage()
Returns:
0..100 success of the ExerciseFinished event if present, average of steps success if there are steps, -1 otherwise.

getAvgStepSuccess

public double getAvgStepSuccess()

getStartTime

public long getStartTime()

getEndTime

public long getEndTime()

getUser

public User getUser()
Provided for the view layer


getItem

public Item getItem()
Provided for the view layer


getEndEvent

public ExerciseFinishedEvent getEndEvent()

getStartEvent

public ExerciseStartedEvent getStartEvent()