org.sakaiproject.tool.assessment.facade
Class SectionFacade

java.lang.Object
  extended byorg.sakaiproject.tool.assessment.facade.SectionFacade
All Implemented Interfaces:
Comparable, SectionDataIfc, Serializable

public class SectionFacade
extends Object
implements Serializable, SectionDataIfc, Comparable

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.sakaiproject.tool.assessment.data.ifc.assessment.SectionDataIfc
AS_LISTED_ON_ASSESSMENT_PAGE, AUTHOR_TYPE, NUM_QUESTIONS_DRAWN, POOLID_FOR_RANDOM_DRAW, QUESTIONS_AUTHORED_ONE_BY_ONE, QUESTIONS_ORDERING, RANDOM_DRAW_FROM_QUESTIONPOOL, RANDOM_WITHIN_PART
 
Constructor Summary
SectionFacade()
          SectionFacade is the class that is exposed to developer It contains some of the useful methods specified in org.osid.assessment.Section and it implements org.sakaiproject.tool.assessment.ifc.
SectionFacade(SectionDataIfc data)
          This is a very important constructor.
 
Method Summary
 void addItem(ItemDataIfc itemDataIfc)
           
 void addItem(ItemFacade itemFacade)
           
 void addSectionMetaData(String label, String entry)
          Add a Meta Data to SectionFacade
 int compareTo(Object o)
           
 AssessmentIfc getAssessment()
           
 Long getAssessmentId()
           
 String getCreatedBy()
          Get createdBy for SectionFacade.
 Date getCreatedDate()
          Get the creation date of SectionFacade.
 SectionDataIfc getData()
          Get the data for this SectionFacade.
 String getDescription()
           
 Integer getDuration()
           
 ArrayList getItemArray()
           
 ArrayList getItemArraySorted()
           
 ArrayList getItemArraySortedForGrading()
           
 ArrayList getItemArraySortedWithRandom(long seed)
           
 Set getItemFacadeSet()
          Get section text set (question text set) from SectionFacade.data
 Set getItemSet()
           
 String getLastModifiedBy()
          Get the agentId of the person who last modified SectionFacade
 Date getLastModifiedDate()
          Get the date when SectionFacade where last modified By
 Long getSectionId()
           
 String getSectionMetaDataByLabel(String label)
           
 HashMap getSectionMetaDataMap(Set metaDataSet)
           
 Set getSectionMetaDataSet()
           
 TypeFacade getSectionTypeFacade()
           
 Integer getSequence()
           
 Integer getStatus()
          Get status of SectionFacade. 1 = active, 0 = inactive
 String getTitle()
           
 TypeIfc getType()
           
 Long getTypeId()
           
 void setAssessment(AssessmentIfc assessment)
           
 void setAssessmentId(Long assessmentId)
          Set sectionId for SectionFacade
 void setCreatedBy(String createdBy)
          Set createdBy for SectionFacade.
 void setCreatedDate(Date createdDate)
          Set the creation date of SectionFacade
 void setData(SectionDataIfc data)
          Set data for SectionFacade
 void setDescription(String description)
          Set description for SectionFacade
 void setDuration(Integer duration)
          Set duration for SectionFacade
 void setItemSet(Set itemSet)
          Set section text (question text) in SectionFacade.data
 void setLastModifiedBy(String lastModifiedBy)
          set the agentId of the person who last modified sectionFacade
 void setLastModifiedDate(Date lastModifiedDate)
          Set the last modified date
 void setSectionId(Long sectionId)
          Set sectionId for SectionFacade
 void setSectionMetaDataSet(Set metaDataSet)
          Set section metadata in SectionFacade.data
 void setSequence(Integer sequence)
           
 void setStatus(Integer status)
          Set status for SectionFacade. 1 = active, 0 = inactive
 void setTitle(String title)
          Set instruction for SectionFacade e.g.
 void setTypeId(Long typeId)
          Set TypeId for SectionType.
 void updateData(SectionDataIfc data)
          Call setDate() to update data in SectionFacade
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SectionFacade

