org.activemath.sequencer
Class SimpleExerciseSequencer

java.lang.Object
  extended by org.activemath.sequencer.ExerciseSequencer
      extended by org.activemath.sequencer.SimpleExerciseSequencer
All Implemented Interfaces:
EventListener, ActivemathEventListener, AppSessionShutdownHook
Direct Known Subclasses:
MunExerciseSequencer

public class SimpleExerciseSequencer
extends ExerciseSequencer

Given a list of exerciseIds, sequencer will just execute them one after another in the given order.


Field Summary
static String MUN_ES
           
static String PARTIAL_RANDOMIZED
           
static String SIMPLE_ES
           
 
Fields inherited from class org.activemath.sequencer.ExerciseSequencer
appSession, bookId, exerciseListIterator, exercisesSkipped, exercisesSolved, exerciseStrategy, exericsesFailed, FINISHED_NOCONTENTABORT, FINISHED_SESSION_EXPIRED, FINISHED_SUCCESS, FINISHED_TIMEEXPIRED, FINISHED_USERABORT, finishReason, id, itemsSeen
 
Constructor Summary
SimpleExerciseSequencer(AppSession appSession, List<ExerciseArgumentSetting> givenExerciseList, int timeOut, String bookId)
          Instanciate the iterator over the given list of exercises.
 
Method Summary
 void exerciseFinished(String exerciseId, double successRate)
          Handler whenever one exercise is finished.
 ExerciseArgumentSetting getNextExercise()
          Returns the next exercise in the list
 boolean isGoalAchieved()
          Check if the given list is used up, when yes, sequencer can terminate.
 
Methods inherited from class org.activemath.sequencer.ExerciseSequencer
addItemsAlreadySeen, addItemShown, getBookId, getExercisesSkipped, getExercisesSolved, getExerciseStrategy, getExericsesFailed, getFinishReason, getId, getItemsSeen, initExerciseListIterator, onActivemathEvent, sessionShutdown, setExercisesSkipped, setExercisesSolved, setExerciseStrategy, setExericsesFailed, setFinishReason, setItemsSeen
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIMPLE_ES

public static final String SIMPLE_ES
See Also:
Constant Field Values

MUN_ES

public static final String MUN_ES
See Also:
Constant Field Values

PARTIAL_RANDOMIZED

public static final String PARTIAL_RANDOMIZED
See Also:
Constant Field Values
Constructor Detail

SimpleExerciseSequencer

public SimpleExerciseSequencer(AppSession appSession,
                               List<ExerciseArgumentSetting> givenExerciseList,
                               int timeOut,
                               String bookId)
Instanciate the iterator over the given list of exercises.

Parameters:
appSession -
givenExerciseList - only simply list of string.
Method Detail

exerciseFinished

public void exerciseFinished(String exerciseId,
                             double successRate)
Handler whenever one exercise is finished.

Specified by:
exerciseFinished in class ExerciseSequencer
successRate - "-1" tells us we don't know about successRate, otherwise, the number the semantic of positive value is defined in implementing classes.

isGoalAchieved

public boolean isGoalAchieved()
Check if the given list is used up, when yes, sequencer can terminate. Otherwise not.

Specified by:
isGoalAchieved in class ExerciseSequencer
Returns:
true if learning goal is achieved false if we still need to continue with showing the next exercise

getNextExercise

public ExerciseArgumentSetting getNextExercise()
                                        throws NoAvailableExercisesException
Returns the next exercise in the list

Specified by:
getNextExercise in class ExerciseSequencer
Returns:
Throws:
NoAvailableExercisesException - if we can't find one