diff --git a/backend/src/main/java/com/edufocus/edufocus/report/entity/dto/ReportRequset.java b/backend/src/main/java/com/edufocus/edufocus/report/entity/dto/ReportRequset.java index e88a821..84e3e74 100644 --- a/backend/src/main/java/com/edufocus/edufocus/report/entity/dto/ReportRequset.java +++ b/backend/src/main/java/com/edufocus/edufocus/report/entity/dto/ReportRequset.java @@ -10,7 +10,7 @@ import java.util.List; public class ReportRequset { - List answerInputList; + List answer; // [1,2,,3] // List a diff --git a/backend/src/main/java/com/edufocus/edufocus/report/entity/vo/Report.java b/backend/src/main/java/com/edufocus/edufocus/report/entity/vo/Report.java index a9e2222..1b81e78 100644 --- a/backend/src/main/java/com/edufocus/edufocus/report/entity/vo/Report.java +++ b/backend/src/main/java/com/edufocus/edufocus/report/entity/vo/Report.java @@ -23,13 +23,13 @@ public class Report { private int allCount; private int correctCount; private Date testAt; - + private Long lectureId; @ManyToOne - @JoinColumn(name= "user_id") + @JoinColumn(name = "user_id") private User user; @ManyToOne - @JoinColumn(name= "quizset_id") + @JoinColumn(name = "quizset_id") private QuizSet quizSet; } diff --git a/backend/src/main/java/com/edufocus/edufocus/report/service/ReportServiceImpl.java b/backend/src/main/java/com/edufocus/edufocus/report/service/ReportServiceImpl.java index bbbc8aa..f2666bc 100644 --- a/backend/src/main/java/com/edufocus/edufocus/report/service/ReportServiceImpl.java +++ b/backend/src/main/java/com/edufocus/edufocus/report/service/ReportServiceImpl.java @@ -45,7 +45,7 @@ public class ReportServiceImpl implements ReportService { QuizSet quizSet = quizSetService.findQuizSet(quizsetId); List quizList = quizSet.getQuizzes(); - List answerInputList = reportRequset.getAnswerInputList(); + List answerInputList = reportRequset.getAnswer(); List answerList = new ArrayList<>(); @@ -56,19 +56,20 @@ public class ReportServiceImpl implements ReportService { for (int idx = 0; idx < answerInputList.size(); idx++) { Quiz quiz = quizList.get(idx); - AnswerInput inputAnswer = answerInputList.get(idx); + String inputAnswer = answerInputList.get(idx); Answer answer; - if (quiz.getAnswer().equals(inputAnswer.getAnswer())) { + // + if (quiz.getAnswer().equals(inputAnswer)) { correctCount++; answer = Answer.builder() - .userAnswer(inputAnswer.getAnswer()) + .userAnswer(inputAnswer) .isCorrect(true) .report(null) .quiz(quiz) .build(); } else { answer = Answer.builder() - .userAnswer(inputAnswer.getAnswer()) + .userAnswer(inputAnswer) .isCorrect(false) .report(null) .quiz(quiz)