public SectionFacade()
SectionFacade is the class that is exposed to developer It contains some of the useful methods specified in org.osid.assessment.Section and it implements org.sakaiproject.tool.assessment.ifc. When new methods is added to osid api, this code is still workable. If signature in any of the osid methods that we mirrored changes, we only need to modify those particular methods. - daisyf


SectionFacade

public SectionFacade(SectionDataIfc data)
This is a very important constructor. Please make sure that you have set all the properties (declared above as private) of SectionFacade using the "data" supplied. "data" is a org.osid.assessment.Section properties and I use it to store info about an section.

Parameters:
data -
Method Detail

getData

public SectionDataIfc getData()
Get the data for this SectionFacade.

Returns:
SectionDataIfc

updateData

public void updateData(SectionDataIfc data)
Call setDate() to update data in SectionFacade

Parameters:
data -

setData

public void setData(SectionDataIfc data)
Set data for SectionFacade

Parameters:
data -

getSectionId

public Long getSectionId()
                  throws DataFacadeException
Specified by:
getSectionId in interface SectionDataIfc
Throws:
DataFacadeException

setSectionId

public void setSectionId(Long sectionId)
Set sectionId for SectionFacade

Specified by:
setSectionId in interface SectionDataIfc
Parameters:
sectionId -

getAssessmentId

public Long getAssessmentId()
                     throws DataFacadeException
Specified by:
getAssessmentId in interface SectionDataIfc
Throws:
DataFacadeException

setAssessmentId

public void setAssessmentId(Long assessmentId)
Set sectionId for SectionFacade

Specified by:
setAssessmentId in interface SectionDataIfc

getAssessment

public AssessmentIfc getAssessment()
                            throws DataFacadeException
Specified by:
getAssessment in interface SectionDataIfc
Throws:
DataFacadeException

setAssessment

public void setAssessment(AssessmentIfc assessment)
Specified by:
setAssessment in interface SectionDataIfc

getDuration

public Integer getDuration()
                    throws DataFacadeException
Specified by:
getDuration in interface SectionDataIfc
Throws:
DataFacadeException

setDuration

public void setDuration(Integer duration)
Set duration for SectionFacade

Specified by:
setDuration in interface SectionDataIfc
Parameters:
duration -

getSequence

public Integer getSequence()
                    throws DataFacadeException
Specified by:
getSequence in interface SectionDataIfc
Throws:
DataFacadeException

setSequence

public void setSequence(Integer sequence)
Specified by:
setSequence in interface SectionDataIfc

getTitle

public String getTitle()
                throws DataFacadeException
Specified by:
getTitle in interface SectionDataIfc
Throws:
DataFacadeException

setTitle

public void setTitle(String title)
Set instruction for SectionFacade e.g. "Match the following sentences", "In the score between 1-5, specify your preference"

Specified by:
setTitle in interface SectionDataIfc

getDescription

public String getDescription()
                      throws DataFacadeException
Specified by:
getDescription in interface SectionDataIfc
Throws:
DataFacadeException

setDescription

public void setDescription(String description)
Set description for SectionFacade

Specified by:
setDescription in interface SectionDataIfc
Parameters:
description -

getTypeId

public Long getTypeId()
               throws DataFacadeException
Specified by:
getTypeId in interface SectionDataIfc
Throws:
DataFacadeException

setTypeId

public void setTypeId(Long typeId)
Set TypeId for SectionType. This property is used to indicate question type. e.g. 1 = Multiple Choice, 2 = Multiple Correct. Please check out ddl/02_TypeData.sql and table "type".

Specified by:
setTypeId in interface SectionDataIfc
Parameters:
typeId -

getStatus

public Integer getStatus()
                  throws DataFacadeException
Get status of SectionFacade. 1 = active, 0 = inactive

Specified by:
getStatus in interface SectionDataIfc
Returns:
Throws:
DataFacadeException

setStatus

public void setStatus(Integer status)
Set status for SectionFacade. 1 = active, 0 = inactive

Specified by:
setStatus in interface SectionDataIfc
Parameters:
status -

getCreatedBy

public String getCreatedBy()
                    throws DataFacadeException
Get createdBy for SectionFacade. This represents the agentId of the person who created the record

