org.apache.myfaces.trinidaddemo.survey
Class MultChoiceQuestionBean

java.lang.Object
  extended by org.apache.myfaces.trinidaddemo.survey.MultChoiceQuestionBean
All Implemented Interfaces:
Serializable, QuestionBean

public class MultChoiceQuestionBean
extends Object
implements QuestionBean, Serializable

class MultChoiceQuestionBean This bean represents a single multiple choice questions. It has fields for the question prompt, a list of choices, and the correct answer.

See Also:
Serialized Form

Constructor Summary
MultChoiceQuestionBean()
          Class constructor (no arguments).
MultChoiceQuestionBean(String prompt, List<String> choices, int correctIndex)
          Class constructor.
 
Method Summary
 List<String> getAnswerStrings()
          returns the list of answer strings.
 String getCorrectAnswerMessage()
          returns a message describing the correct answer choices.
 int getCorrectIndex()
          returns the index of the correct answer
 String getPrompt()
          returns the question prompt.
 String toString()
          typical toString method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultChoiceQuestionBean

public MultChoiceQuestionBean()
Class constructor (no arguments).


MultChoiceQuestionBean

public MultChoiceQuestionBean(String prompt,
                              List<String> choices,
                              int correctIndex)
Class constructor.

Method Detail

getPrompt

public String getPrompt()
returns the question prompt.

Specified by:
getPrompt in interface QuestionBean
Returns:
the question prompt

getAnswerStrings

public List<String> getAnswerStrings()
returns the list of answer strings.


toString

public String toString()
typical toString method

Overrides:
toString in class Object
Returns:
a String representation of a MultChoiceQuestionBean

getCorrectAnswerMessage

public String getCorrectAnswerMessage()
returns a message describing the correct answer choices.

Specified by:
getCorrectAnswerMessage in interface QuestionBean
Returns:
a message describing the correct answer choices

getCorrectIndex

public int getCorrectIndex()
returns the index of the correct answer

Returns:
the index of the correct answer


Copyright © 2001-2011 The Apache Software Foundation. All Rights Reserved.