Implement exam scoring service

This commit is contained in:
jieun committed 2026-10-20 20:36:47 +09:00
1 parent 995e69e302
commit d8ef029bef
1 file changed
+15
@@ -0,0 +1,15 @@
package com.example.questionbank.service.quiz;
import com.example.questionbank.domain.enumeration.OptionKey;
import org.springframework.stereotype.Service;
@Service
public class ExamScoringService {
public ScoringResult score(OptionKey correctOption, OptionKey selectedOption) {
boolean correct = selectedOption != null && selectedOption == correctOption;
return new ScoringResult(correct, correct ? 1 : 0);
}
public record ScoringResult(boolean correct, int awardedPoints) {}
}