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

java.lang.Object
  extended byorg.sakaiproject.tool.assessment.qti.helper.AuthoringHelper

public class AuthoringHelper
extends Object

Copyright: Copyright (c) 2004

Organization: Sakai Project

Version:
$Id: AuthoringHelper.java 5873 2006-02-09 20:28:12Z cwen@iupui.edu $
Author:
Ed Smiley esmiley@stanford.edu, Shastri, Rashmi

Constructor Summary
AuthoringHelper(int qtiVersion)
          QTI versioned constructor
 
Method Summary
 ArrayList changeDelimitedStringtoArray(String inputStr, String delimiter)
          Helper method.
 AssessmentFacade createImportedAssessment(Document document)
          Import an assessment XML document in QTI format, extract & persist the data.
 ItemFacade createImportedItem(Document document)
          Deprecated. Import an item XML document in QTI format, extract & persist the data.
 AssessmentFacade[] createMultipleImportedAssessments(Document objectBank)
          Pull apart object bank into multiple assessments
 AssessmentFacade[] createMultipleImportedAssessments(Document[] documents)
          Import multiple assessment documents in QTI format, extract & persist.
 Document getAssessment(String assessmentId)
          Get a published assessment in Document form from Faces context.
 Document getAssessment(String assessmentId, InputStream is)
          Get an assessment in Document form.
 Document getAssessmentBank(String[] assessmentIds)
          Get an object bank of asessments (asi) in Document form.
 InputStream getBlankSectionTemplateFileStream()
          Get an InputStream to an unpopulated section XML from file system.
 Document getItem(String itemId)
          Get an item in Document form.
 Document getItemBank(String[] itemIds)
          Get an object bank of items in Document form.
 int getQtiVersion()
           
 XmlStringBuffer readXMLDocument(InputStream inputStream)
          Create an XmlStringBuffer (base class for A,S,I XML classes)
 void setQtiVersion(int qtiVersion)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthoringHelper

public AuthoringHelper(int qtiVersion)
QTI versioned constructor

Parameters:
qtiVersion - either QTIVersion.VERSION_1_2 or QTIVersion.VERSION_2_0;
Method Detail

getAssessment

public Document getAssessment(String assessmentId)
Get a published assessment in Document form from Faces context.

Parameters:
assessmentId - the published assessment's Id
Returns:
the Document with the published assessment data

getAssessment

public Document getAssessment(String assessmentId,
                              InputStream is)
Get an assessment in Document form.

Parameters:
assessmentId - the assessment's Id
is - a stream containing the unpopulated XML document
Returns:
the Document with the published assessment data

getItemBank

public Document getItemBank(String[] itemIds)
Get an object bank of items in Document form.

Parameters:
itemIds - array of the the item ids
Returns:
the Document with the item bank data

getAssessmentBank

public Document getAssessmentBank(String[] assessmentIds)
Get an object bank of asessments (asi) in Document form.

Parameters:
assessmentIds - array of the the assessment ids
Returns:
the Document with the item bank data

getItem

public Document getItem(String itemId)
Get an item in Document form.

Parameters:
itemId - the item id
Returns:
the Document with the item data

getBlankSectionTemplateFileStream

public InputStream getBlankSectionTemplateFileStream()
Get an InputStream to an unpopulated section XML from file system.

Returns:
InputStream to an unpopulated section XML

createMultipleImportedAssessments

public AssessmentFacade[] createMultipleImportedAssessments(Document objectBank)
Pull apart object bank into multiple assessments

Parameters:
objectBank -
Returns:
an array of AssesmentFacades

createMultipleImportedAssessments

public AssessmentFacade[] createMultipleImportedAssessments(Document[] documents)
Import multiple assessment documents in QTI format, extract & persist.

Returns:
an array of AssesmentFacades

createImportedAssessment

public AssessmentFacade createImportedAssessment(Document document)
Import an assessment XML document in QTI format, extract & persist the data.

Parameters:
document - the assessment XML document in QTI format
Returns:
a persisted assessment

createImportedItem

public ItemFacade createImportedItem(Document document)
Deprecated. Import an item XML document in QTI format, extract & persist the data.

Parameters:
document - the item XML document in QTI format
Returns:
a persisted item

readXMLDocument

public XmlStringBuffer readXMLDocument(InputStream inputStream)
Create an XmlStringBuffer (base class for A,S,I XML classes)

Parameters:
inputStream - the input stram
Returns:
an XmlStringBuffer (this is the base class for A,S,I XML classes)

changeDelimitedStringtoArray

public ArrayList changeDelimitedStringtoArray(String inputStr,
                                              String delimiter)
Helper method.

Parameters:
inputStr -
delimiter -
Returns:

getQtiVersion

public int getQtiVersion()

setQtiVersion

public void setQtiVersion(int qtiVersion)