Skip to content

Commit

Permalink
Merge pull request #396 from SWM-NM/feat/#395
Browse files Browse the repository at this point in the history
[FIX] 최근 4개의 테스트 중 정답 문제 개수 반환 추가
  • Loading branch information
aj4941 authored Oct 5, 2023
2 parents b7d9f14 + 659a6c5 commit 3f769e0
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 3f769e0

Please sign in to comment.