summaryrefslogtreecommitdiff
path: root/src/com/p4square/grow/frontend
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2013-11-18 22:28:10 -0800
committerJesse Morgan <jesse@jesterpm.net>2013-11-18 22:28:10 -0800
commit0cb9b37b723386d1e902f556e9dbbbe093d2789f (patch)
treed1a172148327247618c7d30572e9fa486a925f42 /src/com/p4square/grow/frontend
parent3521cc4003f738cc1433cfe484470dd9f7577360 (diff)
Making strict viewing order configurable.
Diffstat (limited to 'src/com/p4square/grow/frontend')
-rw-r--r--src/com/p4square/grow/frontend/TrainingPageResource.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/p4square/grow/frontend/TrainingPageResource.java b/src/com/p4square/grow/frontend/TrainingPageResource.java
index 311bc2c..d181190 100644
--- a/src/com/p4square/grow/frontend/TrainingPageResource.java
+++ b/src/com/p4square/grow/frontend/TrainingPageResource.java
@@ -119,6 +119,7 @@ public class TrainingPageResource extends FreeMarkerPageResource {
// The user is not allowed to view chapters after his highest completed chapter.
// In this loop we find which chapters are allowed and check if the user tried
// to skip ahead.
+ boolean allowUserToSkip = mConfig.getBoolean("allowUserToSkip", true);
String defaultChapter = null;
boolean userTriedToSkip = false;
@@ -134,9 +135,9 @@ public class TrainingPageResource extends FreeMarkerPageResource {
}
} else {
- allowed = false;
+ allowed = allowUserToSkip;
- if (chapterId.equals(mChapter)) {
+ if (!allowUserToSkip && chapterId.equals(mChapter)) {
userTriedToSkip = true;
}
}
@@ -194,6 +195,7 @@ public class TrainingPageResource extends FreeMarkerPageResource {
root.put("isChapterAllowed", allowedChapters);
root.put("chapterProgress", chapterProgress);
root.put("videos", videos);
+ root.put("allowUserToSkip", allowUserToSkip);
return new TemplateRepresentation(mTrainingTemplate, root, MediaType.TEXT_HTML);