org.activemath.studentmodel2
Class LearnerModelListener

java.lang.Object
  extended by org.activemath.studentmodel2.LearnerModelListener
All Implemented Interfaces:
EventListener, ActivemathEventListener

public class LearnerModelListener
extends Object
implements ActivemathEventListener

Event listener for SLM.


Field Summary
protected static Logger log
           
 
Constructor Summary
LearnerModelListener(LearnerModel model)
           
 
Method Summary
static Difficulty getDifficulty(ExerciseStepEvent event, Item exercise, User user)
          Tries to find out the difficulty of an exercise/exercise-step by going through the event, the exercise and the users learning context, ...
static List<String> getForIds(ExerciseStepEvent event, Item exercise)
          Returns the for ids of an exercise step or of an exercise.
 void onActivemathEvent(ActivemathEvent event)
          Handle an Activemath event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static Logger log
Constructor Detail

LearnerModelListener

public LearnerModelListener(LearnerModel model)
Parameters:
model - The learner model to which this listener belongs
Method Detail

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

getForIds

public static final List<String> getForIds(ExerciseStepEvent event,
                                           Item exercise)
Returns the for ids of an exercise step or of an exercise. If the exercise step is not annotated with its own for ids, then it falls back to the metadata of the exercise.

Parameters:
event -
exercise - Can be null (then the exercise will be taken from the event)
Returns:
A collection of for ids

getDifficulty

public static final Difficulty getDifficulty(ExerciseStepEvent event,
                                             Item exercise,
                                             User user)
Tries to find out the difficulty of an exercise/exercise-step by going through the event, the exercise and the users learning context, ...

Parameters:
event -
exercise - If null, exercise will be taken from the event
user - If null, the user will be taken from the event
Returns:
The difficulty based on the event, or null