Take a simple approach to add direct stage access.

Make it a numerical stage indicator. This allows the person to skip a stage
if they choose to, but it will effectively be marked as completed.


git-svn-id: http://webgoat.googlecode.com/svn/trunk@145 4033779f-a91e-0410-96ef-6bf7bf53c507
This commit is contained in:
rogan.dawes 2007-07-10 11:53:54 +00:00
parent e6fcd4176c
commit 51cc4fb0b4
3 changed files with 20 additions and 2 deletions

View File

@ -164,6 +164,12 @@ public abstract class AbstractLesson extends Screen implements Comparable
*/
public abstract Element getCredits();
/**
* Get the number of stages provided by this lesson
*
* @return the number of stages
*/
public abstract int getStageCount();
/**
* Description of the Method

View File

@ -310,8 +310,12 @@ public class CrossSiteScripting extends LessonAdapter
}
@Override
public int getStageCount() {
return 6;
}
protected LessonAction getAction(String actionName)
protected LessonAction getAction(String actionName)
{
return (LessonAction) lessonFunctions.get(actionName);
}

View File

@ -381,4 +381,12 @@ public abstract class LessonAdapter extends AbstractLesson
t.addElement(tr);
return t;
}
/* By default returns 1 stage.
* (non-Javadoc)
* @see org.owasp.webgoat.lessons.AbstractLesson#getStageCount()
*/
public int getStageCount() {
return 1;
}
}