A recent change to AbstractLesson.getLink() broke visit tracking

Fix the lesson tracking to be more specific.


git-svn-id: http://webgoat.googlecode.com/svn/trunk@196 4033779f-a91e-0410-96ef-6bf7bf53c507
This commit is contained in:
rogan.dawes 2007-07-18 13:35:42 +00:00
parent c1ddbd078f
commit c65faceb1a

View File

@ -154,23 +154,18 @@ public class HammerHead extends HttpServlet
if (response.isCommitted()) if (response.isCommitted())
return; return;
// if the screen parameter exists, the screen was visited via // perform lesson-specific tracking activities
// the menu categories, if (screen instanceof AbstractLesson) {
// we won't count these as visits. The user may be able to AbstractLesson lesson = (AbstractLesson) screen;
// manipulate the counts
// by specifying the screen parameter using a proxy. Good for // we do not count the initial display of the lesson screen as a visit
// them! if ("GET".equals(request.getMethod())) {
String fromMenus = mySession.getParser().getRawParameter( String uri = request.getRequestURI() + "?" + request.getQueryString();
WebSession.SCREEN, null); if (! uri.endsWith(lesson.getLink()))
if (fromMenus == null) screen.getLessonTracker(mySession).incrementNumVisits();
{ } else if ("POST".equals(request.getMethod()) && mySession.getPreviousScreen() == mySession.getCurrentScreen()) {
// if the show source parameter exists, don't add the visit screen.getLessonTracker(mySession).incrementNumVisits();
fromMenus = mySession.getParser().getRawParameter( }
WebSession.SHOW, null);
if (fromMenus == null)
{
screen.getLessonTracker(mySession).incrementNumVisits();
}
} }
// log the access to this screen for this user // log the access to this screen for this user