Skip to content

Commit

Permalink
[FIX] 최근 4개의 테스트 중 정답 문제 개수 반환 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
aj4941 committed Oct 5, 2023
1 parent 502bab2 commit 659a6c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class TestRecordDto {
private LocalDateTime testDate;
private Long testTime;
private Integer problemCount;
private Integer acceptCount;
private DifficultyLevel startDifficulty;
private DifficultyLevel endDifficulty;
private String testTypename;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@

public class TestRecordMapper {
public static TestRecordDto convertToDto(Tests test, List<AttemptProblemDto> attemptProblemDtos) {

Integer acceptCount = 0;
for (AttemptProblemDto attemptProblemDto : attemptProblemDtos) {
if (attemptProblemDto.getIsSolved())
acceptCount++;
}
TestRecordDto testRecordDto = TestRecordDto.builder()
.testId(test.getTestId())
.testDate(test.getTestDate())
.testTime(test.getTestTime())
.problemCount(test.getProblemCount())
.acceptCount(acceptCount)
.startDifficulty(test.getStartDifficulty())
.endDifficulty(test.getEndDifficulty())
.testTypename(test.getTestTypename())
Expand Down

0 comments on commit 659a6c5

Please sign in to comment.