org.sakaiproject.tool.assessment.qti.helper
Class ExtractionHelper

java.lang.Object
  extended by 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: ExtractionHelper.java 9274 2006-05-10 22:50:48Z daisyf@stanford.edu $
Author:
Ed Smiley esmiley@stanford.edu

Field Summary
static String REMOVE_NAMESPACE_TRANSFORM
           
 
Constructor Summary
ExtractionHelper()
          Deprecated.  
ExtractionHelper(int qtiVersion)
          Get ExtractionHelper for QTIVersion.VERSION_1_2 or QTIVersion.VERSION_2_0
 
Method Summary
 List getItemXmlList(Section sectionXml)
          Look up a List of Item XML from Section Xml
 String getOverridePath()
          Primarily for testing purposes.
 int getQtiVersion()
          Get QTI version flag.
 List getSectionXmlList(Assessment assessmentXml)
          Look up a List of Section XML from Assessment Xml
 Document getTransformDocument(String template)
           
 Document getTransformDocument(String template, boolean isRespondus)
          Get an XML document for the transform
 String getTransformPath()
          Path to XSL transform code.
 String getTransformPath(boolean isRespondus)
           
 void makeAssessmentAttachmentSet(AssessmentFacade assessment)
          the ip address is in a newline delimited string
 String makeFCKAttachment(List respondueTextList)
           
 String makeFCKAttachment(String text)
          the ip address is in a newline delimited string
 String makeFCKAttachmentFromRespondus(String text)
           
 void makeItemAttachmentSet(ItemFacade item)
          the ip address is in a newline delimited string
 void makeSectionAttachmentSet(SectionFacade section, Map sectionMap)
          the ip address is in a newline delimited string
 void makeSecuredIPAddressSet(AssessmentFacade assessment, String ipList)
          the ip address is in a newline delimited string
 Map mapAssessment(Assessment assessmentXml)
          Get map of data to set from assessment XML
 Map mapAssessment(Assessment assessmentXml, boolean isRespondus)
           
 Map mapItem(Item itemXml)
          Get map of data to set from item XML
 Map mapItem(Item itemXml, boolean isRespondus)
           
 Map mapSection(Section sectionXml)
           
 Map mapSection(Section sectionXml, boolean isRespondus)
          Get map of data to set from section XML
 String renameDuplicate(String title)
          Append " - 2", " - 3", etc. incrementing as you go.
 void setOverridePath(String overridePath)
          Primarily for testing purposes.
 void setQtiVersion(int qtiVersion)
          Set QTI version flag.
 void setUnzipLocation(String unzipLocation)
           
 void updateAssessment(AssessmentFacade assessment, Map assessmentMap)
          Update assessment from the extracted properties.
 void updateItem(ItemFacade item, Map itemMap)
          Update item from the extracted properties.
 void updateItem(ItemFacade item, Map itemMap, boolean isRespondus)
           
 void updateQuestionPool(QuestionPoolFacade questionpool, Map assessmentMap)
          Update questionpool from the extracted properties.
 void updateSection(SectionFacade section, Map sectionMap)
          Update section from the extracted properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REMOVE_NAMESPACE_TRANSFORM

public static final String REMOVE_NAMESPACE_TRANSFORM
See Also:
Constant Field Values
Constructor Detail

ExtractionHelper

public ExtractionHelper()
Deprecated. 


ExtractionHelper

public ExtractionHelper(int qtiVersion)
Get ExtractionHelper for QTIVersion.VERSION_1_2 or QTIVersion.VERSION_2_0

Parameters:
qtiVersion -
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:

getTransformDocument

public Document getTransformDocument(String template)

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

mapSection

public Map mapSection(Section sectionXml)

mapItem

public Map mapItem(Item itemXml)
Get map of data to set from item XML

Parameters:
itemXml -
Returns:
a Map

mapItem

public Map mapItem(Item itemXml,
                   boolean isRespondus)

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(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 persisted
assessmentMap - the extracted properties

makeSecuredIPAddressSet

public void makeSecuredIPAddressSet(AssessmentFacade assessment,
                                    String ipList)
the ip address is in a newline delimited string

Parameters:
assessment -

makeAssessmentAttachmentSet

public void makeAssessmentAttachmentSet(AssessmentFacade assessment)
the ip address is in a newline delimited string

Parameters:
assessment -

makeSectionAttachmentSet

public void makeSectionAttachmentSet(SectionFacade section,
                                     Map sectionMap)
the ip address is in a newline delimited string

Parameters:
assessment -

makeItemAttachmentSet

public void makeItemAttachmentSet(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 -

makeFCKAttachmentFromRespondus

public String makeFCKAttachmentFromRespondus(String text)

makeFCKAttachment

public String makeFCKAttachment(List respondueTextList)

updateQuestionPool

public void updateQuestionPool(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 persisted
assessmentMap, - the extracted properties

updateSection

public void updateSection(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 persisted
sectionMap - the extracted properties

updateItem

public void updateItem(ItemFacade item,
                       Map itemMap)
Update item from the extracted properties. Note: you need to do a save when you are done.

Parameters:
item - the item, which will be persisted
itemMap - the extracted properties

updateItem

public void updateItem(ItemFacade item,
                       Map itemMap,
                       boolean isRespondus)

renameDuplicate

public String renameDuplicate(String title)
Append " - 2", " - 3", etc. incrementing as you go.

Parameters:
title - the original
Returns:
the title with versioning appended

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)


Copyright © 2005-2013 Sakai Project. All Rights Reserved.