Created
March 20, 2016 21:01
-
-
Save AnEmortalKid/dd7712292d0da5953565 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static boolean displayQuestion(Question question) { | |
int optionChosen = JOptionPane.showOptionDialog(null, question.getQuestion(), "Please Select", | |
JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, question.getAnswerOptions(), | |
question.getAnswerOptions()[0]); | |
String answer = question.getAnswerOptions()[optionChosen]; | |
boolean correct = answer.equals(question.getCorrectAnswer()); | |
return correct; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment