/** * Set General Feedback * @param text */ public void setGeneralItemFeedback(String text) { removeFeedbackByType(ItemFeedback.GENERAL_FEEDBACK); addItemFeedback(ItemFeedback.GENERAL_FEEDBACK, text); }
public void setItemTagSet(Set<ItemTagIfc> itemTagSet) { this.itemTagSet = itemTagSet; this.tagListToJsonString = convertTagListToJsonString(itemTagSet);}
public boolean getIsAnswerOptionsSimple() { return this.getAnswerOptionsSimpleOrRich().equals(ItemDataIfc.ANSWER_OPTIONS_SIMPLE); }
public boolean getCorrectItemFbIsNotEmpty() { return isNotEmpty(getCorrectItemFeedback()); }
while (j.hasNext()) { ItemData item = (ItemData) j.next(); PublishedItemData publishedItem = new PublishedItemData( publishedSection, item.getSequence(), item.getDuration(), item.getInstruction(), item.getDescription(), item Set publishedItemAttachmentSet = preparePublishedItemAttachmentSet( publishedItem, item.getItemAttachmentSet(), protocol); publishedItem.setItemTextSet(publishedItemTextSet); publishedItem.setItemMetaDataSet(publishedItemMetaDataSet); publishedItem.setItemTagSet(publishedItemTagSet); publishedItem.setItemFeedbackSet(publishedItemFeedbackSet); publishedItem.setItemAttachmentSet(publishedItemAttachmentSet); publishedItem.setAnswerOptionsRichCount(item.getAnswerOptionsRichCount()); publishedItem.setAnswerOptionsSimpleOrRich(item.getAnswerOptionsSimpleOrRich());
try { if (item != null) { // need to dissociate with item before deleting in Hibernate 3 Set set = item.getItemTextSet(); item.setItemTextSet(new HashSet()); getHibernateTemplate().deleteAll(set); retryCount = 0; try { if (item != null) { // need to dissociate with item before deleting in Hibernate 3 Set set = item.getItemMetaDataSet(); item.setItemMetaDataSet(new HashSet()); getHibernateTemplate().deleteAll(set); retryCount = 0; try { if (item != null) { // need to dissociate with item before deleting in Hibernate 3 Set set = item.getItemFeedbackSet(); item.setItemFeedbackSet(new HashSet()); getHibernateTemplate().deleteAll(set); retryCount = 0;
/** * Replaces embedded site ids for Items. * Helper method for replaceEmbeddedSiteIds(); handles the question (item) level. This * includes the item-level feedback and itemText objects containing more item data. * Called by replaceEmbeddedSiteIds() * Calls into replaceEmbeddedSiteIdsForItemText() in order to access more detailed item data. * * @param item */ private void replaceEmbeddedSiteIdsForItem(PublishedItemData item) { String toContext = AgentFacade.getCurrentSiteId(); replaceEmbeddedSiteIdsForItemText(item.getItemTextSet(), toContext); // Replace the hint (model answer) site ids String itemHint = item.getHint(); if (itemHint != null) { item.setHint(replaceSiteIdsForString(itemHint,toContext)); } replaceEmbeddedSiteIdsForFeedback(item.getItemFeedbackSet(), toContext); }
if (!this.getTypeId().equals(TypeD.TRUE_FALSE)) Set set = this.getItemTextSet(); Iterator iter = set.iterator(); if (iter.hasNext())
public String getEmiAnswerOptionLabels() { String emiAnswerOptionLabels = null; if (TypeD.EXTENDED_MATCHING_ITEMS.equals(getTypeId())) { if (getIsAnswerOptionsSimple()) { emiAnswerOptionLabels = ""; Iterator iter = getEmiAnswerOptions().iterator(); while (iter.hasNext()) { AnswerIfc answer = (AnswerIfc) iter.next(); emiAnswerOptionLabels += answer.getLabel(); } } else { // Rich emiAnswerOptionLabels = ItemDataIfc.ANSWER_OPTION_LABELS.substring(0, getAnswerOptionsRichCount().intValue()); } } return emiAnswerOptionLabels; }
if (index == grades.size() || ((ItemGradingData) ((List) grades.get(index)).get(0)).getPublishedItemId() .longValue() != pid.getItemId().longValue()) { newList.add(new EmptyItemGrading(pid.getSection().getSequence(), pid.getItemId(), pid.getSequence())); grades.add(index, newList); if (pid.getAddCommentFlag()) { addResponseComment = true; if (responseComment.equals("") && grade.getAnswerText() != null) {
public void addItemMetaData(String label, String entry) { if (this.itemMetaDataSet == null) { setItemMetaDataSet(new HashSet()); } this.itemMetaDataSet.add(new PublishedItemMetaData(this, label, entry)); }
public void addItemFeedback(String typeId, String text) { if (this.itemFeedbackSet == null) { setItemFeedbackSet(new HashSet()); } this.itemFeedbackSet.add(new PublishedItemFeedback(this, typeId, text)); }
/** ItemFacade is the class that is exposed to developer * It contains some of the useful methods specified in * org.osid.assessment.Item 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 */ public PublishedItemFacade(){ // need to hook PublishedItemFacade.data to ItemData, our POJO for Hibernate // persistence this.data = new PublishedItemData(); ItemImpl itemImpl = new ItemImpl(); //<-- place holder item = (Item)itemImpl; try { item.updateData(this.data); } catch (AssessmentException ex) { throw new DataFacadeException(ex.getMessage()); } }
while (j.hasNext()) { ItemData item = (ItemData) j.next(); PublishedItemData publishedItem = new PublishedItemData( publishedSection, item.getSequence(), item.getDuration(), item.getInstruction(), item.getDescription(), item Set publishedItemAttachmentSet = preparePublishedItemAttachmentSet( publishedItem, item.getItemAttachmentSet(), protocol); publishedItem.setItemTextSet(publishedItemTextSet); publishedItem.setItemMetaDataSet(publishedItemMetaDataSet); publishedItem.setItemTagSet(publishedItemTagSet); publishedItem.setItemFeedbackSet(publishedItemFeedbackSet); publishedItem.setItemAttachmentSet(publishedItemAttachmentSet); publishedItem.setAnswerOptionsRichCount(item.getAnswerOptionsRichCount()); publishedItem.setAnswerOptionsSimpleOrRich(item.getAnswerOptionsSimpleOrRich());
try { if (item != null) { // need to dissociate with item before deleting in Hibernate 3 Set set = item.getItemTextSet(); item.setItemTextSet(new HashSet()); getHibernateTemplate().deleteAll(set); retryCount = 0; try { if (item != null) { // need to dissociate with item before deleting in Hibernate 3 Set set = item.getItemMetaDataSet(); item.setItemMetaDataSet(new HashSet()); getHibernateTemplate().deleteAll(set); retryCount = 0; try { if (item != null) { // need to dissociate with item before deleting in Hibernate 3 Set set = item.getItemFeedbackSet(); item.setItemFeedbackSet(new HashSet()); getHibernateTemplate().deleteAll(set); retryCount = 0;
/** * Replaces embedded site ids for Items. * Helper method for replaceEmbeddedSiteIds(); handles the question (item) level. This * includes the item-level feedback and itemText objects containing more item data. * Called by replaceEmbeddedSiteIds() * Calls into replaceEmbeddedSiteIdsForItemText() in order to access more detailed item data. * * @param item */ private void replaceEmbeddedSiteIdsForItem(PublishedItemData item) { String toContext = AgentFacade.getCurrentSiteId(); replaceEmbeddedSiteIdsForItemText(item.getItemTextSet(), toContext); // Replace the hint (model answer) site ids String itemHint = item.getHint(); if (itemHint != null) { item.setHint(replaceSiteIdsForString(itemHint,toContext)); } replaceEmbeddedSiteIdsForFeedback(item.getItemFeedbackSet(), toContext); }
if (getTypeId().equals(TypeIfc.MATCHING) || getTypeId().equals(TypeIfc.CALCULATED_QUESTION) || getTypeId().equals(TypeIfc.IMAGEMAP_QUESTION) || getTypeId().equals(TypeIfc.MATRIX_CHOICES_SURVEY)) return instruction; Set set = this.getItemTextSet(); Iterator iter = set.iterator(); if (this.getTypeId().equals(TypeIfc.EXTENDED_MATCHING_ITEMS)) { if (!itemText.getSequence().equals(Long.valueOf(0))) { continue; if (this.getTypeId().equals(TypeIfc.FILL_IN_BLANK)) text = text.replaceAll("\\}","__"); if (this.getTypeId().equals(TypeIfc.FILL_IN_NUMERIC))
public String getEmiAnswerOptionLabels() { String emiAnswerOptionLabels = null; if (TypeD.EXTENDED_MATCHING_ITEMS.equals(getTypeId())) { if (getIsAnswerOptionsSimple()) { emiAnswerOptionLabels = ""; Iterator iter = getEmiAnswerOptions().iterator(); while (iter.hasNext()) { AnswerIfc answer = (AnswerIfc) iter.next(); emiAnswerOptionLabels += answer.getLabel(); } } else { // Rich emiAnswerOptionLabels = ItemDataIfc.ANSWER_OPTION_LABELS.substring(0, getAnswerOptionsRichCount().intValue()); } } return emiAnswerOptionLabels; }
if (index == grades.size() || ((ItemGradingData) ((List) grades.get(index)).get(0)).getPublishedItemId() .longValue() != pid.getItemId().longValue()) { newList.add(new EmptyItemGrading(pid.getSection().getSequence(), pid.getItemId(), pid.getSequence())); grades.add(index, newList); if (pid.getAddCommentFlag()) { addResponseComment = true; if (responseComment.equals("") && grade.getAnswerText() != null) {
public void addItemMetaData(String label, String entry) { if (this.itemMetaDataSet == null) { setItemMetaDataSet(new HashSet()); } this.itemMetaDataSet.add(new PublishedItemMetaData(this, label, entry)); }