org.sakaiproject.tool.assessment.data.dao.assessment
Class ItemData

java.lang.Object
  extended byorg.sakaiproject.tool.assessment.data.dao.assessment.ItemData
All Implemented Interfaces:
Comparable, ItemDataIfc, Serializable

public class ItemData
extends Object
implements Serializable, ItemDataIfc, Comparable

See Also:
Serialized Form

Field Summary
static Long ADMIN
           
 
Fields inherited from interface org.sakaiproject.tool.assessment.data.ifc.assessment.ItemDataIfc
ACTIVE_STATUS, INACTIVE_STATUS
 
Constructor Summary
ItemData()
           
ItemData(SectionDataIfc section, Integer sequence, Integer duration, String instruction, String description, Long typeId, String grade, Float score, String hint, Boolean hasRationale, Integer status, String createdBy, Date createdDate, String lastModifiedBy, Date lastModifiedDate, Set itemTextSet, Set itemMetaDataSet, Set itemFeedbackSet)
           
ItemData(SectionDataIfc section, Integer sequence, Integer duration, String instruction, String description, Long typeId, String grade, Float score, String hint, Boolean hasRationale, Integer status, String createdBy, Date createdDate, String lastModifiedBy, Date lastModifiedDate, Set itemTextSet, Set itemMetaDataSet, Set itemFeedbackSet, Integer triesAllowed)
           
 
Method Summary
 void addItemFeedback(String typeId, String text)
           
 void addItemMetaData(String label, String entry)
           
 void addItemText(String text, Set answerSet)
           
 Object clone()
           
 int compareTo(Object o)
           
 Set copyAnswerFeedbackSet(Answer newAnswer, Set answerFeedbackSet)
           
 Set copyAnswerSet(ItemText newItemText, Set answerSet)
           
 Set copyItemFeedbackSet(ItemData cloned, Set itemFeedbackSet)
           
 Set copyItemMetaDataSet(ItemData cloned, Set itemMetaDataSet)
           
 Set copyItemTextSet(ItemData cloned, Set itemTextSet)
           
 String getAnswerKey()
          This method return the answerKey for a matching question e.g.
 boolean getCorrectItemFbIsNotEmpty()
           
 String getCorrectItemFeedback()
           
 String getCreatedBy()
           
 Date getCreatedDate()
           
 String getDescription()
           
 Integer getDuration()
           
 boolean getGeneralItemFbIsNotEmpty()
           
 String getGeneralItemFeedback()
          Get General Feedback
 String getGrade()
           
 Boolean getHasRationale()
           
 String getHint()
           
 boolean getIncorrectItemFbIsNotEmpty()
           
 String getInCorrectItemFeedback()
           
 String getInstruction()
           
 Boolean getIsTrue()
          If this is a true-false question return true if it is true, else false.
 String getItemFeedback(String typeId)
           
 HashMap getItemFeedbackMap(Set itemFeedbackSet)
           
 Set getItemFeedbackSet()
           
 Long getItemId()
           
 String getItemIdString()
           
 String getItemMetaDataByLabel(String label)
           
 HashMap getItemMetaDataMap(Set itemMetaDataSet)
           
 Set getItemMetaDataSet()
           
 ArrayList getItemTextArray()
           
 ArrayList getItemTextArraySorted()
           
 Set getItemTextSet()
           
 String getLastModifiedBy()
           
 Date getLastModifiedDate()
           
 Float getScore()
           
 SectionDataIfc getSection()
           
 Integer getSequence()
           
 Integer getStatus()
           
 String getText()
          In the case of an ordinary question, this will obtain the a set of text with one element and return it; in FIB return multiple elements separated by underscores.
 Integer getTriesAllowed()
           
 TypeIfc getType()
           
 Long getTypeId()
           
 boolean isNotEmpty(String wyzText)
           
 void removeFeedbackByType(String typeId)
           
 void setCorrectItemFeedback(String text)
           
 void setCreatedBy(String createdBy)
           
 void setCreatedDate(Date createdDate)
           
 void setDescription(String description)
           
 void setDuration(Integer duration)
           
 void setGeneralItemFeedback(String text)
          Set General Feedback
 void setGrade(String grade)
           
 void setHasRationale(Boolean hasRationale)
           
 void setHint(String hint)
           
 void setInCorrectItemFeedback(String text)
           
 void setInstruction(String instruction)
           
 void setItemFeedbackSet(Set itemFeedbackSet)
           
 void setItemId(Long itemId)
           
 void setItemIdString(String itemIdString)
           
 void setItemMetaDataSet(Set itemMetaDataSet)
           
 void setItemTextSet(Set itemTextSet)
           
 void setLastModifiedBy(String lastModifiedBy)
           
 void setLastModifiedDate(Date lastModifiedDate)
           
 void setScore(Float score)
           
 void setSection(SectionDataIfc section)
           
 void setSequence(Integer sequence)
           
 void setStatus(Integer status)
           
 void setTriesAllowed(Integer triesAllowed)
           
 void setTypeId(Long typeId)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADMIN

