diff options
author | Jesse Morgan <jesse@jesterpm.net> | 2013-09-15 16:57:53 -0700 |
---|---|---|
committer | Jesse Morgan <jesse@jesterpm.net> | 2013-09-15 16:57:53 -0700 |
commit | af7517c44c967ca29e12df52d2fe13b2a067c5fe (patch) | |
tree | f56b37a3f93ac70e13259e9d404c2122b6a332a0 /src/com/p4square/grow/frontend | |
parent | 24c7b528897bac34854cdededeb6baf61038a031 (diff) |
Adding Introduction Chapter.
Introduction chapter is always required and thus after the assessment
the user is taken directly to the introduction. After the introduction
training continues with whichever section the user assessed in to.
Diffstat (limited to 'src/com/p4square/grow/frontend')
-rw-r--r-- | src/com/p4square/grow/frontend/ChapterCompletePage.java | 8 | ||||
-rw-r--r-- | src/com/p4square/grow/frontend/TrainingPageResource.java | 8 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/com/p4square/grow/frontend/ChapterCompletePage.java b/src/com/p4square/grow/frontend/ChapterCompletePage.java index 5cc4724..efcde38 100644 --- a/src/com/p4square/grow/frontend/ChapterCompletePage.java +++ b/src/com/p4square/grow/frontend/ChapterCompletePage.java @@ -102,6 +102,14 @@ public class ChapterCompletePage extends FreeMarkerPageResource { } } + // Skip the chapter complete message for "Introduction" + if ("introduction".equals(mChapter)) { + String nextPage = mConfig.getString("dynamicRoot", ""); + nextPage += "/account/training/" + nextChapter; + getResponse().redirectSeeOther(nextPage); + return new StringRepresentation("Redirecting to " + nextPage); + } + root.put("stage", mChapter); root.put("nextstage", nextChapter); return new TemplateRepresentation(t, root, MediaType.TEXT_HTML); diff --git a/src/com/p4square/grow/frontend/TrainingPageResource.java b/src/com/p4square/grow/frontend/TrainingPageResource.java index 61dcce0..6a0fc10 100644 --- a/src/com/p4square/grow/frontend/TrainingPageResource.java +++ b/src/com/p4square/grow/frontend/TrainingPageResource.java @@ -96,8 +96,8 @@ public class TrainingPageResource extends FreeMarkerPageResource { } if (mChapter == null) { - // Everything is completed... send them back to seeker. - mChapter = "seeker"; + // Everything is completed... send them back to introduction. + mChapter = "introduction"; } String nextPage = mConfig.getString("dynamicRoot", ""); @@ -185,8 +185,10 @@ public class TrainingPageResource extends FreeMarkerPageResource { return 3; } else if ("believer".equals(chapter)) { return 2; - } else { + } else if ("seeker".equals(chapter)) { return 1; + } else { + return 0; } } } |