public interface AlgorithmExerciseProvider
Modifier and Type | Method and Description |
---|---|
void |
afterProcessingExercise(AlgorithmExercise<?> exercise,
AlgorithmExercise.ExamResult result,
java.lang.String lastSolution)
Is invoked when the exercise is processed.
|
void |
afterSolvingExercise(AlgorithmExercise<?> exercise,
boolean succeeded,
java.lang.String solution)
Is invoked every time the user has entered a new solution of the exercise.
|
void |
beforeProcessingExercise(AlgorithmExercise<?> exercise,
AlgorithmStep step)
Is invoked when the exercise of the current step in the algorithm is loaded and should be presented to the user.
|
void |
beginExam()
Is invoked when the exam is started meaning more precisely when the algorithm is started in exercise mode.
|
void |
endExam(boolean canceled)
Is invoked when the exam is completed meaning more precisely when the algorithm is stopped or its execution is completed.
|
boolean |
isVisible()
Indicates whether the provider is visible to the user (for example in the graphical user interface).
|
void |
setHandler(AlgorithmExerciseHandler handler)
Sets the handler of the exercise mode.
|
void |
setVisible(boolean visible)
Sets whether the provider should be visible to the user (for example in the graphical user interface).
|
void setHandler(AlgorithmExerciseHandler handler)
handler
- the handlervoid beginExam()
void endExam(boolean canceled)
canceled
- true
if the user stops the algorithm during the execution otherwise false
void beforeProcessingExercise(AlgorithmExercise<?> exercise, AlgorithmStep step)
exercise
- the exercisestep
- the related step or null
if there is no related stepvoid afterProcessingExercise(AlgorithmExercise<?> exercise, AlgorithmExercise.ExamResult result, java.lang.String lastSolution)
exercise
- the exerciseresult
- the final result of the exerciselastSolution
- the last solution the user has givenvoid afterSolvingExercise(AlgorithmExercise<?> exercise, boolean succeeded, java.lang.String solution)
exercise
- the exercisesucceeded
- true
if the user has entered the right solution otherwise false
solution
- the string representation of the solution the user has madeboolean isVisible()
true
if the provider is visible to the user otherwise false
void setVisible(boolean visible)
visible
- true
if the provider should be visible to the user otherwise false