Merge pull request #85 from mayhew64/master
Added a lesson restart for lesson specific restart actions
This commit is contained in:
commit
3535626ad9
@ -676,6 +676,12 @@ public abstract class AbstractLesson extends Screen implements Comparable<Object
|
|||||||
*/
|
*/
|
||||||
public abstract String getCurrentAction(WebSession s);
|
public abstract String getCurrentAction(WebSession s);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initiates lesson restart functionality
|
||||||
|
*/
|
||||||
|
public abstract void restartLesson();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>setCurrentAction.</p>
|
* <p>setCurrentAction.</p>
|
||||||
*
|
*
|
||||||
|
@ -111,6 +111,14 @@ public abstract class LessonAdapter extends AbstractLesson {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initiates lesson restart functionality. Lessons should override this for
|
||||||
|
* lesson specific actions
|
||||||
|
*/
|
||||||
|
public void restartLesson() {
|
||||||
|
// Do Nothing - called when restart lesson is pressed. Each lesson can do something
|
||||||
|
}
|
||||||
|
|
||||||
private final static Integer DEFAULT_RANKING = new Integer(1000);
|
private final static Integer DEFAULT_RANKING = new Integer(1000);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1126,6 +1126,7 @@ public class WebSession {
|
|||||||
public void restartLesson(int lessonId) {
|
public void restartLesson(int lessonId) {
|
||||||
AbstractLesson al = getLesson(lessonId);
|
AbstractLesson al = getLesson(lessonId);
|
||||||
System.out.println("Restarting lesson: " + al);
|
System.out.println("Restarting lesson: " + al);
|
||||||
|
al.restartLesson();
|
||||||
al.getLessonTracker(this).setCompleted(false);
|
al.getLessonTracker(this).setCompleted(false);
|
||||||
if (al instanceof SequentialLessonAdapter) {
|
if (al instanceof SequentialLessonAdapter) {
|
||||||
SequentialLessonAdapter sla = (SequentialLessonAdapter) al;
|
SequentialLessonAdapter sla = (SequentialLessonAdapter) al;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user