public class MultipleChoice extends Question
Modifier and Type | Field and Description |
---|---|
private int |
answer
Int that represents the index of the correct answer
|
private java.util.ArrayList<java.lang.String> |
choices
ArrayList that represents the multiple answers of the question
|
Constructor and Description |
---|
MultipleChoice()
Constructor for the MultipleChoice class
|
Modifier and Type | Method and Description |
---|---|
void |
addChoice(java.lang.String text)
Adds a choice to the list of choices for the question
|
int |
getAnswer()
Gets the index of the correct answer in the ArrayList
|
java.util.ArrayList<java.lang.String> |
getChoices()
Gets the choices of answers from ArrayList
|
void |
removeChoice(int ndx)
Removes a choice from the list of choices for the question
|
void |
setAnswer(int ndx)
Sets the answer from the list of choices for the question
|
getCourse, getDiagramPath, getDifficulty, getKeyword, getQuestionText, getTime, setCourse, setDiagramPath, setDifficulty, setKeyword, setQuestionText, setTime
private java.util.ArrayList<java.lang.String> choices
private int answer
public java.util.ArrayList<java.lang.String> getChoices()
public int getAnswer()
public void addChoice(java.lang.String text)
public void removeChoice(int ndx)
public void setAnswer(int ndx)