org.sakaiproject.tool.assessment.qti.helper.item
Class ItemHelperBase

java.lang.Object
  extended byorg.sakaiproject.tool.assessment.qti.helper.item.ItemHelperBase
All Implemented Interfaces:
ItemHelperIfc
Direct Known Subclasses:
ItemHelper12Impl, ItemHelper20Impl

public abstract class ItemHelperBase
extends Object
implements ItemHelperIfc


Field Summary
protected static long ITEM_AUDIO
           
protected static long ITEM_ESSAY
           
protected static long ITEM_FIB
           
protected static long ITEM_FILE
           
protected static long ITEM_MATCHING
           
protected static long ITEM_MCMC
           
protected static long ITEM_MCSC
           
protected static long ITEM_SURVEY
           
protected static long ITEM_TF
           
 
Fields inherited from interface org.sakaiproject.tool.assessment.qti.helper.item.ItemHelperIfc
itemTypes
 
Constructor Summary
ItemHelperBase()
           
 
Method Summary
protected abstract  AuthoringXml getAuthoringXml()
          We will have a versioned AuthoringXml in subclasses.
 String getItemTypeString(TypeIfc type)
          Get item type string which is used for the title of a given item type
protected abstract  int getQtiVersion()
          Get the QTI version for each subclass.
protected  String makeItemNodeText(Item itemXml, String xpath)
          Concatenate nodes for xpath
 Item readTypeSurveyItem(String scaleName)
          Get Item Xml for a given survey item scale name.
 Item readTypeXMLItem(TypeIfc type)
          Get Item Xml for a given item type as a TypeIfc.
 Item readXMLDocument(InputStream inputStream)
          Read an item XML document from a stream into an Item XML object
 Item updateItemXml(Item itemXml, String xpath, String value)
          Update path with value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.sakaiproject.tool.assessment.qti.helper.item.ItemHelperIfc
addCorrectAnswer, addIncorrectAnswer, addMaxScore, addMinScore, getItemType, getMetaLabelXPath, getMetaXPath, getText, setAnswers, setFeedback, setItemText, setItemTexts
 

Field Detail

ITEM_AUDIO

protected static final long ITEM_AUDIO

ITEM_ESSAY

protected static final long ITEM_ESSAY

ITEM_FILE

protected static final long ITEM_FILE

ITEM_FIB

protected static final long ITEM_FIB

ITEM_MCSC

protected static final long ITEM_MCSC

ITEM_SURVEY

protected static final long ITEM_SURVEY

ITEM_MCMC

protected static final long ITEM_MCMC

ITEM_TF

protected static final long ITEM_TF

ITEM_MATCHING

protected static final long ITEM_MATCHING
Constructor Detail

ItemHelperBase

public ItemHelperBase()
Method Detail

getAuthoringXml

protected abstract AuthoringXml getAuthoringXml()
We will have a versioned AuthoringXml in subclasses.

Returns:

getQtiVersion

protected abstract int getQtiVersion()
Get the QTI version for each subclass.

Returns:
a QTIVersion.VERSION_... constant

readXMLDocument

public Item readXMLDocument(InputStream inputStream)
Read an item XML document from a stream into an Item XML object

Specified by:
readXMLDocument in interface ItemHelperIfc
Parameters:
inputStream - XML document stream
Returns:
an Item XML object

readTypeXMLItem

public Item readTypeXMLItem(TypeIfc type)
Get Item Xml for a given item type as a TypeIfc.

Specified by:
readTypeXMLItem in interface ItemHelperIfc
Parameters:
type - item type as a TypeIfc
Returns:

readTypeSurveyItem

public Item readTypeSurveyItem(String scaleName)
Get Item Xml for a given survey item scale name.

Specified by:
readTypeSurveyItem in interface ItemHelperIfc
Parameters:
scaleName -
Returns:

getItemTypeString

public String getItemTypeString(TypeIfc type)
Get item type string which is used for the title of a given item type

Specified by:
getItemTypeString in interface ItemHelperIfc
Parameters:
type -
Returns:

updateItemXml

public Item updateItemXml(Item itemXml,
                          String xpath,
                          String value)
Update path with value

Specified by:
updateItemXml in interface ItemHelperIfc
Parameters:
itemXml - the item xml
xpath - the xpath
value - the value to set
Returns:
the item xml

makeItemNodeText

protected String makeItemNodeText(Item itemXml,
                                  String xpath)
Concatenate nodes for xpath

Parameters:
itemXml -
xpath -
Returns: