public boolean assessmentTitleIsUnique(String assessmentBaseId, String title, boolean isTemplate) { return PersistenceService.getInstance().getAssessmentFacadeQueries() .assessmentTitleIsUnique(new Long(assessmentBaseId), title, Boolean.valueOf(isTemplate)); }
public void copyAssessment(String assessmentId, String appendCopyTitle) { try { PersistenceService.getInstance().getAssessmentFacadeQueries() .copyAssessment(assessmentId, appendCopyTitle); } catch (Exception e) { log.error(e.getMessage(), e); throw new RuntimeException(e); } }
public AssessmentAttachmentIfc createAssessmentAttachment( AssessmentIfc assessment, String resourceId, String filename, String protocol) { AssessmentAttachmentIfc attachment = null; try { AssessmentFacadeQueriesAPI queries = PersistenceService .getInstance().getAssessmentFacadeQueries(); attachment = queries.createAssessmentAttachment(assessment, resourceId, filename, protocol); } catch (Exception e) { log.error(e.getMessage(), e); } return attachment; }
public AttachmentData createEmailAttachment(String resourceId, String filename, String protocol) { AttachmentData attachment = null; try { AssessmentFacadeQueriesAPI queries = PersistenceService .getInstance().getAssessmentFacadeQueries(); attachment = queries.createEmailAttachment(resourceId, filename, protocol); } catch (Exception e) { log.error(e.getMessage(), e); } return attachment; }
public ItemAttachmentIfc createItemAttachment(ItemDataIfc item, String resourceId, String filename, String protocol, boolean isEditPendingAssessmentFlow) { ItemAttachmentIfc attachment = null; try { AssessmentFacadeQueriesAPI queries = PersistenceService .getInstance().getAssessmentFacadeQueries(); attachment = queries.createItemAttachment(item, resourceId, filename, protocol, isEditPendingAssessmentFlow); } catch (Exception e) { log.error(e.getMessage(), e); } return attachment; }
public Set copyItemAttachmentSet(ItemData newItem, Set itemAttachmentSet){ return PersistenceService.getInstance().getAssessmentFacadeQueries().copyItemAttachmentSet(newItem, itemAttachmentSet); }
public void copyAllAssessments(String fromContext, String toContext, Map<String, String>transversalMap) { try { PersistenceService.getInstance().getAssessmentFacadeQueries() .copyAllAssessments(fromContext, toContext, transversalMap); List<PublishedAssessmentFacade> publist = PersistenceService.getInstance().getPublishedAssessmentFacadeQueries() .getBasicInfoOfAllPublishedAssessments(PublishedAssessmentFacadeQueries.DUE, true, fromContext); for (PublishedAssessmentFacade facade: publist) { PublishedAssessmentData data = PersistenceService.getInstance().getPublishedAssessmentFacadeQueries().loadPublishedAssessment(facade.getPublishedAssessmentId()); if (data != null) { String oldRef = PublishedAssessmentEntityProvider.ENTITY_PREFIX + "/" + data.getPublishedAssessmentId(); String oldCore = CoreAssessmentEntityProvider.ENTITY_PREFIX + "/" + data.getAssessmentId(); String newCore = transversalMap.get(oldCore); if (oldRef != null && newCore != null) transversalMap.put(oldRef, newCore); } } } catch (Exception e) { log.error(e.getMessage()); throw new RuntimeException(e); } }
/** * public int checkDelete(long assessmentId){ return * assessmentService.checkDelete(assessmentId); } * * public void deleteAssessment(Id assessmentId) throws * osid.assessment.AssessmentException { * assessmentService.deleteAssessment(assessmentId); } * * public AssessmentIterator getAssessments() throws * osid.assessment.AssessmentException { return * assessmentService.getAssessments(); } * */ public SectionFacade addSection(String assessmentId) { SectionFacade section = null; try { Long assessmentIdLong = new Long(assessmentId); AssessmentFacadeQueriesAPI queries = PersistenceService .getInstance().getAssessmentFacadeQueries(); section = queries.addSection(assessmentIdLong); } catch (Exception e) { log.error(e.getMessage(), e); } return section; }
public AssessmentFacade createAssessmentWithoutDefaultSection(String title, String description, String typeId, String templateId, String siteId) throws Exception { AssessmentFacade assessment = null; try { AssessmentTemplateFacade assessmentTemplate = null; // #1 - check templateId and prepared it in Long Long templateIdLong = AssessmentTemplateFacade.DEFAULTTEMPLATE; if (StringUtils.isNotBlank(templateId)) { templateIdLong = new Long(templateId); } // #2 - check typeId and prepared it in Long Long typeIdLong = TypeFacade.HOMEWORK; if (StringUtils.isNotBlank(typeId)) { typeIdLong = new Long(typeId); } AssessmentFacadeQueriesAPI queries = PersistenceService .getInstance().getAssessmentFacadeQueries(); assessment = queries.createAssessmentWithoutDefaultSection(title, description, typeIdLong, templateIdLong, siteId); } catch (Exception e) { log.error(e.getMessage(), e); throw new Exception(e); } return assessment; }
public AssessmentFacade createAssessment(String title, String description, String typeId, String templateId, String siteId) throws Exception { AssessmentFacade assessment = null; try { AssessmentTemplateFacade assessmentTemplate = null; // #1 - check templateId and prepared it in Long Long templateIdLong = AssessmentTemplateFacade.DEFAULTTEMPLATE; if (StringUtils.isNotBlank(templateId)) { templateIdLong = new Long(templateId); } // #2 - check typeId and prepared it in Long Long typeIdLong = TypeFacade.HOMEWORK; if (StringUtils.isNotBlank(typeId)) { typeIdLong = new Long(typeId); } AssessmentFacadeQueriesAPI queries = PersistenceService .getInstance().getAssessmentFacadeQueries(); log.debug("**** AssessmentFacadeQueries=" + queries); assessment = queries.createAssessment(title, description, typeIdLong, templateIdLong, siteId); } catch (Exception e) { log.error(e.getMessage(), e); throw new Exception(e); } return assessment; }
public AttachmentData createEmailAttachment(String resourceId, String filename, String protocol) { AttachmentData attachment = null; try { AssessmentFacadeQueriesAPI queries = PersistenceService .getInstance().getAssessmentFacadeQueries(); attachment = queries.createEmailAttachment(resourceId, filename, protocol); } catch (Exception e) { log.error(e.getMessage(), e); } return attachment; }
public ItemAttachmentIfc createItemAttachment(ItemDataIfc item, String resourceId, String filename, String protocol, boolean isEditPendingAssessmentFlow) { ItemAttachmentIfc attachment = null; try { AssessmentFacadeQueriesAPI queries = PersistenceService .getInstance().getAssessmentFacadeQueries(); attachment = queries.createItemAttachment(item, resourceId, filename, protocol, isEditPendingAssessmentFlow); } catch (Exception e) { log.error(e.getMessage(), e); } return attachment; }
public Set copyItemAttachmentSet(ItemData newItem, Set itemAttachmentSet){ return PersistenceService.getInstance().getAssessmentFacadeQueries().copyItemAttachmentSet(newItem, itemAttachmentSet); }
public void copyAllAssessments(String fromContext, String toContext, Map<String, String>transversalMap) { try { PersistenceService.getInstance().getAssessmentFacadeQueries() .copyAllAssessments(fromContext, toContext, transversalMap); List<PublishedAssessmentFacade> publist = PersistenceService.getInstance().getPublishedAssessmentFacadeQueries() .getBasicInfoOfAllPublishedAssessments(PublishedAssessmentFacadeQueries.DUE, true, fromContext); for (PublishedAssessmentFacade facade: publist) { PublishedAssessmentData data = PersistenceService.getInstance().getPublishedAssessmentFacadeQueries().loadPublishedAssessment(facade.getPublishedAssessmentId()); if (data != null) { String oldRef = PublishedAssessmentEntityProvider.ENTITY_PREFIX + "/" + data.getPublishedAssessmentId(); String oldCore = CoreAssessmentEntityProvider.ENTITY_PREFIX + "/" + data.getAssessmentId(); String newCore = transversalMap.get(oldCore); if (oldRef != null && newCore != null) transversalMap.put(oldRef, newCore); } } } catch (Exception e) { log.error(e.getMessage()); throw new RuntimeException(e); } }
/** * public int checkDelete(long assessmentId){ return * assessmentService.checkDelete(assessmentId); } * * public void deleteAssessment(Id assessmentId) throws * osid.assessment.AssessmentException { * assessmentService.deleteAssessment(assessmentId); } * * public AssessmentIterator getAssessments() throws * osid.assessment.AssessmentException { return * assessmentService.getAssessments(); } * */ public SectionFacade addSection(String assessmentId) { SectionFacade section = null; try { Long assessmentIdLong = new Long(assessmentId); AssessmentFacadeQueriesAPI queries = PersistenceService .getInstance().getAssessmentFacadeQueries(); section = queries.addSection(assessmentIdLong); } catch (Exception e) { log.error(e.getMessage(), e); } return section; }
public AssessmentFacade createAssessmentWithoutDefaultSection(String title, String description, String typeId, String templateId, String siteId) throws Exception { AssessmentFacade assessment = null; try { AssessmentTemplateFacade assessmentTemplate = null; // #1 - check templateId and prepared it in Long Long templateIdLong = AssessmentTemplateFacade.DEFAULTTEMPLATE; if (StringUtils.isNotBlank(templateId)) { templateIdLong = new Long(templateId); } // #2 - check typeId and prepared it in Long Long typeIdLong = TypeFacade.HOMEWORK; if (StringUtils.isNotBlank(typeId)) { typeIdLong = new Long(typeId); } AssessmentFacadeQueriesAPI queries = PersistenceService .getInstance().getAssessmentFacadeQueries(); assessment = queries.createAssessmentWithoutDefaultSection(title, description, typeIdLong, templateIdLong, siteId); } catch (Exception e) { log.error(e.getMessage(), e); throw new Exception(e); } return assessment; }
public AssessmentFacade createAssessment(String title, String description, String typeId, String templateId, String siteId) throws Exception { AssessmentFacade assessment = null; try { AssessmentTemplateFacade assessmentTemplate = null; // #1 - check templateId and prepared it in Long Long templateIdLong = AssessmentTemplateFacade.DEFAULTTEMPLATE; if (StringUtils.isNotBlank(templateId)) { templateIdLong = new Long(templateId); } // #2 - check typeId and prepared it in Long Long typeIdLong = TypeFacade.HOMEWORK; if (StringUtils.isNotBlank(typeId)) { typeIdLong = new Long(typeId); } AssessmentFacadeQueriesAPI queries = PersistenceService .getInstance().getAssessmentFacadeQueries(); log.debug("**** AssessmentFacadeQueries=" + queries); assessment = queries.createAssessment(title, description, typeIdLong, templateIdLong, siteId); } catch (Exception e) { log.error(e.getMessage(), e); throw new Exception(e); } return assessment; }
public boolean assessmentTitleIsUnique(String assessmentBaseId, String title, boolean isTemplate) { return PersistenceService.getInstance().getAssessmentFacadeQueries() .assessmentTitleIsUnique(new Long(assessmentBaseId), title, Boolean.valueOf(isTemplate)); }
public void copyAssessment(String assessmentId, String apepndCopyTitle) { try { PersistenceService.getInstance().getAssessmentFacadeQueries() .copyAssessment(assessmentId, apepndCopyTitle); } catch (Exception e) { log.error(e.getMessage(), e); throw new RuntimeException(e); } }
public AssessmentAttachmentIfc createAssessmentAttachment( AssessmentIfc assessment, String resourceId, String filename, String protocol) { AssessmentAttachmentIfc attachment = null; try { AssessmentFacadeQueriesAPI queries = PersistenceService .getInstance().getAssessmentFacadeQueries(); attachment = queries.createAssessmentAttachment(assessment, resourceId, filename, protocol); } catch (Exception e) { log.error(e.getMessage(), e); } return attachment; }