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

java.lang.Object
  extended byorg.sakaiproject.tool.assessment.qti.helper.assessment.AssessmentHelperBase
All Implemented Interfaces:
AssessmentHelperIfc
Direct Known Subclasses:
AssessmentHelper12Impl, AssessmentHelper20Impl

public abstract class AssessmentHelperBase
extends Object
implements AssessmentHelperIfc

Copyright: Copyright (c) 2005/p>

Organization: Sakai Project

Version:
$Id: AssessmentHelperBase.java 4132 2005-11-23 00:17:15Z zqingru@stanford.edu $
Author:
Ed Smiley esmiley@stanford.edu, based on some code by: Shastri, Rashmi

Constructor Summary
AssessmentHelperBase()
           
 
Method Summary
protected abstract  int getQtiVersion()
           
 Section getSectionByTitle(Assessment assessment, String sectionTitle)
          get section XML by title
 String qtiBooleanString(Boolean b)
          Map Boolean to text string
 String qtiBooleanString(Integer i)
          Map Integer to text string
 Assessment readXMLDocument(InputStream inputStream)
          Read in assessment XML from input stream
 void setDescriptiveText(String description, Assessment assessmentXml)
          Set the assessment description.
 void setDuration(Integer duration, Assessment assessmentXml)
          Set the assessment duration.
 void updateAccessControl(Assessment assessmentXml, AssessmentAccessControlIfc accessControl)
          Set access control settings in XML.
 void updateEvaluationModel(Assessment assessmentXml, EvaluationModelIfc evaluationModel)
          Set evaluation settings in XML.
 void updateFeedbackModel(Assessment assessmentXml, AssessmentFeedbackIfc feedback)
          Set feedback settings in XML
 void updateIPAddressSet(Assessment assessmentXml, Set securedIPAddressSet)
          If there is IP address set put IP addresses into allowed IP field in XML.
 void updateMetaData(Assessment assessmentXml, AssessmentFacade assessment)
          Look up and set metadata fields
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssessmentHelperBase

public AssessmentHelperBase()
Method Detail

getQtiVersion

protected abstract int getQtiVersion()

readXMLDocument

public Assessment readXMLDocument(InputStream inputStream)
Read in assessment XML from input stream

Specified by:
readXMLDocument in interface AssessmentHelperIfc
Parameters:
inputStream - XML input stream
Returns:
assessment XML

updateFeedbackModel

public void updateFeedbackModel(Assessment assessmentXml,
                                AssessmentFeedbackIfc feedback)
Set feedback settings in XML

Specified by:
updateFeedbackModel in interface AssessmentHelperIfc
Parameters:
assessmentXml -
feedback -

updateEvaluationModel

public void updateEvaluationModel(Assessment assessmentXml,
                                  EvaluationModelIfc evaluationModel)
Set evaluation settings in XML.

Specified by:
updateEvaluationModel in interface AssessmentHelperIfc
Parameters:
assessmentXml -
evaluationModel -

setDescriptiveText

public void setDescriptiveText(String description,
                               Assessment assessmentXml)
Set the assessment description.

Specified by:
setDescriptiveText in interface AssessmentHelperIfc
Parameters:
description - assessment description
assessmentXml - the xml

updateAccessControl

public void updateAccessControl(Assessment assessmentXml,
                                AssessmentAccessControlIfc accessControl)
Set access control settings in XML.

Specified by:
updateAccessControl in interface AssessmentHelperIfc
Parameters:
assessmentXml -
accessControl -

updateIPAddressSet

public void updateIPAddressSet(Assessment assessmentXml,
                               Set securedIPAddressSet)
If there is IP address set put IP addresses into allowed IP field in XML.

Specified by:
updateIPAddressSet in interface AssessmentHelperIfc
Parameters:
assessmentXml - the XML
securedIPAddressSet - the Set

updateMetaData

public void updateMetaData(Assessment assessmentXml,
                           AssessmentFacade assessment)
Look up and set metadata fields

Specified by:
updateMetaData in interface AssessmentHelperIfc
Parameters:
assessmentXml -
assessment -

qtiBooleanString

public String qtiBooleanString(Boolean b)
Map Boolean to text string

Parameters:
b - Boolean
Returns:
"True"|"False"

qtiBooleanString

public String qtiBooleanString(Integer i)
Map Integer to text string

Parameters:
i - Integer
Returns:
"True"|"False"

getSectionByTitle

public Section getSectionByTitle(Assessment assessment,
                                 String sectionTitle)
get section XML by title

Parameters:
assessment - section XML
sectionTitle - title
Returns:
section XML

setDuration

public void setDuration(Integer duration,
                        Assessment assessmentXml)
Set the assessment duration.

Parameters:
duration - assessment duration in seconds
assessmentXml - the xml