Class ItemHelper12Impl
- java.lang.Object
-
- org.sakaiproject.tool.assessment.qti.helper.item.ItemHelperBase
-
- org.sakaiproject.tool.assessment.qti.helper.item.ItemHelper12Impl
-
- All Implemented Interfaces:
ItemHelperIfc
public class ItemHelper12Impl extends ItemHelperBase implements ItemHelperIfc
Version for QTI 1.2 item XML, significant differences between 1.2 and 2.0
* @version $Id$ Many methods in Fill in Blank and Numerical Responses(FIN) are identical for now. This might change if we want to add random variable, parameterized calculation....
-
-
Field Summary
Fields Modifier and Type Field Description protected String[]itemTypes-
Fields inherited from class org.sakaiproject.tool.assessment.qti.helper.item.ItemHelperBase
ITEM_AUDIO, ITEM_CALCQ, ITEM_EMI, ITEM_ESSAY, ITEM_FIB, ITEM_FILE, ITEM_FIN, ITEM_IMAGMQ, ITEM_MATCHING, ITEM_MCMC, ITEM_MCMC_SS, ITEM_MCSC, ITEM_MXSURVEY, ITEM_SURVEY, ITEM_TF
-
Fields inherited from interface org.sakaiproject.tool.assessment.qti.helper.item.ItemHelperIfc
ITEM_AUDIO, ITEM_CALCQ, ITEM_EMI, ITEM_ESSAY, ITEM_FIB, ITEM_FILE, ITEM_FIN, ITEM_IMAGMQ, ITEM_MATCHING, ITEM_MCMC, ITEM_MCMC_SS, ITEM_MCSC, ITEM_MXSURVEY, ITEM_SURVEY, ITEM_TF
-
-
Constructor Summary
Constructors Constructor Description ItemHelper12Impl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCorrectAnswer(String correctAnswerLabel, Item itemXml)Flags an answer as correct.voidaddIncorrectAnswer(String incorrectAnswerLabel, Item itemXml)Flags an answer as INCORRECT.voidaddMaxScore(Double score, Item itemXml)Add maximum score to item XML.voidaddMinScore(Double discount, Item itemXml)Add minimum score to item XMLvoidaddResponseEntry(Item itemXml, String xpath, String value, boolean isInsert, String responseNo, String responseLabel)Add/update a response label entryvoidflagAnswerCorrect(String answerLabel, Item itemXml, boolean correct)Flags an answer as correct/incorrect.protected AuthoringXmlgetAuthoringXml()We will have a versioned AuthoringXml in subclasses.StringgetItemType(Item itemXml)get item type stringStringgetMetaLabelXPath(String fieldlabel)Get the metadata field entry XPath for a given labelStringgetMetaXPath()Get the metadata field entry XPathprotected intgetQtiVersion()get the qti versionStringgetText(Item itemXml)Get the text for the itemvoidsetAnswers(List<org.sakaiproject.tool.assessment.data.ifc.assessment.ItemTextIfc> itemTextList, Item itemXml)Set the answer texts for item.voidsetAttachments(Set<? extends org.sakaiproject.tool.assessment.data.ifc.assessment.AttachmentIfc> attachmentSet, Item itemXml)voidsetFeedback(List<org.sakaiproject.tool.assessment.data.ifc.assessment.ItemTextIfc> itemTextList, Item itemXml)Set the feedback texts for item.voidsetItemLabel(String itemLabel, Item itemXml)Set the label for the item.voidsetItemText(String itemText, String flowClass, Item itemXml)Set the (usually instructional text) for the item for the specified flow.voidsetItemText(String itemText, Item itemXml)Set the item text.voidsetItemTexts(List<org.sakaiproject.tool.assessment.data.ifc.assessment.ItemTextIfc> itemTextList, Item itemXml)Set the (one or more) item texts.voidsetPresentationFlowResponseIdent(String presentationFlowResponseIdent, Item itemXml)Set the public void Presentation Flow Response IdentvoidsetPresentationLabel(String presentationLabel, Item itemXml)Set the presentation label.-
Methods inherited from class org.sakaiproject.tool.assessment.qti.helper.item.ItemHelperBase
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
readTypeSurveyItem, readTypeXMLItem, readXMLDocument, updateItemXml
-
-
-
-
Field Detail
-
itemTypes
protected String[] itemTypes
-
-
Method Detail
-
getAuthoringXml
protected AuthoringXml getAuthoringXml()
Description copied from class:ItemHelperBaseWe will have a versioned AuthoringXml in subclasses.- Specified by:
getAuthoringXmlin classItemHelperBase- Returns:
-
getQtiVersion
protected int getQtiVersion()
get the qti version- Specified by:
getQtiVersionin classItemHelperBase- Returns:
-
addMaxScore
public void addMaxScore(Double score, Item itemXml)
Add maximum score to item XML.- Specified by:
addMaxScorein interfaceItemHelperIfc- Parameters:
score-itemXml-
-
addMinScore
public void addMinScore(Double discount, Item itemXml)
Add minimum score to item XML- Specified by:
addMinScorein interfaceItemHelperIfc- Parameters:
score-itemXml-
-
addCorrectAnswer
public void addCorrectAnswer(String correctAnswerLabel, Item itemXml)
Flags an answer as correct.- Specified by:
addCorrectAnswerin interfaceItemHelperIfc- Parameters:
correctAnswerLabel- the answer that is correctitemXml- the encapsulation of the item xml
-
addIncorrectAnswer
public void addIncorrectAnswer(String incorrectAnswerLabel, Item itemXml)
Flags an answer as INCORRECT. Currently, only used for true false questions.- Specified by:
addIncorrectAnswerin interfaceItemHelperIfc- Parameters:
incorrectAnswerLabel- the answer that is NOT correctitemXml- the encapsulation of the item xml
-
flagAnswerCorrect
public void flagAnswerCorrect(String answerLabel, Item itemXml, boolean correct)
Flags an answer as correct/incorrect.- Parameters:
correctAnswerLabel- the answer that is correctitemXml- the encapsulation of the item xmlcorrect- true, or false if not correct
-
addResponseEntry
public void addResponseEntry(Item itemXml, String xpath, String value, boolean isInsert, String responseNo, String responseLabel)
Add/update a response label entry- Parameters:
itemXml-xpath-itemText-isInsert-responseNo-responseLabelIdent-
-
getMetaXPath
public String getMetaXPath()
Get the metadata field entry XPath- Specified by:
getMetaXPathin interfaceItemHelperIfc- Returns:
- the XPath
-
getMetaLabelXPath
public String getMetaLabelXPath(String fieldlabel)
Get the metadata field entry XPath for a given label- Specified by:
getMetaLabelXPathin interfaceItemHelperIfc- Parameters:
fieldlabel-- Returns:
- the XPath
-
getText
public String getText(Item itemXml)
Get the text for the item- Specified by:
getTextin interfaceItemHelperIfc- Parameters:
itemXml-- Returns:
- the text
-
setItemLabel
public void setItemLabel(String itemLabel, Item itemXml)
Description copied from interface:ItemHelperIfcSet the label for the item.- Specified by:
setItemLabelin interfaceItemHelperIfc
-
setPresentationLabel
public void setPresentationLabel(String presentationLabel, Item itemXml)
Description copied from interface:ItemHelperIfcSet the presentation label.- Specified by:
setPresentationLabelin interfaceItemHelperIfc
-
setPresentationFlowResponseIdent
public void setPresentationFlowResponseIdent(String presentationFlowResponseIdent, Item itemXml)
Description copied from interface:ItemHelperIfcSet the public void Presentation Flow Response Ident- Specified by:
setPresentationFlowResponseIdentin interfaceItemHelperIfc
-
setItemText
public void setItemText(String itemText, Item itemXml)
Set the item text. This is valid for all undelimited single item texts. Not valid for matching or fill in the blank, but OK for instructional text- Specified by:
setItemTextin interfaceItemHelperIfc- Parameters:
itemText- text to be updateditemXml-
-
setItemText
public void setItemText(String itemText, String flowClass, Item itemXml)
Description copied from interface:ItemHelperIfcSet the (usually instructional text) for the item for the specified flow.- Specified by:
setItemTextin interfaceItemHelperIfc
-
setItemTexts
public void setItemTexts(List<org.sakaiproject.tool.assessment.data.ifc.assessment.ItemTextIfc> itemTextList, Item itemXml)
Set the (one or more) item texts. Valid for single and multiple texts.- Specified by:
setItemTextsin interfaceItemHelperIfc- Parameters:
itemXml-itemText- text to be updated
-
getItemType
public String getItemType(Item itemXml)
get item type string- Specified by:
getItemTypein interfaceItemHelperIfc- Parameters:
itemXml-- Returns:
- type as string
-
setAnswers
public void setAnswers(List<org.sakaiproject.tool.assessment.data.ifc.assessment.ItemTextIfc> itemTextList, Item itemXml)
Set the answer texts for item.- Specified by:
setAnswersin interfaceItemHelperIfc- Parameters:
itemTextList- the text(s) for item
-
setFeedback
public void setFeedback(List<org.sakaiproject.tool.assessment.data.ifc.assessment.ItemTextIfc> itemTextList, Item itemXml)
Set the feedback texts for item.- Specified by:
setFeedbackin interfaceItemHelperIfc- Parameters:
itemTextList- the text(s) for itemitemXml-
-
setAttachments
public void setAttachments(Set<? extends org.sakaiproject.tool.assessment.data.ifc.assessment.AttachmentIfc> attachmentSet, Item itemXml)
- Specified by:
setAttachmentsin interfaceItemHelperIfc
-
-