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:
parent
c1ddbd078f
commit
c65faceb1a
@ -154,21 +154,16 @@ public class HammerHead extends HttpServlet
|
||||
if (response.isCommitted())
|
||||
return;
|
||||
|
||||
// if the screen parameter exists, the screen was visited via
|
||||
// the menu categories,
|
||||
// we won't count these as visits. The user may be able to
|
||||
// manipulate the counts
|
||||
// by specifying the screen parameter using a proxy. Good for
|
||||
// them!
|
||||
String fromMenus = mySession.getParser().getRawParameter(
|
||||
WebSession.SCREEN, null);
|
||||
if (fromMenus == null)
|
||||
{
|
||||
// if the show source parameter exists, don't add the visit
|
||||
fromMenus = mySession.getParser().getRawParameter(
|
||||
WebSession.SHOW, null);
|
||||
if (fromMenus == null)
|
||||
{
|
||||
// perform lesson-specific tracking activities
|
||||
if (screen instanceof AbstractLesson) {
|
||||
AbstractLesson lesson = (AbstractLesson) screen;
|
||||
|
||||
// we do not count the initial display of the lesson screen as a visit
|
||||
if ("GET".equals(request.getMethod())) {
|
||||
String uri = request.getRequestURI() + "?" + request.getQueryString();
|
||||
if (! uri.endsWith(lesson.getLink()))
|
||||
screen.getLessonTracker(mySession).incrementNumVisits();
|
||||
} else if ("POST".equals(request.getMethod()) && mySession.getPreviousScreen() == mySession.getCurrentScreen()) {
|
||||
screen.getLessonTracker(mySession).incrementNumVisits();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user