Specified by:
getCreatedBy in interface SectionDataIfc
Returns:
Throws:
DataFacadeException

setCreatedBy

public void setCreatedBy(String createdBy)
Set createdBy for SectionFacade. This represents the agentId of the person who created the record

Specified by:
setCreatedBy in interface SectionDataIfc
Parameters:
createdBy -

getCreatedDate

public Date getCreatedDate()
                    throws DataFacadeException
Get the creation date of SectionFacade.

Specified by:
getCreatedDate in interface SectionDataIfc
Returns:
Throws:
DataFacadeException

setCreatedDate

public void setCreatedDate(Date createdDate)
Set the creation date of SectionFacade

Specified by:
setCreatedDate in interface SectionDataIfc
Parameters:
createdDate -

getLastModifiedBy

public String getLastModifiedBy()
                         throws DataFacadeException
Get the agentId of the person who last modified SectionFacade

Specified by:
getLastModifiedBy in interface SectionDataIfc
Returns:
Throws:
DataFacadeException

setLastModifiedBy

public void setLastModifiedBy(String lastModifiedBy)
set the agentId of the person who last modified sectionFacade

Specified by:
setLastModifiedBy in interface SectionDataIfc
Parameters:
lastModifiedBy -

getLastModifiedDate

public Date getLastModifiedDate()
                         throws DataFacadeException
Get the date when SectionFacade where last modified By

Specified by:
getLastModifiedDate in interface SectionDataIfc
Returns:
Throws:
DataFacadeException

setLastModifiedDate

public void setLastModifiedDate(Date lastModifiedDate)
Set the last modified date

Specified by:
setLastModifiedDate in interface SectionDataIfc

getItemFacadeSet

public Set getItemFacadeSet()
                     throws DataFacadeException
Get section text set (question text set) from SectionFacade.data

Returns:
Throws:
DataFacadeException

getItemSet

public Set getItemSet()
               throws DataFacadeException
Specified by:
getItemSet in interface SectionDataIfc
Throws:
DataFacadeException

setItemSet

public void setItemSet(Set itemSet)
Set section text (question text) in SectionFacade.data

Specified by:
setItemSet in interface SectionDataIfc

getSectionMetaDataSet

public Set getSectionMetaDataSet()
                          throws DataFacadeException
Specified by:
getSectionMetaDataSet in interface SectionDataIfc
Throws:
DataFacadeException

setSectionMetaDataSet

public void setSectionMetaDataSet(Set metaDataSet)
Set section metadata in SectionFacade.data

Specified by:
setSectionMetaDataSet in interface SectionDataIfc
Parameters:
metaDataSet -

getSectionMetaDataMap

public HashMap getSectionMetaDataMap(Set metaDataSet)
Specified by:
getSectionMetaDataMap in interface SectionDataIfc

addItem

public void addItem(ItemFacade itemFacade)

addItem

public void addItem(ItemDataIfc itemDataIfc)
Specified by:
addItem in interface SectionDataIfc

getSectionMetaDataByLabel

public String getSectionMetaDataByLabel(String label)
Specified by:
getSectionMetaDataByLabel in interface SectionDataIfc

addSectionMetaData

public void addSectionMetaData(String label,
                               String entry)
Add a Meta Data to SectionFacade

Specified by:
addSectionMetaData in interface SectionDataIfc
Parameters:
label -
entry -

getType

public TypeIfc getType()
Specified by:
getType in interface SectionDataIfc

getSectionTypeFacade

public TypeFacade getSectionTypeFacade()

getItemArray

public ArrayList getItemArray()
Specified by:
getItemArray in interface SectionDataIfc

getItemArraySortedForGrading

public ArrayList getItemArraySortedForGrading()
Specified by:
getItemArraySortedForGrading in interface SectionDataIfc

getItemArraySorted

public ArrayList getItemArraySorted()
Specified by:
getItemArraySorted in interface SectionDataIfc

getItemArraySortedWithRandom

public ArrayList getItemArraySortedWithRandom(long seed)
Specified by:
getItemArraySortedWithRandom in interface SectionDataIfc

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable