algoanim.interactionsupport
Class InteractiveQuestion

java.lang.Object
  extended by algoanim.interactionsupport.InteractiveElement
      extended by algoanim.interactionsupport.InteractiveQuestion
Direct Known Subclasses:
FillInBlanksQuestion, MultipleChoiceQuestion, MultipleSelectionQuestion, TrueFalseQuestion

public class InteractiveQuestion
extends InteractiveElement


Field Summary
protected  java.util.HashMap<java.lang.String,java.lang.String> feedback
           
protected  int pointsPossible
           
protected  java.lang.String questionGroupID
           
protected  java.lang.String questionPrompt
           
 
Fields inherited from class algoanim.interactionsupport.InteractiveElement
id, language
 
Constructor Summary
InteractiveQuestion(Language lang, java.lang.String id)
           
 
Method Summary
 int getPointsPossible()
          returns the number of points possible for this question
 java.lang.String getPrompt()
          returns the question prompt, i.e., the introductory text that describes the question statement.
 java.lang.String getQuestionGroup()
          returns the ID of the question group.
 void setPointsPossible(int nrPoints)
          assigns the number of points possible for a "perfect" answer to this question
 void setPrompt(java.lang.String questionText)
          assigns the question prompt which describes the problem statement for this question
 void setQuestionGroup(java.lang.String groupID)
          assigns the question group ID for this question.
 
Methods inherited from class algoanim.interactionsupport.InteractiveElement
getID, setID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

questionPrompt

protected java.lang.String questionPrompt

questionGroupID

protected java.lang.String questionGroupID

pointsPossible

protected int pointsPossible

feedback

protected java.util.HashMap<java.lang.String,java.lang.String> feedback
Constructor Detail

InteractiveQuestion

public InteractiveQuestion(Language lang,
                           java.lang.String id)
Method Detail

getPointsPossible

public int getPointsPossible()
returns the number of points possible for this question

Returns:
the number of points possible for a "perfect" answer

getPrompt

public java.lang.String getPrompt()
returns the question prompt, i.e., the introductory text that describes the question statement.

Returns:
the question prompt

getQuestionGroup

public java.lang.String getQuestionGroup()
returns the ID of the question group. This can be used to prevent multiple questions of the "same" type to be asked once the user has answered a "sufficient" number of them correctly.

Returns:
the ID of the group of the question, if any. Returns null if there is no associated ID.

setPointsPossible

public void setPointsPossible(int nrPoints)
assigns the number of points possible for a "perfect" answer to this question

Parameters:
nrPoints - the maximum number of points possible for this question

setPrompt

public void setPrompt(java.lang.String questionText)
assigns the question prompt which describes the problem statement for this question

Parameters:
questionText - the text to be used as the question prompt.

setQuestionGroup

public void setQuestionGroup(java.lang.String groupID)
assigns the question group ID for this question. This can be used to prevent multiple questions of the "same" type to be asked once the user has answered a "sufficient" number of them correctly.

Parameters:
groupID - the question group ID for this question.