org.sakaiproject.tool.assessment.shared.impl.assessment
Class AssessmentServiceImpl

java.lang.Object
  extended byorg.sakaiproject.tool.assessment.shared.impl.assessment.AssessmentServiceImpl
All Implemented Interfaces:
AssessmentServiceAPI

public class AssessmentServiceImpl
extends Object
implements AssessmentServiceAPI

AssessmentServiceImpl implements a shared interface to get/set assessment information.

Author:
Ed Smiley

Constructor Summary
AssessmentServiceImpl()
           
 
Method Summary
 SectionDataIfc addSection(String assessmentId)
          Add a section to an assessment.
 AssessmentIfc createAssessment(String title, String description, String typeId, String templateId)
          Create an assessment.
 AssessmentIfc createAssessmentWithoutDefaultSection(String title, String description, String typeId, String templateId)
          Create an assessment without a default section.
 void deleteAssessmentTemplate(Long assessmentId)
          Delete an assessment template from an assessment.
 List getAllActiveAssessments(String orderBy)
          Get all active assessments.
 List getAllActiveAssessmentTemplates()
          Get a list of all active assessment templates.
 List getAllAssessments(int pageSize, int pageNumber, String orderBy)
          Get list of all active assessments.
 List getAllAssessments(String orderBy)
          Get an ordered list of assessments.
 List getAllAssessmentTemplates()
          Get a list of assessment templates.
 AssessmentIfc getAssessment(String assessmentId)
          Get assessment from id string.
 AssessmentTemplateIfc getAssessmentTemplate(String assessmentTemplateId)
          Get assessment template from id string.
 List getBasicInfoOfAllActiveAssessments(String orderBy)
          Get list of all active assessments with only basic info populated.
 List getBasicInfoOfAllActiveAssessments(String orderBy, boolean ascending)
          Get list of all active assessments with only basic info populated.
 List getBasicInfoOfAllActiveAssessmentTemplates(String orderBy)
          Get list of all active assessment templates with only basic info populated.
 AssessmentIfc getBasicInfoOfAnAssessment(String assessmentId)
          Get an assessment with only basic info populated..
 int getQuestionSize(String assessmentId)
          Get number of questions.
 SectionDataIfc getSection(String sectionId)
          Get a section.
 List getSettingsOfAllActiveAssessments(String orderBy)
          Get list of all active assessment's settings.
 List getTitleOfAllActiveAssessmentTemplates()
          Get a list of all the assessment template titles.
 void moveAllItems(String sourceSectionId, String destSectionId)
          Move items between sections.
 void removeAllItems(String sourceSectionId)
          Remove all items from a section.
 void removeAssessment(String assessmentId)
          Remove the assessment.
 void removeSection(String sectionId)
          Remove a section.
 void save(AssessmentTemplateIfc template)
           
 void saveAssessment(AssessmentIfc assessment)
          Save an assessment.
 void saveOrUpdateSection(SectionDataIfc section)
          Perform persistence saveOrUpdate on section.
 void update(AssessmentIfc assessment)
          Update an assessment coupled to the persistence layer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssessmentServiceImpl

public AssessmentServiceImpl()
Method Detail

getAssessmentTemplate

public AssessmentTemplateIfc getAssessmentTemplate(String assessmentTemplateId)
Get assessment template from id string.

Specified by:
getAssessmentTemplate in interface AssessmentServiceAPI
Parameters:
assessmentTemplateId -
Returns:
the assessment template

getAssessment

public AssessmentIfc getAssessment(String assessmentId)
Get assessment from id string.

Specified by:
getAssessment in interface AssessmentServiceAPI
Parameters:
assessmentId -
Returns:
the assessment

getBasicInfoOfAnAssessment

public AssessmentIfc getBasicInfoOfAnAssessment(String assessmentId)
Get an assessment with only basic info populated..

Specified by:
getBasicInfoOfAnAssessment in interface AssessmentServiceAPI
Parameters:
assessmentId - teh assessment id string.
Returns:
an assessment with only basic info populated.

getAllAssessmentTemplates

public List getAllAssessmentTemplates()
Get a list of assessment templates.

Specified by:
getAllAssessmentTemplates in interface AssessmentServiceAPI
Returns:
the list.

getAllActiveAssessmentTemplates

public List getAllActiveAssessmentTemplates()
Get a list of all active assessment templates.

Specified by:
getAllActiveAssessmentTemplates in interface AssessmentServiceAPI
Returns:
the list

getTitleOfAllActiveAssessmentTemplates

public List getTitleOfAllActiveAssessmentTemplates()
Get a list of all the assessment template titles.

Specified by:
getTitleOfAllActiveAssessmentTemplates in interface AssessmentServiceAPI
Returns:
the list.

getAllAssessments

public List getAllAssessments(String orderBy)
Get an ordered list of assessments.

Specified by:
getAllAssessments in interface AssessmentServiceAPI
Parameters:
orderBy - sort order field.
Returns:
the list.

getAllActiveAssessments

public List getAllActiveAssessments(String orderBy)
Get all active assessments.

