Class ExtractionHelper
- java.lang.Object
-
- org.sakaiproject.tool.assessment.qti.helper.ExtractionHelper
-
public class ExtractionHelper extends Object
Has helper methods for data extraction (import) from QTI
Copyright: Copyright (c) 2005 Sakai
- Version:
- $Id$
- Author:
- Ed Smiley esmiley@stanford.edu
-
-
Field Summary
Fields Modifier and Type Field Description static StringREMOVE_NAMESPACE_TRANSFORM
-
Constructor Summary
Constructors Constructor Description ExtractionHelper()Deprecated.ExtractionHelper(int qtiVersion)Get ExtractionHelper for QTIVersion.VERSION_1_2 or QTIVersion.VERSION_2_0
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ListgetItemXmlList(Section sectionXml)Look up a List of Item XML from Section XmlStringgetOverridePath()Primarily for testing purposes.intgetQtiVersion()Get QTI version flag.ListgetSectionXmlList(Assessment assessmentXml)Look up a List of Section XML from Assessment XmlDocumentgetTransformDocument(String template)DocumentgetTransformDocument(String template, boolean isRespondus)Get an XML document for the transformStringgetTransformPath()Path to XSL transform code.StringgetTransformPath(boolean isRespondus)voidmakeAssessmentAttachmentSet(org.sakaiproject.tool.assessment.facade.AssessmentFacade assessment)the ip address is in a newline delimited stringStringmakeFCKAttachment(String text)the ip address is in a newline delimited stringStringmakeFCKAttachment(List respondueTextList)StringmakeFCKAttachmentFromRespondus(String text)voidmakeItemAttachmentSet(org.sakaiproject.tool.assessment.facade.ItemFacade item)the ip address is in a newline delimited stringvoidmakeSectionAttachmentSet(org.sakaiproject.tool.assessment.facade.SectionFacade section, Map sectionMap)the ip address is in a newline delimited stringvoidmakeSecuredIPAddressSet(org.sakaiproject.tool.assessment.facade.AssessmentFacade assessment, String ipList)the ip address is in a newline delimited stringMapmapAssessment(Assessment assessmentXml)Get map of data to set from assessment XMLMapmapAssessment(Assessment assessmentXml, boolean isRespondus)MapmapEMIItem(Item itemXml, boolean isRespondus)MapmapItem(Item itemXml)Get map of data to set from item XMLMapmapItem(Item itemXml, boolean isRespondus)MapmapSection(Section sectionXml)MapmapSection(Section sectionXml, boolean isRespondus)Get map of data to set from section XMLvoidsetOverridePath(String overridePath)Primarily for testing purposes.voidsetQtiVersion(int qtiVersion)Set QTI version flag.voidsetUnzipLocation(String unzipLocation)voidupdateAssessment(org.sakaiproject.tool.assessment.facade.AssessmentFacade assessment, Map assessmentMap)Update assessment from the extracted properties.voidupdateItem(org.sakaiproject.tool.assessment.facade.ItemFacade item, Item itemXml)Update item from the extracted properties.voidupdateItem(org.sakaiproject.tool.assessment.facade.ItemFacade item, Item itemXml, boolean isRespondus)voidupdateItem(org.sakaiproject.tool.assessment.facade.ItemFacade item, Item itemXml, Map itemMap)voidupdateItem(org.sakaiproject.tool.assessment.facade.ItemFacade item, Item itemXml, Map itemMap, boolean isRespondus)voidupdateQuestionPool(org.sakaiproject.tool.assessment.facade.QuestionPoolFacade questionpool, Map assessmentMap)Update questionpool from the extracted properties.voidupdateSection(org.sakaiproject.tool.assessment.facade.SectionFacade section, Map sectionMap)Update section from the extracted properties.
-
-
-
Field Detail
-
REMOVE_NAMESPACE_TRANSFORM
public static final String REMOVE_NAMESPACE_TRANSFORM
- See Also:
- Constant Field Values
-
-
Method Detail
-
getTransformPath
public String getTransformPath()
Path to XSL transform code.- Returns:
- context-relative path to XSL transform code.
-
getTransformPath
public String getTransformPath(boolean isRespondus)
-
getQtiVersion
public int getQtiVersion()
Get QTI version flag. Either QTIVersion.VERSION_1_2 or QTIVersion.VERSION_2_0;- Returns:
- QTI version flag
-
setQtiVersion
public void setQtiVersion(int qtiVersion)
Set QTI version flag. Either QTIVersion.VERSION_1_2 or QTIVersion.VERSION_2_0;- Parameters:
qtiVersion-
-
getTransformDocument
public Document getTransformDocument(String template, boolean isRespondus)
Get an XML document for the transform- Parameters:
template-- Returns:
-
mapAssessment
public Map mapAssessment(Assessment assessmentXml)
Get map of data to set from assessment XML- Parameters:
assessmentXml-- Returns:
- a Map
-
mapAssessment
public Map mapAssessment(Assessment assessmentXml, boolean isRespondus)
-
mapSection
public Map mapSection(Section sectionXml, boolean isRespondus)
Get map of data to set from section XML- Parameters:
sectionXml-- Returns:
- a Map
-
mapItem
public Map mapItem(Item itemXml)
Get map of data to set from item XML- Parameters:
itemXml-- Returns:
- a Map
-
getSectionXmlList
public List getSectionXmlList(Assessment assessmentXml)
Look up a List of Section XML from Assessment Xml- Returns:
- a List of Section XML objects
-
getItemXmlList
public List getItemXmlList(Section sectionXml)
Look up a List of Item XML from Section Xml- Parameters:
Section- sectionXml- Returns:
- a List of Item XML objects
-
updateAssessment
public void updateAssessment(org.sakaiproject.tool.assessment.facade.AssessmentFacade assessment, Map assessmentMap)Update assessment from the extracted properties. Note: you need to do a save when you are done.- Parameters:
assessment- the assessment, which will be persistedassessmentMap- the extracted properties
-
makeSecuredIPAddressSet
public void makeSecuredIPAddressSet(org.sakaiproject.tool.assessment.facade.AssessmentFacade assessment, String ipList)the ip address is in a newline delimited string- Parameters:
assessment-
-
makeAssessmentAttachmentSet
public void makeAssessmentAttachmentSet(org.sakaiproject.tool.assessment.facade.AssessmentFacade assessment)
the ip address is in a newline delimited string- Parameters:
assessment-
-
makeSectionAttachmentSet
public void makeSectionAttachmentSet(org.sakaiproject.tool.assessment.facade.SectionFacade section, Map sectionMap)the ip address is in a newline delimited string- Parameters:
assessment-
-
makeItemAttachmentSet
public void makeItemAttachmentSet(org.sakaiproject.tool.assessment.facade.ItemFacade item)
the ip address is in a newline delimited string- Parameters:
assessment-
-
makeFCKAttachment
public String makeFCKAttachment(String text)
the ip address is in a newline delimited string- Parameters:
assessment-
-
updateQuestionPool
public void updateQuestionPool(org.sakaiproject.tool.assessment.facade.QuestionPoolFacade questionpool, Map assessmentMap)Update questionpool from the extracted properties. Note: you need to do a save when you are done.- Parameters:
questionpool- , which will be persistedassessmentMap- , the extracted properties
-
updateSection
public void updateSection(org.sakaiproject.tool.assessment.facade.SectionFacade section, Map sectionMap)Update section from the extracted properties. Note: you need to do a save when you are done.- Parameters:
section- the section, which will be persistedsectionMap- the extracted properties
-
updateItem
public void updateItem(org.sakaiproject.tool.assessment.facade.ItemFacade item, Item itemXml)Update item from the extracted properties. Note: you need to do a save when you are done.- Parameters:
item- the item, which will be persisteditemMap- the extracted properties
-
updateItem
public void updateItem(org.sakaiproject.tool.assessment.facade.ItemFacade item, Item itemXml, boolean isRespondus)
-
updateItem
public void updateItem(org.sakaiproject.tool.assessment.facade.ItemFacade item, Item itemXml, Map itemMap)
-
updateItem
public void updateItem(org.sakaiproject.tool.assessment.facade.ItemFacade item, Item itemXml, Map itemMap, boolean isRespondus)
-
getOverridePath
public String getOverridePath()
Primarily for testing purposes.- Returns:
- an overridden path if not null
-
setOverridePath
public void setOverridePath(String overridePath)
Primarily for testing purposes.- Parameters:
overridePath- an overriding path
-
setUnzipLocation
public void setUnzipLocation(String unzipLocation)
-
-