Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✏️ [FIX] 문제 추출 오류 수정 #372

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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