Specified by:
getAllActiveAssessments in interface AssessmentServiceAPI
Parameters:
orderBy - sort order field.
Returns:
the list.

getSettingsOfAllActiveAssessments

public List getSettingsOfAllActiveAssessments(String orderBy)
Get list of all active assessment's settings.

Specified by:
getSettingsOfAllActiveAssessments in interface AssessmentServiceAPI
Parameters:
orderBy - sort order field.
Returns:
the list.

getBasicInfoOfAllActiveAssessments

public List getBasicInfoOfAllActiveAssessments(String orderBy,
                                               boolean ascending)
Get list of all active assessments with only basic info populated.

Specified by:
getBasicInfoOfAllActiveAssessments in interface AssessmentServiceAPI
Parameters:
orderBy -
ascending - ascending sort if true
Returns:
the list.

getBasicInfoOfAllActiveAssessments

public List getBasicInfoOfAllActiveAssessments(String orderBy)
Get list of all active assessments with only basic info populated.

Specified by:
getBasicInfoOfAllActiveAssessments in interface AssessmentServiceAPI
Parameters:
orderBy -
Returns:
the list.

getAllAssessments

public List getAllAssessments(int pageSize,
                              int pageNumber,
                              String orderBy)
Get list of all active assessments.

Specified by:
getAllAssessments in interface AssessmentServiceAPI
Parameters:
orderBy -
pageSize - number in a page
pageNumber - number of the page
Returns:
the list.

createAssessment

public AssessmentIfc createAssessment(String title,
                                      String description,
                                      String typeId,
                                      String templateId)
Create an assessment.

Specified by:
createAssessment in interface AssessmentServiceAPI
Parameters:
title - the title
description - the description
typeId - the type id
templateId - the template's template id
Returns:
the created assessment.

getQuestionSize

public int getQuestionSize(String assessmentId)
Get number of questions.

Specified by:
getQuestionSize in interface AssessmentServiceAPI
Parameters:
assessmentId - the assessment id string.
Returns:
the number.

update

public void update(AssessmentIfc assessment)
Update an assessment coupled to the persistence layer

Specified by:
update in interface AssessmentServiceAPI
Parameters:
assessment - the assessment interface of the POJO

save

public void save(AssessmentTemplateIfc template)
Specified by:
save in interface AssessmentServiceAPI

saveAssessment

public void saveAssessment(AssessmentIfc assessment)
Save an assessment.

Specified by:
saveAssessment in interface AssessmentServiceAPI
Parameters:
assessment - the assessment.

deleteAssessmentTemplate

public void deleteAssessmentTemplate(Long assessmentId)
Delete an assessment template from an assessment.

Specified by:
deleteAssessmentTemplate in interface AssessmentServiceAPI
Parameters:
assessmentId - the assessment id of the assessment.

removeAssessment

public void removeAssessment(String assessmentId)
Remove the assessment.

Specified by:
removeAssessment in interface AssessmentServiceAPI
Parameters:
assessmentId - the assessment id string.

addSection

public SectionDataIfc addSection(String assessmentId)
Add a section to an assessment.

Specified by:
addSection in interface AssessmentServiceAPI
Parameters:
assessmentId - the assessment id string.
Returns:
the section.

removeSection

public void removeSection(String sectionId)
Remove a section.

Specified by:
removeSection in interface AssessmentServiceAPI
Parameters:
sectionId - its id.

getSection

public SectionDataIfc getSection(String sectionId)
Get a section.

Specified by:
getSection in interface AssessmentServiceAPI
Parameters:
sectionId - the section id string.
Returns:
the section.

saveOrUpdateSection

public void saveOrUpdateSection(SectionDataIfc section)
Perform persistence saveOrUpdate on section.

Specified by:
saveOrUpdateSection in interface AssessmentServiceAPI
Parameters:
section - the section.

moveAllItems

public void moveAllItems(String sourceSectionId,
                         String destSectionId)
Move items between sections.

Specified by:
moveAllItems in interface AssessmentServiceAPI
Parameters:
sourceSectionId - source id.
destSectionId - destination id.

removeAllItems

public void removeAllItems(String sourceSectionId)
Remove all items from a section.

Specified by:
removeAllItems in interface AssessmentServiceAPI
Parameters:
sourceSectionId - the section id string.

getBasicInfoOfAllActiveAssessmentTemplates

public List getBasicInfoOfAllActiveAssessmentTemplates(String orderBy)
Get list of all active assessment templates with only basic info populated.

Specified by:
getBasicInfoOfAllActiveAssessmentTemplates in interface AssessmentServiceAPI
Parameters:
orderBy -
Returns:
the list.

createAssessmentWithoutDefaultSection

public AssessmentIfc createAssessmentWithoutDefaultSection(String title,
                                                           String description,
                                                           String typeId,
                                                           String templateId)
Create an assessment without a default section. Section must be created later. (This facilitates batch uploads such as QTI import where the section titles are all named in the incoming document.)

Specified by:
createAssessmentWithoutDefaultSection in interface AssessmentServiceAPI
Parameters:
title -
description -
typeId -
templateId -
Returns: