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())
|
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
|
|
||||||
fromMenus = mySession.getParser().getRawParameter(
|
|
||||||
WebSession.SHOW, null);
|
|
||||||
if (fromMenus == null)
|
|
||||||
{
|
|
||||||
screen.getLessonTracker(mySession).incrementNumVisits();
|
screen.getLessonTracker(mySession).incrementNumVisits();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user