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

java.lang.Object
  extended byorg.sakaiproject.tool.assessment.qti.helper.item.ItemHelperBase
      extended byorg.sakaiproject.tool.assessment.qti.helper.item.ItemHelper20Impl
All Implemented Interfaces:
ItemHelperIfc

public class ItemHelper20Impl
extends ItemHelperBase
implements ItemHelperIfc

Copyright: Copyright (c) 2004

Organization: Sakai Project

Version for QTI 2.0 item XML, significant differences between 1.2 and 2.0

Version:
$Id: ItemHelper20Impl.java 1726 2005-09-14 23:55:18Z esmiley@stanford.edu $
Author:
Ed Smiley esmiley@stanford.edu

Field Summary
 
Fields inherited from class org.sakaiproject.tool.assessment.qti.helper.item.ItemHelperBase
ITEM_AUDIO, ITEM_ESSAY, ITEM_FIB, ITEM_FILE, ITEM_MATCHING, ITEM_MCMC, ITEM_MCSC, ITEM_SURVEY, ITEM_TF
 
Fields inherited from interface org.sakaiproject.tool.assessment.qti.helper.item.ItemHelperIfc
ITEM_AUDIO, ITEM_ESSAY, ITEM_FIB, ITEM_FILE, ITEM_MATCHING, ITEM_MCMC, ITEM_MCSC, ITEM_SURVEY, ITEM_TF, itemTypes
 
Constructor Summary
ItemHelper20Impl()
           
 
Method Summary
 void addCorrectAnswer(String correctAnswerLabel, Item itemXml)
          Flags an answer as correct.
 void addIncorrectAnswer(String incorrectAnswerLabel, Item itemXml)
          Flags an answer as NOT correct.
 void addMaxScore(Float score, Item itemXml)
          Add maximum score to item XML.
 void addMinScore(Float score, Item itemXml)
          Add minimum score to item XML
protected  AuthoringXml getAuthoringXml()
          We will have a versioned AuthoringXml in subclasses.
 String getItemType(Item itemXml)
          get item type string we use title for this for now
 String getMetaLabelXPath(String fieldlabel)
          assessmentItem/qtiMetadata not be permissible in QTI 2.0 this this should be used by manifest Get the metadata field entry XPath for a given label
 String getMetaXPath()
          assessmentItem/qtiMetadata not be permissible in QTI 2.0 this this should be used by manifest Get the metadata field entry XPath
protected  int getQtiVersion()
          get QTI version
 String getText(Item itemXml)
          Get the text for the item
 void setAnswers(ArrayList itemTextList, Item itemXml)
          Set the answer texts for item.
 void setFeedback(ArrayList itemTextList, Item itemXml)
          Set the feedback texts for item.
 void setItemText(String itemText, Item itemXml)
          Set the (usually instructional text) for trhe item.
 void setItemTexts(ArrayList itemTextList, Item itemXml)
          Set the (one or more) item texts.
 
Methods inherited from class org.sakaiproject.tool.assessment.qti.helper.item.ItemHelperBase
getItemTypeString, makeItemNodeText, readTypeSurveyItem, readTypeXMLItem, readXMLDocument, updateItemXml
 
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
getItemTypeString, readTypeSurveyItem, readTypeXMLItem, readXMLDocument, updateItemXml
 

Constructor Detail

ItemHelper20Impl

public ItemHelper20Impl()
Method Detail

getAuthoringXml

protected AuthoringXml getAuthoringXml()
Description copied from class: ItemHelperBase
We will have a versioned AuthoringXml in subclasses.

Specified by:
getAuthoringXml in class ItemHelperBase
Returns:

addMaxScore

public void addMaxScore(Float score,
                        Item itemXml)
Add maximum score to item XML.

Specified by:
addMaxScore in interface ItemHelperIfc
Parameters:
score -
itemXml -

addMinScore

public void addMinScore(Float score,
                        Item itemXml)
Add minimum score to item XML

Specified by:
addMinScore in interface ItemHelperIfc
Parameters:
score -
itemXml -

addCorrectAnswer

public void addCorrectAnswer(String correctAnswerLabel,
                             Item itemXml)
Flags an answer as correct.

Specified by:
addCorrectAnswer in interface ItemHelperIfc
Parameters:
correctAnswerLabel -

getMetaXPath

public String getMetaXPath()
assessmentItem/qtiMetadata not be permissible in QTI 2.0 this this should be used by manifest Get the metadata field entry XPath

Specified by:
getMetaXPath in interface ItemHelperIfc
Returns:
the XPath

getMetaLabelXPath

public String getMetaLabelXPath(String fieldlabel)
assessmentItem/qtiMetadata not be permissible in QTI 2.0 this this should be used by manifest Get the metadata field entry XPath for a given label

Specified by:
getMetaLabelXPath in interface ItemHelperIfc
Parameters:
fieldlabel -
Returns:
the XPath

getText

public String getText(Item itemXml)
Get the text for the item

Specified by:
getText in interface ItemHelperIfc
Parameters:
itemXml -
Returns:
the text

setItemTexts

public void setItemTexts(ArrayList itemTextList,
                         Item itemXml)
Set the (one or more) item texts. Valid for single and multiple texts.

Specified by:
setItemTexts in interface ItemHelperIfc
Parameters:
itemXml -

getItemType

public String getItemType(Item itemXml)
get item type string we use title for this for now

Specified by:
getItemType in interface ItemHelperIfc
Parameters:
itemXml -
Returns:
type as string

setAnswers

public void setAnswers(ArrayList itemTextList,
                       Item itemXml)
Set the answer texts for item.

Specified by:
setAnswers in interface ItemHelperIfc
Parameters:
itemTextList - the text(s) for item

setFeedback

public void setFeedback(ArrayList itemTextList,
                        Item itemXml)
Description copied from interface: ItemHelperIfc
Set the feedback texts for item.

Specified by:
setFeedback in interface ItemHelperIfc
Parameters:
itemTextList - the text(s) for item

getQtiVersion

protected int getQtiVersion()
get QTI version

Specified by:
getQtiVersion in class ItemHelperBase
Returns:

addIncorrectAnswer

public void addIncorrectAnswer(String incorrectAnswerLabel,
                               Item itemXml)
Description copied from interface: ItemHelperIfc
Flags an answer as NOT correct.

Specified by:
addIncorrectAnswer in interface ItemHelperIfc
Parameters:
incorrectAnswerLabel -
itemXml -

setItemText

public void setItemText(String itemText,
                        Item itemXml)
Description copied from interface: ItemHelperIfc
Set the (usually instructional text) for trhe item.

Specified by:
setItemText in interface ItemHelperIfc
Parameters:
itemText -
itemXml -