lecturequiz.server.data
Class Question

java.lang.Object
  extended by 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)
           
 
Method Summary
 java.util.ArrayList<Answer> getAnswers()
          Returns the answers for this question
 int getCorrectAnswer()
          Returns the correct answer to this question
 int getID()
           
 QuestionInfo getQuestionInfo()
          Build a QuestionInfo object and return it.
 int getTimeout()
           
 boolean hasAnswer(int answerId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Question

public Question(int id,
                java.lang.String text,
                int timeout,
                java.util.ArrayList<Answer> answers,
                Answer correctAnswer)
Method Detail

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