org.apache.myfaces.trinidaddemo.survey
Class CheckboxQuestionBean

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

public class CheckboxQuestionBean
extends Object
implements QuestionBean, Serializable

class CheckboxQuestionBean This bean represents a single multiple-answer checkbox style question. It has fields for the question prompt, a list of choices, and all the correct checkboxes in the answer. [Note: Due to a lack of support for dynamically iterating through data in early releases of Trinidad, this bean contains special get methods that help iterate through the list of choices for printing out on the screen.]

See Also:
Serialized Form

Constructor Summary
CheckboxQuestionBean()
          Class constructor (no arguments).
CheckboxQuestionBean(String prompt, ArrayList<String> choices, int correctAnswer, boolean checkbox0, boolean checkbox1, boolean checkbox2, boolean checkbox3)
          Class constructor.
 
Method Summary
 boolean getCheckbox0()
          IDE generated accessors
 boolean getCheckbox1()
           
 boolean getCheckbox2()
           
 boolean getCheckbox3()
           
 int getCorrectAnswer()
           
 String getCorrectAnswerMessage()
          returns a message describing the correct answer choices.
 String getCorrectAnswerMessage(int checkboxNum)
          Returns a message describing the correct answer for a particular checkbox.
 String getPrompt()
          returns the question prompt.
 String getText1()
           
 String getText2()
           
 String getText3()
           
 String getText4()
           
 String toString()
          typical toString method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CheckboxQuestionBean

public CheckboxQuestionBean()
Class constructor (no arguments).


CheckboxQuestionBean

public CheckboxQuestionBean(String prompt,
                            ArrayList<String> choices,
                            int correctAnswer,
                            boolean checkbox0,
                            boolean checkbox1,
                            boolean checkbox2,
                            boolean checkbox3)
Class constructor.

Method Detail

getPrompt

public String getPrompt()
returns the question prompt.

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

getText1

public String getText1()

getText2

public String getText2()

getText3

public String getText3()

getText4

public String getText4()

toString

public String toString()
typical toString method

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

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

getCorrectAnswerMessage

public String getCorrectAnswerMessage(int checkboxNum)
Returns a message describing the correct answer for a particular checkbox.

Parameters:
checkboxNum - the index of the checkbox
Returns:
a message describing the correct answer choices

getCheckbox0

public boolean getCheckbox0()
IDE generated accessors


getCheckbox1

public boolean getCheckbox1()

getCheckbox2

public boolean getCheckbox2()

getCheckbox3

public boolean getCheckbox3()

getCorrectAnswer

public int getCorrectAnswer()


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