public class SimpleMultipleChoiceQuestion extends Object implements MultipleChoiceQuestion
MultipleChoiceQuestion
for containing a prompt,
list of options and the correct index.Constructor and Description |
---|
SimpleMultipleChoiceQuestion(String prompt,
List<String> options,
int correctAnswer)
Constructs this question with the provided prompt, options and answer.
|
Modifier and Type | Method and Description |
---|---|
int |
getCorrectAnswer()
Returns the index of the correct answer in the list of options.
|
List<String> |
getOptions()
Returns a list of options to the prompt question.
|
String |
getPrompt()
Returns the question prompt.
|
String |
toString()
Returns a human-readable form of the question.
|
public String getPrompt()
getPrompt
in interface MultipleChoiceQuestion
public List<String> getOptions()
getOptions
in interface MultipleChoiceQuestion
public int getCorrectAnswer()
getCorrectAnswer
in interface MultipleChoiceQuestion
Copyright © 2012. All Rights Reserved.