Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit d6a2184

Browse files
deedeeskyhit
authored andcommitted
fix challenge intro single round edit
1 parent f7d168c commit d6a2184

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

src/main/java/com/appirio/service/challengefeeder/api/detail/ChallengeDetailData.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ public class ChallengeDetailData extends IdentifiableData {
139139
@Setter
140140
private transient Boolean isSysTestCompleted;
141141

142+
@Getter
143+
@Setter
144+
private transient Long numberOfCheckpointPhase;
145+
142146
/**
143147
* Setter for {@link #track}
144148
* @param track

src/main/java/com/appirio/service/challengefeeder/manager/ChallengeDetailFeederManager.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -146,18 +146,18 @@ public void pushChallengeFeeder(ChallengeFeederParam param) throws SupplyExcepti
146146
String introduction = challenge.getIntroduction() == null ? "" : challenge.getIntroduction();
147147
String round1Introduction = challenge.getRound1Introduction() == null ? "" : challenge.getRound1Introduction();
148148
String round2Introduction = challenge.getRound2Introduction() == null ? "" : challenge.getRound2Introduction();
149-
150-
if (round1Introduction != "" && round2Introduction != "") {
151-
// two rounds
152-
introduction += "\n" +
153-
String.format(ROUND_HEADER_HTML, "1") + round1Introduction + "\n"
154-
+ String.format(ROUND_HEADER_HTML, "2") + round2Introduction;
155-
} else if (round1Introduction != "") {
156-
introduction += "\n" + round1Introduction;
157-
} else if (round2Introduction != "") {
158-
introduction += "\n" + round2Introduction;
149+
if (challenge.getNumberOfCheckpointPhase() > 0) {
150+
if (round1Introduction != "" && round2Introduction != "") {
151+
// two rounds
152+
introduction += "\n" +
153+
String.format(ROUND_HEADER_HTML, "1") + round1Introduction + "\n"
154+
+ String.format(ROUND_HEADER_HTML, "2") + round2Introduction;
155+
} else if (round1Introduction != "") {
156+
introduction += "\n" + round1Introduction;
157+
} else if (round2Introduction != "") {
158+
introduction += "\n" + round2Introduction;
159+
}
159160
}
160-
161161
challenge.setIntroduction(introduction);
162162
} else if ("DEVELOP_MARATHON_MATCH".equalsIgnoreCase(challenge.getSubTrack()) || "MARATHON_MATCH".equalsIgnoreCase(challenge.getSubTrack())) {
163163
if (challenge.getMarathonMatchDetailRequirements() != null) {

src/main/resources/sql/challenge-feeder/detail/get_specs.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ SELECT
1414
pss.round_one_introduction AS round1Introduction,
1515
pss.round_two_introduction AS round2Introduction,
1616
pmm_spec.match_details AS marathonMatchDetailRequirements,
17-
pmm_spec.match_rules AS marathonMatchRules
17+
pmm_spec.match_rules AS marathonMatchRules,
18+
(select count(*) from project_phase pp where pp.project_id = p.project_id and
19+
pp.phase_type_id in (15,16,17)) as numberOfCheckpointPhase
1820
FROM
1921
project p
2022
INNER JOIN project_category_lu pcl ON pcl.project_category_id = p.project_category_id

0 commit comments

Comments
 (0)