lecturequiz.server.data
Class Question
java.lang.Object
lecturequiz.server.data.Question
public class Question
- extends java.lang.Object
Constructor Summary |
Question(int id,
java.lang.String text,
int timeout,
java.util.ArrayList<Answer> answers,
Answer correctAnswer)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Question
public Question(int id,
java.lang.String text,
int timeout,
java.util.ArrayList<Answer> answers,
Answer correctAnswer)
hasAnswer
public boolean hasAnswer(int answerId)
getTimeout
public int getTimeout()
getID
public int getID()
getQuestionInfo
public QuestionInfo getQuestionInfo()
- Build a QuestionInfo object and return it.
- Returns:
- An QuestionInfo object for this question.
getCorrectAnswer
public int getCorrectAnswer()
- Returns the correct answer to this question
- Returns:
- the ID of the correct answer
getAnswers
public java.util.ArrayList<Answer> getAnswers()
- Returns the answers for this question
- Returns:
- a list of all available answers