Skip to content

Commit

Permalink
Fix: Eliminated unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
UO283615 committed Apr 24, 2024
1 parent e37ad64 commit 2a700fd
Showing 1 changed file with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,9 @@
@Component
public class QuestionHelper {

private static int MAX_DISTRACTORS = 3;
private static final int MAX_DISTRACTORS = 3;

public static List<Answer> getDistractors(AnswerRepository answerRepository, Question question){
List<Answer> distractors = new ArrayList<>();
AnswerCategory cat = question.getAnswerCategory();

switch (cat){ // Write the case only for the exceptions
case COUNTRY:
// Implement more cases
break;
default:
distractors = answerRepository.findDistractors(question.getAnswerCategory().toString(), question.getLanguage(), question.getCorrectAnswer().getText(), MAX_DISTRACTORS);
}

return distractors;
return answerRepository.findDistractors(question.getAnswerCategory().toString(), question.getLanguage(), question.getCorrectAnswer().getText(), MAX_DISTRACTORS);
}
}

0 comments on commit 2a700fd

Please sign in to comment.