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/backend | |
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/backend')
-rw-r--r-- | src/com/p4square/grow/backend/resources/TrainingRecordResource.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/com/p4square/grow/backend/resources/TrainingRecordResource.java b/src/com/p4square/grow/backend/resources/TrainingRecordResource.java index 8447c16..009d0fe 100644 --- a/src/com/p4square/grow/backend/resources/TrainingRecordResource.java +++ b/src/com/p4square/grow/backend/resources/TrainingRecordResource.java @@ -32,7 +32,7 @@ import com.p4square.grow.backend.db.CassandraDatabase; * @author Jesse Morgan <jesse@jesterpm.net> */ public class TrainingRecordResource extends ServerResource { - private static final String[] CHAPTERS = { "seeker", "believer", "disciple", "teacher" }; + private static final String[] CHAPTERS = { "introduction", "seeker", "believer", "disciple", "teacher" }; private static final Logger LOG = Logger.getLogger(TrainingRecordResource.class); private static final ObjectMapper MAPPER = new ObjectMapper(); @@ -211,8 +211,15 @@ public class TrainingRecordResource extends ServerResource { // Get videos for each section and build playlist for (String chapter : CHAPTERS) { - // Chapter required if the floor of the score is <= the chapter's numeric value. - boolean required = score < Score.numericScore(chapter) + 1; + boolean required; + + if ("introduction".equals(chapter)) { + // Introduction chapter is always required + required = true; + } else { + // Chapter required if the floor of the score is <= the chapter's numeric value. + required = score < Score.numericScore(chapter) + 1; + } ColumnList<String> row = mDb.getRow("strings", "/training/" + chapter); if (!row.isEmpty()) { |