Extract the stage-related code from LessonTracker into SequentialLessonTracker

git-svn-id: http://webgoat.googlecode.com/svn/trunk@157 4033779f-a91e-0410-96ef-6bf7bf53c507
This commit is contained in:
rogan.dawes
2007-07-11 12:50:32 +00:00
parent 02560a2510
commit f5e56c7081
18 changed files with 234 additions and 175 deletions

View File

@ -8,6 +8,7 @@ AbstractLesson currentLesson = webSession.getCurrentLesson();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page import="org.owasp.webgoat.lessons.SequentialLessonAdapter"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
@ -197,18 +198,23 @@ StringBuffer buildList = new StringBuffer();
<a href="javascript:toggle('lessonPlans')" target="_top" onclick="MM_nbGroup('down','group1','plans','',1)">Close this Window</a>
</div>
<%
if (webSession.isDebug()&& webSession.getCurrentLesson().getStageCount() > 1) {
AbstractLesson al = webSession.getCurrentLesson();
if (al instanceof SequentialLessonAdapter)
{
SequentialLessonAdapter sla = (SequentialLessonAdapter) al;
if (webSession.isDebug()&& sla.getStageCount() > 1) {
%><form method="post" action="attack?menu=<%=webSession.getCurrentMenu()%>">
<select name="<%= WebSession.STAGE %>" onchange="this.form.submit();">
<%
int stages = webSession.getCurrentLesson().getStageCount();
int stage = webSession.getCurrentLesson().getStage(webSession);
int stages = sla.getStageCount();
int stage = sla.getStage(webSession);
for (int i=1; i<=stages;i++) {
%><option <% if (i == stage) out.print("selected"); %> value="<%= i %>">Stage <%= i %></option>
<%
}
%></select></form><%
}
}
%>
<div id="lessonContent"><%=webSession.getInstructions()%></div>
<div id="message" class="info"><%=webSession.getMessage()%></div>