diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/AbstractLesson.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/AbstractLesson.java index be8b5c94f..531dcf367 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/AbstractLesson.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/AbstractLesson.java @@ -575,7 +575,10 @@ public abstract class AbstractLesson extends Screen implements Comparable link.append(WebSession.SCREEN); link.append("="); link.append(getScreenId()); - + link.append("&"); + link.append(WebSession.MENU); + link.append("="); + link.append(getCategory().getRanking()); return link.toString(); } diff --git a/ webgoat/main/project/WebContent/main.jsp b/ webgoat/main/project/WebContent/main.jsp index 3d336f463..4a10ce30c 100644 --- a/ webgoat/main/project/WebContent/main.jsp +++ b/ webgoat/main/project/WebContent/main.jsp @@ -8,7 +8,6 @@ AbstractLesson currentLesson = webSession.getCurrentLesson(); %> -<%@page import="org.owasp.webgoat.lessons.SequentialLessonAdapter"%> <%@page import="org.owasp.webgoat.lessons.RandomLessonAdapter"%> @@ -25,15 +24,13 @@ AbstractLesson currentLesson = webSession.getCurrentLesson(); <% -final String menuPrefix = "menu"; +final String menuPrefix = WebSession.MENU; final String submenuPrefix = "submenu"; final String mbutPrefix = "mbut"; String printHint = ""; String printParameters = ""; String printCookies = ""; String lessonComplete = ""; -String m = "menu"; -String menu = request.getParameter(m); List categories = course.getCategories(); @@ -58,7 +55,7 @@ StringBuffer buildList = new StringBuffer(); if (iter1.hasNext()) buildList.append(","); }%> - +
<% @@ -96,8 +93,20 @@ StringBuffer buildList = new StringBuffer(); AbstractLesson lesson = (AbstractLesson)iter4.next(); %> - <%=(lesson.isCompleted(webSession) ? lessonComplete : "")%><%=lesson.getTitle()%> - <% + <%=(lesson.isCompleted(webSession) ? lessonComplete : "")%><%=lesson.getTitle()%> + + <% if (lesson instanceof RandomLessonAdapter) { + RandomLessonAdapter rla = (RandomLessonAdapter) lesson; + String[] stages = rla.getStages(); + for (int i=0; i + <%=stages[i] %> + + <% + } + } + %> +<% } %> @@ -113,28 +122,28 @@ StringBuffer buildList = new StringBuffer(); if (webSession.isAuthorizedInLesson(webSession.getRole(), WebSession.SHOWHINTS)) { %> - Previous Hint - Hints - Next Hint <%}%> - Show Params - Show Cookies @@ -198,44 +207,6 @@ StringBuffer buildList = new StringBuffer();
Close this Window
- <% - AbstractLesson al = webSession.getCurrentLesson(); - if (!al.isCompleted(webSession)) - { - if (al instanceof SequentialLessonAdapter) - { - SequentialLessonAdapter sla = (SequentialLessonAdapter) al; - if (webSession.isDebug()&& sla.getStageCount() > 1) { - %>
-
<% - } - } - else if (al instanceof RandomLessonAdapter) - { - RandomLessonAdapter rla = (RandomLessonAdapter) al; - String[] stages = rla.getStages(); - if (stages != null && stages.length > 0) { - %>
-
<% - } - } - } - %>
<%=webSession.getInstructions()%>
<%=webSession.getMessage()%>