org.sakaiproject.tool.assessment.qti.helper.item
Interface ItemHelperIfc

All Known Implementing Classes:
ItemHelper12Impl, ItemHelper20Impl, ItemHelperBase

public interface ItemHelperIfc

Interface for QTI-versioned item helper implementation.

Copyright: Copyright (c) 2005

Organization: Sakai Project

Version:
$Id: ItemHelperIfc.java 2439 2005-10-07 20:14:14Z rshastri@iupui.edu $
Author:
Ed Smiley esmiley@stanford.edu

Field Summary
static long ITEM_AUDIO
           
static long ITEM_ESSAY
           
static long ITEM_FIB
           
static long ITEM_FILE
           
static long ITEM_MATCHING
           
static long ITEM_MCMC
           
static long ITEM_MCSC
           
static long ITEM_SURVEY
           
static long ITEM_TF
           
static String[] itemTypes
           
 
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 minimum score to item XML.
 void addMinScore(Float score, Item itemXml)
          Add maximum score to item XML
 String getItemType(Item itemXml)
           
 String getItemTypeString(TypeIfc type)
          Get item type string which is used for the title of a given item type
 String getMetaLabelXPath(String fieldlabel)
          Get the metadata field entry XPath for a given label
 String getMetaXPath()
          Get the metadata field entry XPath
 String getText(Item itemXml)
          Get the text for the item
 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 XML document from input stream
 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.
 Item updateItemXml(Item itemXml, String xpath, String value)
          DOCUMENTATION PENDING
 

Field Detail

ITEM_AUDIO

public static final long ITEM_AUDIO

ITEM_ESSAY

public static final long ITEM_ESSAY

ITEM_FILE

public static final long ITEM_FILE

ITEM_FIB

public static final long ITEM_FIB

ITEM_MCSC

public static final long ITEM_MCSC

ITEM_SURVEY

public static final long ITEM_SURVEY

ITEM_MCMC

public static final long ITEM_MCMC

ITEM_TF

public static final long ITEM_TF

ITEM_MATCHING

public static final long ITEM_MATCHING

itemTypes

public static final String[] itemTypes
Method Detail

readTypeXMLItem

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

Parameters:
type - item type as a TypeIfc
Returns:

readTypeSurveyItem

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

Parameters:
scaleName -
Returns:

readXMLDocument

public Item readXMLDocument(InputStream inputStream)
Read XML document from input stream

Parameters:
inputStream - XML docuemnt stream
Returns:
item XML

getItemTypeString

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

Parameters:
type -
Returns:

updateItemXml

public Item updateItemXml(Item itemXml,
                          String xpath,
                          String value)
DOCUMENTATION PENDING

Parameters:
itemXml - item xml to update
xpath - the XPath
value - value to set
Returns:
the item xml

addMaxScore

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

Parameters:
score -
itemXml -

addMinScore

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

Parameters:
score -
itemXml -

addCorrectAnswer

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

Parameters:
correctAnswerLabel -

addIncorrectAnswer

public void addIncorrectAnswer(String incorrectAnswerLabel,
                               Item itemXml)
Flags an answer as NOT correct.


getMetaXPath

public String getMetaXPath()
Get the metadata field entry XPath

Returns:
the XPath

getMetaLabelXPath

public String getMetaLabelXPath(String fieldlabel)
Get the metadata field entry XPath for a given label

Parameters:
fieldlabel -
Returns:
the XPath

getText

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

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.

Parameters:
itemXml -

setItemText

public void setItemText(String itemText,
                        Item itemXml)
Set the (usually instructional text) for trhe item.

Parameters:
itemText -
itemXml -

getItemType

public String getItemType(Item itemXml)
Parameters:
itemXml -
Returns:
type as string

setAnswers

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

Parameters:
itemTextList - the text(s) for item

setFeedback

public void setFeedback(ArrayList itemTextList,
                        Item itemXml)
Set the feedback texts for item.

Parameters:
itemTextList - the text(s) for item