org.sakaiproject.tool.assessment.services.assessment
Class PublishedAssessmentService

java.lang.Object
  extended byorg.sakaiproject.tool.assessment.services.assessment.PublishedAssessmentService

public class PublishedAssessmentService
extends Object

The QuestionPoolService calls the service locator to reach the manager on the back end.

Author:
Rachel Gollub

Constructor Summary
PublishedAssessmentService()
          Creates a new QuestionPoolService object.
 
Method Summary
 ArrayList getAllActivePublishedAssessments(int pageSize, int pageNumber, String orderBy)
           
 ArrayList getAllActivePublishedAssessments(String orderBy)
          public ArrayList getAllReviewableAssessments(String agentId, String orderBy, boolean ascending) { // 1. get total no. of submission per assessment by the given agent HashMap h = getTotalSubmissionPerAssessment(agentId); ArrayList assessmentList = PersistenceService.getInstance().
 HashMap getAllAssessmentsReleasedToAuthenticatedUsers()
           
 ArrayList getAllInActivePublishedAssessments(int pageSize, int pageNumber, String orderBy)
           
 ArrayList getAllInActivePublishedAssessments(String orderBy)
           
 ArrayList getAllPublishedAssessments(int pageSize, int pageNumber, String orderBy, Integer status)
           
 ArrayList getAllPublishedAssessments(String orderBy, Integer status)
           
 ArrayList getBasicInfoOfAllActivePublishedAssessments(String orderBy, boolean ascending)
           
 ArrayList getBasicInfoOfAllInActivePublishedAssessments(String orderBy, boolean ascending)
           
 ArrayList getBasicInfoOfAllPublishedAssessments(String agentId, String orderBy, boolean ascending)
          rachelgollub: So takeable is that you have *not* reached the number of submissions and you're either before the due date or (you're after the due date, you haven't submitted yet, and late handling is enabled)
 ArrayList getBasicInfoOfLastSubmittedAssessments(String agentId, String orderBy, boolean ascending)
          return an array list of the last AssessmentGradingFacade per assessment that a user has submitted for grade.
 HashMap getFeedbackHash()
           
 PublishedItemData getFirstPublishedItem(String publishedAssessmentId)
           
 Integer getItemType(String publishedItemId)
           
 PublishedAssessmentFacade getPublishedAssessment(String assessmentId)
           
 Long getPublishedAssessmentId(String assessmentId)
           
 PublishedAssessmentFacade getPublishedAssessmentIdByAlias(String alias)
           
 String getPublishedAssessmentOwner(Long publishedAssessmentId)
           
 List getPublishedItemIds(String publishedAssessmentId)
           
 PublishedAssessmentFacade getSettingsOfPublishedAssessment(String assessmentId)
           
 Integer getTotalSubmission(String agentId, String publishedAssessmentId)
           
 HashMap getTotalSubmissionPerAssessment(String agentId)
          total submitted for grade returns HashMap (Long publishedAssessmentId, Integer totalSubmittedForGrade);
 boolean hasRandomPart(String publishedAssessmentId)
           
 PublishedItemData loadPublishedItem(String itemId)
           
 PublishedItemText loadPublishedItemText(String itemTextId)
           
 HashMap prepareFIBItemHash(PublishedAssessmentIfc publishedAssessment)
           
 HashMap prepareMCMRItemHash(PublishedAssessmentIfc publishedAssessment)
           
 HashMap preparePublishedAnswerHash(PublishedAssessmentIfc publishedAssessment)
           
 HashMap preparePublishedItemHash(PublishedAssessmentIfc publishedAssessment)
           
 HashMap preparePublishedItemTextHash(PublishedAssessmentIfc publishedAssessment)
           
 PublishedAssessmentFacade publishAssessment(AssessmentFacade assessment)
           
 boolean publishedAssessmentTitleIsUnique(String assessmentBaseId, String title)
           
 PublishedAssessmentFacade publishPreviewAssessment(AssessmentFacade assessment)
           
 void removeAssessment(String assessmentId)
           
 void saveAssessment(PublishedAssessmentFacade assessment)
           
 void saveOrUpdateMetaData(PublishedMetaData meta)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PublishedAssessmentService

public PublishedAssessmentService()
Creates a new QuestionPoolService object.

Method Detail

getBasicInfoOfAllPublishedAssessments

public ArrayList getBasicInfoOfAllPublishedAssessments(String agentId,
                                                       String orderBy,
                                                       boolean ascending)
rachelgollub: So takeable is that you have *not* reached the number of submissions and you're either before the due date or (you're after the due date, you haven't submitted yet, and late handling is enabled). - quoted from IM on 1/31/05 Marc said some of teh assessment do not have any due date, e.g. survey


getAllActivePublishedAssessments

public ArrayList getAllActivePublishedAssessments(String orderBy)
public ArrayList getAllReviewableAssessments(String agentId, String orderBy, boolean ascending) { // 1. get total no. of submission per assessment by the given agent HashMap h = getTotalSubmissionPerAssessment(agentId); ArrayList assessmentList = PersistenceService.getInstance(). getPublishedAssessmentFacadeQueries(). getAllReviewableAssessments(orderBy, ascending); log.info("Qingru***: for reviewable assessmentList.size() in publishedassessmentservice is " + assessmentList.size()); ArrayList reviewableAssessmentList = new ArrayList(); for (int i = 0; i < assessmentList.size(); i++) { AssessmentGradingFacade f = (AssessmentGradingFacade) assessmentList.get( i); Integer NumberOfSubmissions = (Integer) h.get( f.getPublishedAssessment().getPublishedAssessmentId()); if (NumberOfSubmissions == null) { NumberOfSubmissions = new Integer(0); } log.info("Qingru***:Numberofsubmissions==" + NumberOfSubmissions); try { if (!PersistenceService.getInstance().getAuthzQueriesFacade().isAuthorized(null, "VIEW_PUBLISHED_ASSESSMENT", f.getPublishedAssessment(). getPublishedAssessmentId(). toString())) { break; } } catch (Exception e1) { log.fatal("Wrapping Error around unhandled Exception: " + e1.getMessage()); throw new Error(e1.getMessage()); } // for testing only reviewableAssessmentList.add(f); } return reviewableAssessmentList; }


getAllActivePublishedAssessments

public ArrayList getAllActivePublishedAssessments(int pageSize,
                                                  int pageNumber,
                                                  String orderBy)

getAllInActivePublishedAssessments

public ArrayList getAllInActivePublishedAssessments(String orderBy)

getAllInActivePublishedAssessments

public ArrayList getAllInActivePublishedAssessments(int pageSize,
                                                    int pageNumber,
                                                    String orderBy)

getAllPublishedAssessments

public ArrayList getAllPublishedAssessments(String orderBy,
                                            Integer status)

getAllPublishedAssessments

public ArrayList getAllPublishedAssessments(int pageSize,
                                            int pageNumber,
                                            String orderBy,
                                            Integer status)

getPublishedAssessment

public PublishedAssessmentFacade getPublishedAssessment(String assessmentId)

getPublishedAssessmentId

public Long getPublishedAssessmentId(String assessmentId)

publishAssessment

public PublishedAssessmentFacade publishAssessment(AssessmentFacade assessment)
                                            throws Exception
Throws:
Exception

publishPreviewAssessment

public PublishedAssessmentFacade publishPreviewAssessment(AssessmentFacade assessment)

saveAssessment

public void saveAssessment(PublishedAssessmentFacade assessment)

removeAssessment

public void removeAssessment(String assessmentId)

getBasicInfoOfAllActivePublishedAssessments

public ArrayList getBasicInfoOfAllActivePublishedAssessments(String orderBy,
                                                             boolean ascending)

getBasicInfoOfAllInActivePublishedAssessments

public ArrayList getBasicInfoOfAllInActivePublishedAssessments(String orderBy,
                                                               boolean ascending)

getSettingsOfPublishedAssessment

public PublishedAssessmentFacade getSettingsOfPublishedAssessment(String assessmentId)

loadPublishedItem

public PublishedItemData loadPublishedItem(String itemId)

loadPublishedItemText

public PublishedItemText loadPublishedItemText(String itemTextId)

getBasicInfoOfLastSubmittedAssessments

public ArrayList getBasicInfoOfLastSubmittedAssessments(String agentId,
                                                        String orderBy,
                                                        boolean ascending)
return an array list of the last AssessmentGradingFacade per assessment that a user has submitted for grade.

Parameters:
agentId -
orderBy -
ascending -
Returns:

getTotalSubmissionPerAssessment

public HashMap getTotalSubmissionPerAssessment(String agentId)
total submitted for grade returns HashMap (Long publishedAssessmentId, Integer totalSubmittedForGrade);


getTotalSubmission

public Integer getTotalSubmission(String agentId,
                                  String publishedAssessmentId)

getPublishedAssessmentIdByAlias

public PublishedAssessmentFacade getPublishedAssessmentIdByAlias(String alias)

saveOrUpdateMetaData

public void saveOrUpdateMetaData(PublishedMetaData meta)

getFeedbackHash

public HashMap getFeedbackHash()

getAllAssessmentsReleasedToAuthenticatedUsers

public HashMap getAllAssessmentsReleasedToAuthenticatedUsers()

getPublishedAssessmentOwner

public String getPublishedAssessmentOwner(Long publishedAssessmentId)

publishedAssessmentTitleIsUnique

public boolean publishedAssessmentTitleIsUnique(String assessmentBaseId,
                                                String title)

hasRandomPart

public boolean hasRandomPart(String publishedAssessmentId)

getFirstPublishedItem

public PublishedItemData getFirstPublishedItem(String publishedAssessmentId)

getPublishedItemIds

public List getPublishedItemIds(String publishedAssessmentId)

getItemType

public Integer getItemType(String publishedItemId)

preparePublishedItemTextHash

public HashMap preparePublishedItemTextHash(PublishedAssessmentIfc publishedAssessment)

preparePublishedItemHash

public HashMap preparePublishedItemHash(PublishedAssessmentIfc publishedAssessment)

preparePublishedAnswerHash

public HashMap preparePublishedAnswerHash(PublishedAssessmentIfc publishedAssessment)

prepareFIBItemHash

public HashMap prepareFIBItemHash(PublishedAssessmentIfc publishedAssessment)

prepareMCMRItemHash

public HashMap prepareMCMRItemHash(PublishedAssessmentIfc publishedAssessment)