|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.activemath.sequencer.ExerciseSequencer
public abstract class ExerciseSequencer
Show a sequence of exercise to the user. Provides logic of the different ways of defining and fetching the proper exercises within the sub classes.
| Field Summary | |
|---|---|
protected AppSession |
appSession
|
protected String |
bookId
|
protected Iterator<ExerciseArgumentSetting> |
exerciseListIterator
|
protected List<String> |
exercisesSkipped
|
protected List<String> |
exercisesSolved
|
protected String |
exerciseStrategy
|
protected List<String> |
exericsesFailed
|
static String |
FINISHED_NOCONTENTABORT
|
static String |
FINISHED_SESSION_EXPIRED
|
static String |
FINISHED_SUCCESS
|
static String |
FINISHED_TIMEEXPIRED
|
static String |
FINISHED_USERABORT
|
protected String |
finishReason
|
protected String |
id
|
protected List<String> |
itemsSeen
|
| Constructor Summary | |
|---|---|
ExerciseSequencer(AppSession appSession)
Generate the unique Id for the object and initialize all lists. |
|
| Method Summary | |
|---|---|
void |
addItemsAlreadySeen(List<String> itemIds)
|
void |
addItemShown(String id)
|
abstract void |
exerciseFinished(String exerciseId,
double successRate)
Whenever we know that an exercise is finished, we need to update our knowledge |
String |
getBookId()
|
List<String> |
getExercisesSkipped()
|
List<String> |
getExercisesSolved()
|
String |
getExerciseStrategy()
|
List<String> |
getExericsesFailed()
|
String |
getFinishReason()
|
String |
getId()
Provide the unique identifier |
List<String> |
getItemsSeen()
|
abstract ExerciseArgumentSetting |
getNextExercise()
Prepare the next exercise. |
void |
initExerciseListIterator(List<String> exerciseIdList)
|
protected abstract boolean |
isGoalAchieved()
Checks if the goal of exercise sequencer is achieved. |
void |
onActivemathEvent(ActivemathEvent event)
Override the event listener method to react on ExerciseFinished event We need to be sure that every time user finished an exercise, we can fetch the event. |
void |
sessionShutdown(AppSession appSession)
Session shutdown hook, so that even by lost of session, we can do something. |
void |
setExercisesSkipped(List<String> exercisesSkipped)
|
void |
setExercisesSolved(List<String> exercisesSolved)
|
void |
setExerciseStrategy(String exerciseStrategy)
|
void |
setExericsesFailed(List<String> exericsesFailed)
|
void |
setFinishReason(String finishReason)
We need to be able to provide the information, why a sequencer will terminate (or "killed") before we really clean the object. |
void |
setItemsSeen(List<String> itemsSeen)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static String FINISHED_SUCCESS
public static String FINISHED_USERABORT
public static String FINISHED_NOCONTENTABORT
public static String FINISHED_TIMEEXPIRED
public static String FINISHED_SESSION_EXPIRED
protected String id
protected String bookId
protected AppSession appSession
protected String finishReason
protected List<String> exercisesSkipped
protected List<String> exercisesSolved
protected List<String> exericsesFailed
protected String exerciseStrategy
protected List<String> itemsSeen
protected Iterator<ExerciseArgumentSetting> exerciseListIterator
| Constructor Detail |
|---|
public ExerciseSequencer(AppSession appSession)
appSession - | Method Detail |
|---|
public void onActivemathEvent(ActivemathEvent event)
onActivemathEvent in interface ActivemathEventListenerevent - the event to respond topublic void sessionShutdown(AppSession appSession)
sessionShutdown in interface AppSessionShutdownHook
public abstract void exerciseFinished(String exerciseId,
double successRate)
exerciseId - successRate - "-1" tells us we don't know about successRate, otherwise, the number
the semantic of positive value is defined in implementing classes.
public abstract ExerciseArgumentSetting getNextExercise()
throws NoAvailableExercisesException
NoAvailableExercisesException - if we can't find oneprotected abstract boolean isGoalAchieved()
public String getId()
public void addItemsAlreadySeen(List<String> itemIds)
public void addItemShown(String id)
public List<String> getExercisesSkipped()
public void setExercisesSkipped(List<String> exercisesSkipped)
public List<String> getExercisesSolved()
public void setExercisesSolved(List<String> exercisesSolved)
public List<String> getExericsesFailed()
public void setExericsesFailed(List<String> exericsesFailed)
public List<String> getItemsSeen()
public void setItemsSeen(List<String> itemsSeen)
public String getFinishReason()
public void setFinishReason(String finishReason)
public void initExerciseListIterator(List<String> exerciseIdList)
public String getExerciseStrategy()
public void setExerciseStrategy(String exerciseStrategy)
public String getBookId()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||