Skip to content

Commit

Permalink
Merge pull request #372 from SWM-NM/feat/#371
Browse files Browse the repository at this point in the history
✏️ [FIX] 문제 추출 오류 수정
  • Loading branch information
aj4941 authored Sep 25, 2023
2 parents 56d8e4c + e39e22d commit c4ec202
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,10 @@ private void insertTestTypeData() {

// PK 13번 : 브론즈 랜덤 디펜스
List<DifficultyRange> difficultyRanges13 = new ArrayList<>();
difficultyRanges13.add(new DifficultyRange(DifficultyLevel.B4, DifficultyLevel.B3));
difficultyRanges13.add(new DifficultyRange(DifficultyLevel.B3, DifficultyLevel.B2));
difficultyRanges13.add(new DifficultyRange(DifficultyLevel.B2, DifficultyLevel.B1));
difficultyRanges13.add(new DifficultyRange(DifficultyLevel.B2, DifficultyLevel.B1));
difficultyRanges13.add(new DifficultyRange(DifficultyLevel.B4, DifficultyLevel.B1));
difficultyRanges13.add(new DifficultyRange(DifficultyLevel.B4, DifficultyLevel.B2));
difficultyRanges13.add(new DifficultyRange(DifficultyLevel.B4, DifficultyLevel.B1));
difficultyRanges13.add(new DifficultyRange(DifficultyLevel.B4, DifficultyLevel.B1));

TestType testType13 = TestType.builder()
.testTypename("브론즈 랜덤 디펜스")
Expand All @@ -284,10 +284,10 @@ private void insertTestTypeData() {

// PK 14번 : 실버 랜덤 디펜스
List<DifficultyRange> difficultyRanges14 = new ArrayList<>();
difficultyRanges14.add(new DifficultyRange(DifficultyLevel.S5, DifficultyLevel.S4));
difficultyRanges14.add(new DifficultyRange(DifficultyLevel.S4, DifficultyLevel.S3));
difficultyRanges14.add(new DifficultyRange(DifficultyLevel.S3, DifficultyLevel.S2));
difficultyRanges14.add(new DifficultyRange(DifficultyLevel.S2, DifficultyLevel.S1));
difficultyRanges14.add(new DifficultyRange(DifficultyLevel.S5, DifficultyLevel.S1));
difficultyRanges14.add(new DifficultyRange(DifficultyLevel.S5, DifficultyLevel.S1));
difficultyRanges14.add(new DifficultyRange(DifficultyLevel.S5, DifficultyLevel.S1));
difficultyRanges14.add(new DifficultyRange(DifficultyLevel.S5, DifficultyLevel.S1));

TestType testType14 = TestType.builder()
.testTypename("실버 랜덤 디펜스")
Expand All @@ -304,10 +304,10 @@ private void insertTestTypeData() {

// PK 15번 : 골드 랜덤 디펜스
List<DifficultyRange> difficultyRanges15 = new ArrayList<>();
difficultyRanges15.add(new DifficultyRange(DifficultyLevel.G5, DifficultyLevel.G4));
difficultyRanges15.add(new DifficultyRange(DifficultyLevel.G4, DifficultyLevel.G3));
difficultyRanges15.add(new DifficultyRange(DifficultyLevel.G3, DifficultyLevel.G2));
difficultyRanges15.add(new DifficultyRange(DifficultyLevel.G2, DifficultyLevel.G1));
difficultyRanges15.add(new DifficultyRange(DifficultyLevel.G5, DifficultyLevel.G1));
difficultyRanges15.add(new DifficultyRange(DifficultyLevel.G5, DifficultyLevel.G1));
difficultyRanges15.add(new DifficultyRange(DifficultyLevel.G5, DifficultyLevel.G1));
difficultyRanges15.add(new DifficultyRange(DifficultyLevel.G5, DifficultyLevel.G1));

TestType testType15 = TestType.builder()
.testTypename("골드 랜덤 디펜스")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public void getProblemsByTestType(TestType testType, List<BojProblem> bojProblem
List<DifficultyRange> difficultyRanges = testType.getDifficultyRanges();
long index = 1;
for (DifficultyRange difficultyRange : difficultyRanges) {
if (bojProblems.size() >= testType.getProblemCount()) break;
int start = DifficultyLevel.getLevelByValue(difficultyRange.getStart());
int end = DifficultyLevel.getLevelByValue(difficultyRange.getEnd());
boolean flag = false;
Expand Down Expand Up @@ -67,6 +68,7 @@ public void getProblemsByApi(TestType testType, String bojId, List<BojProblem> b
List<DifficultyRange> difficultyRanges = testType.getDifficultyRanges();
long index = 1;
for (DifficultyRange difficultyRange : difficultyRanges) {
if (bojProblems.size() >= testType.getProblemCount()) break;
if (bojProblems.get((int) (index - 1)).getProblemId() != 0) {
index++;
continue;
Expand Down

0 comments on commit c4ec202

Please sign in to comment.