public static Long ADMIN
Constructor Detail

ItemData

public ItemData()

ItemData

public ItemData(SectionDataIfc section,
                Integer sequence,
                Integer duration,
                String instruction,
                String description,
                Long typeId,
                String grade,
                Float score,
                String hint,
                Boolean hasRationale,
                Integer status,
                String createdBy,
                Date createdDate,
                String lastModifiedBy,
                Date lastModifiedDate,
                Set itemTextSet,
                Set itemMetaDataSet,
                Set itemFeedbackSet)

ItemData

public ItemData(SectionDataIfc section,
                Integer sequence,
                Integer duration,
                String instruction,
                String description,
                Long typeId,
                String grade,
                Float score,
                String hint,
                Boolean hasRationale,
                Integer status,
                String createdBy,
                Date createdDate,
                String lastModifiedBy,
                Date lastModifiedDate,
                Set itemTextSet,
                Set itemMetaDataSet,
                Set itemFeedbackSet,
                Integer triesAllowed)
Method Detail

clone

public Object clone()
             throws CloneNotSupportedException
Throws:
CloneNotSupportedException

copyItemTextSet

public Set copyItemTextSet(ItemData cloned,
                           Set itemTextSet)

copyAnswerSet

public Set copyAnswerSet(ItemText newItemText,
                         Set answerSet)

copyAnswerFeedbackSet

public Set copyAnswerFeedbackSet(Answer newAnswer,
                                 Set answerFeedbackSet)

copyItemMetaDataSet

public Set copyItemMetaDataSet(ItemData cloned,
                               Set itemMetaDataSet)

copyItemFeedbackSet

public Set copyItemFeedbackSet(ItemData cloned,
                               Set itemFeedbackSet)

getItemId

public Long getItemId()
Specified by:
getItemId in interface ItemDataIfc

setItemId

public void setItemId(Long itemId)
Specified by:
setItemId in interface ItemDataIfc

getItemIdString

public String getItemIdString()
Specified by:
getItemIdString in interface ItemDataIfc

setItemIdString

public void setItemIdString(String itemIdString)
Specified by:
setItemIdString in interface ItemDataIfc

getSection

public SectionDataIfc getSection()
Specified by:
getSection in interface ItemDataIfc

setSection

public void setSection(SectionDataIfc section)
Specified by:
setSection in interface ItemDataIfc

getDuration

public Integer getDuration()
Specified by:
getDuration in interface ItemDataIfc

setDuration

public void setDuration(Integer duration)
Specified by:
setDuration in interface ItemDataIfc

getSequence

public Integer getSequence()
Specified by:
getSequence in interface ItemDataIfc

setSequence

public void setSequence(Integer sequence)
Specified by:
setSequence in interface ItemDataIfc

getInstruction

public String getInstruction()
Specified by:
getInstruction in interface ItemDataIfc

setInstruction

public void setInstruction(String instruction)
Specified by:
setInstruction in interface ItemDataIfc

getDescription

public String getDescription()
Specified by:
getDescription in interface ItemDataIfc

setDescription

public void setDescription(String description)
Specified by:
setDescription in interface ItemDataIfc

getTypeId

public Long getTypeId()
Specified by:
getTypeId in interface ItemDataIfc

setTypeId

public void setTypeId(Long typeId)
Specified by:
setTypeId in interface ItemDataIfc

getGrade

public String getGrade()
Specified by:
getGrade in interface ItemDataIfc

setGrade

public void setGrade(String grade)
Specified by:
setGrade in interface ItemDataIfc

getScore

public Float getScore()
Specified by:
getScore in interface ItemDataIfc

setScore

public void setScore(Float score)
Specified by:
setScore in interface ItemDataIfc

getHint

public String getHint()
Specified by:
getHint in interface ItemDataIfc

setHint

public void setHint(String hint)
Specified by:
setHint in interface ItemDataIfc

getHasRationale

public Boolean getHasRationale()
Specified by:
getHasRationale in interface ItemDataIfc

setHasRationale

public void setHasRationale(Boolean hasRationale)
Specified by:
setHasRationale in interface ItemDataIfc

getStatus

public Integer getStatus()
Specified by:
getStatus in interface ItemDataIfc

setStatus

public void setStatus(Integer status)
Specified by:
setStatus in interface ItemDataIfc

getCreatedBy

public String getCreatedBy()
Specified by:
getCreatedBy in interface ItemDataIfc

setCreatedBy

public void setCreatedBy(String createdBy)
Specified by:
setCreatedBy in interface ItemDataIfc

getCreatedDate

public Date getCreatedDate()
Specified by:
getCreatedDate in interface ItemDataIfc

setCreatedDate

public void setCreatedDate(Date createdDate)
Specified by:
setCreatedDate in interface ItemDataIfc

getLastModifiedBy

public String getLastModifiedBy()
Specified by:
getLastModifiedBy in interface ItemDataIfc

setLastModifiedBy

public void setLastModifiedBy(String lastModifiedBy)
Specified by:
setLastModifiedBy in interface ItemDataIfc

getLastModifiedDate

public Date getLastModifiedDate()
Specified by:
getLastModifiedDate in interface ItemDataIfc

setLastModifiedDate

public void setLastModifiedDate(Date lastModifiedDate)
Specified by:
setLastModifiedDate in interface ItemDataIfc

getItemTextSet

public Set getItemTextSet()
Specified by:
getItemTextSet in interface ItemDataIfc

setItemTextSet

public void setItemTextSet(Set itemTextSet)
Specified by:
setItemTextSet in interface ItemDataIfc

getItemMetaDataSet

public Set getItemMetaDataSet()
Specified by:
getItemMetaDataSet in interface ItemDataIfc

setItemMetaDataSet

public void setItemMetaDataSet(Set itemMetaDataSet)
Specified by:
setItemMetaDataSet in interface ItemDataIfc

getItemMetaDataMap

public HashMap getItemMetaDataMap(Set itemMetaDataSet)
Specified by:
getItemMetaDataMap in interface ItemDataIfc

getItemFeedbackSet

public Set getItemFeedbackSet()
Specified by:
getItemFeedbackSet in interface ItemDataIfc

setItemFeedbackSet

public void setItemFeedbackSet(Set itemFeedbackSet)
Specified by:
setItemFeedbackSet in interface ItemDataIfc

getItemFeedbackMap

public HashMap getItemFeedbackMap(Set itemFeedbackSet)
Specified by:
getItemFeedbackMap in interface ItemDataIfc

addItemText

public void addItemText(String text,
                        Set answerSet)
Specified by:
addItemText in interface ItemDataIfc

getItemMetaDataByLabel

public String getItemMetaDataByLabel(String label)
Specified by:
getItemMetaDataByLabel in interface ItemDataIfc

addItemMetaData

public void addItemMetaData(String label,
                            String entry)
Specified by:
addItemMetaData in interface ItemDataIfc

getCorrectItemFeedback

public String getCorrectItemFeedback()
Specified by:
getCorrectItemFeedback in interface ItemDataIfc

setCorrectItemFeedback

public void setCorrectItemFeedback(String text)
Specified by:
setCorrectItemFeedback in interface ItemDataIfc

getInCorrectItemFeedback

public String getInCorrectItemFeedback()
Specified by:
getInCorrectItemFeedback in interface ItemDataIfc

setInCorrectItemFeedback

public void setInCorrectItemFeedback(String text)
Specified by:
setInCorrectItemFeedback in interface ItemDataIfc

getGeneralItemFeedback

public String getGeneralItemFeedback()
Get General Feedback

Specified by:
getGeneralItemFeedback in interface ItemDataIfc
Returns:

setGeneralItemFeedback

public void setGeneralItemFeedback(String text)
Set General Feedback

Specified by:
setGeneralItemFeedback in interface ItemDataIfc
Parameters:
text -

getItemFeedback

public String getItemFeedback(String typeId)
Specified by:
getItemFeedback in interface ItemDataIfc

addItemFeedback

public void addItemFeedback(String typeId,
                            String text)
Specified by:
addItemFeedback in interface ItemDataIfc

removeFeedbackByType

public void removeFeedbackByType(String typeId)
Specified by:
removeFeedbackByType in interface ItemDataIfc

getIsTrue

public Boolean getIsTrue()
If this is a true-false question return true if it is true, else false. If it is not a true-false question return false.

Specified by:
getIsTrue in interface ItemDataIfc
Returns:
true if this is a true true-false question

getText

public String getText()
In the case of an ordinary question, this will obtain the a set of text with one element and return it; in FIB return multiple elements separated by underscores.

Specified by:
getText in interface ItemDataIfc
Returns:
text of question

getType

public TypeIfc getType()
Specified by:
getType in interface ItemDataIfc

getItemTextArray

public ArrayList getItemTextArray()
Specified by:
getItemTextArray in interface ItemDataIfc

getItemTextArraySorted

public ArrayList getItemTextArraySorted()
Specified by:
getItemTextArraySorted in interface ItemDataIfc

setTriesAllowed

public void setTriesAllowed(Integer triesAllowed)
Specified by:
setTriesAllowed in interface ItemDataIfc

getTriesAllowed

public Integer getTriesAllowed()
Specified by:
getTriesAllowed in interface ItemDataIfc

getAnswerKey

public String getAnswerKey()
This method return the answerKey for a matching question e.g. A:2, B:3, C:1, D:4 (where A, B & C is the answer label and 1,2 &3 are the itemText sequence Added by Huong Nguyen for other types as well.

Specified by:
getAnswerKey in interface ItemDataIfc

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable

getGeneralItemFbIsNotEmpty

public boolean getGeneralItemFbIsNotEmpty()

getCorrectItemFbIsNotEmpty

public boolean getCorrectItemFbIsNotEmpty()

getIncorrectItemFbIsNotEmpty

public boolean getIncorrectItemFbIsNotEmpty()

isNotEmpty

public boolean isNotEmpty(String wyzText)