Index: docs/conversion/samigo_2_8_x-2_9_0_mysql_conversion.sql =================================================================== --- docs/conversion/samigo_2_8_x-2_9_0_mysql_conversion.sql (revision 133459) +++ docs/conversion/samigo_2_8_x-2_9_0_mysql_conversion.sql (working copy) @@ -28,4 +28,26 @@ VALUES(NULL, (SELECT ID FROM SAM_ASSESSMENTBASE_T WHERE TITLE='Timed Test' AND TYPEID='142' AND ISTEMPLATE=1), 'lockedBrowser_isInstructorEditable', 'true') -; \ No newline at end of file +; + +-- SAK-17243 +alter table SAM_ATTACHMENT_T add ITEMTEXTID bigint(20) DEFAULT NULL; +alter table SAM_ITEMTEXT_T add REQUIRED_OPTIONS_COUNT int(11) DEFAULT NULL; +alter table SAM_ITEM_T add ANSWER_OPTIONS_RICH_COUNT int(11) DEFAULT NULL; +alter table SAM_ITEM_T add ANSWER_OPTIONS_SIMPLE_OR_RICH int(11) DEFAULT NULL; + +create index SAM_ATTACH_ITEMTEXTID_I ON SAM_ATTACHMENT_T (ITEMTEXTID); +alter table SAM_ATTACHMENT_T add CONSTRAINT FOREIGN KEY (ITEMTEXTID) REFERENCES SAM_ITEMTEXT_T (ITEMTEXTID); + +alter table SAM_PUBLISHEDATTACHMENT_T add ITEMTEXTID bigint(20) DEFAULT NULL; +alter table SAM_PUBLISHEDITEMTEXT_T add REQUIRED_OPTIONS_COUNT int(11) DEFAULT NULL; +alter table SAM_PUBLISHEDITEM_T add ANSWER_OPTIONS_RICH_COUNT int(11) DEFAULT NULL; +alter table SAM_PUBLISHEDITEM_T add ANSWER_OPTIONS_SIMPLE_OR_RICH int(11) DEFAULT NULL; + +create index SAM_PUBATTACH_ITEMTEXTID_I ON SAM_PUBLISHEDATTACHMENT_T (ITEMTEXTID); +alter table SAM_PUBLISHEDATTACHMENT_T add CONSTRAINT FOREIGN KEY (ITEMTEXTID) REFERENCES SAM_PUBLISHEDITEMTEXT_T (ITEMTEXTID); + +INSERT INTO SAM_TYPE_T (TYPEID ,AUTHORITY ,DOMAIN, KEYWORD, DESCRIPTION, + STATUS, CREATEDBY, CREATEDDATE, LASTMODIFIEDBY, LASTMODIFIEDDATE ) + VALUES (14 , 'stanford.edu' ,'assessment.item' ,'Extended Matching Items' ,NULL ,1 ,1 , + '2009-11-23 12:00:00',1 ,'2009-11-23 12:00:00'); \ No newline at end of file Index: docs/conversion/samigo_2_8_x-2_9_0_oracle_conversion.sql =================================================================== --- docs/conversion/samigo_2_8_x-2_9_0_oracle_conversion.sql (revision 133459) +++ docs/conversion/samigo_2_8_x-2_9_0_oracle_conversion.sql (working copy) @@ -27,6 +27,13 @@ VALUES (13 , 'stanford.edu' ,'assessment.item' ,'Matrix Choices Survey' ,NULL ,1 ,1 , SYSDATE ,1 ,SYSDATE); +INSERT INTO SAM_TYPE_T ("TYPEID" ,"AUTHORITY" ,"DOMAIN" ,"KEYWORD", + "DESCRIPTION" , + "STATUS" ,"CREATEDBY" ,"CREATEDDATE" ,"LASTMODIFIEDBY" , + "LASTMODIFIEDDATE" ) + VALUES (14 , 'stanford.edu' ,'assessment.item' ,'Extended Matching_Items' ,NULL ,1 ,1 , + SYSDATE ,1 ,SYSDATE); + -- SAM-1255 Update SAM_ASSESSEVALUATION_T Set ANONYMOUSGRADING = 2 Index: pom.xml =================================================================== --- pom.xml (revision 133459) +++ pom.xml (working copy) @@ -15,6 +15,10 @@ 10.0-SNAPSHOT pom + + UTF-8 + + samigo-api samigo-app @@ -34,18 +38,35 @@ scm:svn:https://source.sakaiproject.org/svn/sam/trunk https://source.sakaiproject.org/svn/sam/trunk - + - + sakai-site Sakai release Site scpexe://source.sakaiproject.org/var/www/html/release/samigo/${project.version} - - + + + org.sakaiproject.samigo + samigo-api + ${project.version} + provided + + + org.sakaiproject.samigo + samigo-services + ${project.version} + provided + + + org.sakaiproject.samigo + samigo-app + ${project.version} + + org.sakaiproject.samigo samigo-cp ${project.version} @@ -64,6 +85,36 @@ ${project.version} jar + + org.sakaiproject.samigo + samigo-import + ${project.version} + + + org.sakaiproject.samigo + samigo-deploy + ${project.version} + + + org.sakaiproject.samigo + samigo-assembly + ${project.version} + + + org.sakaiproject.samigo + samigo-shared + ${project.version} + + + org.sakaiproject.samigo + samigo-help + ${project.version} + + + org.sakaiproject.samigo + samigo-pack + ${project.version} + org.sakaiproject.samigo Index: samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/assessment/AnswerIfc.java =================================================================== --- samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/assessment/AnswerIfc.java (revision 133459) +++ samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/assessment/AnswerIfc.java (working copy) @@ -23,12 +23,12 @@ package org.sakaiproject.tool.assessment.data.ifc.assessment; -import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Set; public interface AnswerIfc - extends java.io.Serializable + extends Comparable, java.io.Serializable { Long getId(); @@ -75,15 +75,15 @@ Double getPartialCredit(); - Set getAnswerFeedbackSet(); + Set getAnswerFeedbackSet(); - ArrayList getAnswerFeedbackArray(); + List getAnswerFeedbackArray(); - void setAnswerFeedbackSet(Set answerFeedbackSet); + void setAnswerFeedbackSet(Set answerFeedbackSet); String getAnswerFeedback(String typeId); - HashMap getAnswerFeedbackMap(); + HashMap getAnswerFeedbackMap(); String getCorrectAnswerFeedback(); Index: samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/assessment/AssessmentAccessControlIfc.java =================================================================== --- samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/assessment/AssessmentAccessControlIfc.java (revision 133459) +++ samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/assessment/AssessmentAccessControlIfc.java (working copy) @@ -64,8 +64,7 @@ // lateHandling public static Integer ACCEPT_LATE_SUBMISSION = Integer.valueOf(1); public static Integer NOT_ACCEPT_LATE_SUBMISSION = Integer.valueOf(2); - - // gopalrc - group release + // group release public static String RELEASE_TO_SELECTED_GROUPS = "Selected Groups"; Long getId(); Index: samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/assessment/AttachmentIfc.java =================================================================== --- samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/assessment/AttachmentIfc.java (revision 133459) +++ samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/assessment/AttachmentIfc.java (working copy) @@ -36,6 +36,7 @@ //This parameter is for SAM_GRADINGATTACHMENT_T table public static Long ITEMGRADING_ATTACHMENT = Long.valueOf(1); + public static Long ITEM_TEXT_ATTACHMENT = Long.valueOf(5);//for EMI sub-item attachments public static Integer ACTIVE_STATUS = Integer.valueOf(1); public static Integer INACTIVE_STATUS = Integer.valueOf(0); Index: samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/assessment/ItemDataIfc.java =================================================================== --- samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/assessment/ItemDataIfc.java (revision 133459) +++ samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/assessment/ItemDataIfc.java (working copy) @@ -22,16 +22,16 @@ package org.sakaiproject.tool.assessment.data.ifc.assessment; -import java.util.ArrayList; + import java.util.Date; -import java.util.HashMap; import java.util.Set; import java.util.List; import org.sakaiproject.tool.assessment.data.ifc.shared.TypeIfc; -public interface ItemDataIfc extends java.io.Serializable { +public interface ItemDataIfc extends Comparable, java.io.Serializable { + public static Integer ACTIVE_STATUS = Integer.valueOf(1); public static Integer INACTIVE_STATUS = Integer.valueOf(0); @@ -115,19 +115,19 @@ void setLastModifiedDate(Date lastModifiedDate); - Set getItemTextSet(); + Set getItemTextSet(); - void setItemTextSet(Set itemTextSet) ; + void setItemTextSet(Set itemTextSet) ; - void addItemText(String itemText, Set answerSet); + void addItemText(String itemText, Set answerSet); - Set getItemMetaDataSet(); + Set getItemMetaDataSet(); - void setItemMetaDataSet(Set itemMetaDataSet); + void setItemMetaDataSet(Set itemMetaDataSet); - Set getItemFeedbackSet(); + Set getItemFeedbackSet(); - void setItemFeedbackSet(Set itemFeedbackSet); + void setItemFeedbackSet(Set itemFeedbackSet); String getItemMetaDataByLabel(String label); @@ -159,15 +159,40 @@ TypeIfc getType(); - ArrayList getItemTextArray(); + List getItemTextArray(); - ArrayList getItemTextArraySorted(); + List getItemTextArraySorted(); String getAnswerKey(); - Set getItemAttachmentSet(); + Set getItemAttachmentSet(); - void setItemAttachmentSet(Set itemAttachmentSet); + void setItemAttachmentSet(Set itemAttachmentSet); - List getItemAttachmentList(); + List getItemAttachmentList(); + + String getLeadInText(); + String getThemeText(); + //public ItemTextIfc getEmiAnswerComponentsItemText(); + public int getNumberOfCorrectEmiOptions(); + public String getEmiAnswerOptionLabels(); + public boolean isValidEmiAnswerOptionLabel(String label); + + public List getEmiAnswerOptions(); + public List getEmiQuestionAnswerCombinations(); + + public ItemTextIfc getItemTextBySequence(Long itemTextSequence); + public Integer getAnswerOptionsRichCount(); + public void setAnswerOptionsRichCount(Integer answerOptionsRichCount); + + // for EMI + public static final String ANSWER_OPTION_LABELS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + public static final String ANSWER_OPTION_VALID_DELIMITERS = " ,;:."; + public static final Integer ANSWER_OPTIONS_SIMPLE = 0; + public static final Integer ANSWER_OPTIONS_RICH = 1; + public Integer getAnswerOptionsSimpleOrRich(); + public void setAnswerOptionsSimpleOrRich(Integer answerOptionsSimpleOrRich); + public String getEmiAnswerOptionsRichText(); + public boolean getIsAnswerOptionsSimple(); + public boolean getIsAnswerOptionsRich(); } Index: samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/assessment/ItemTextAttachmentIfc.java =================================================================== --- samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/assessment/ItemTextAttachmentIfc.java (revision 0) +++ samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/assessment/ItemTextAttachmentIfc.java (working copy) @@ -0,0 +1,37 @@ +/** + * ******************************************************************************** + * $URL: + * https://source.sakaiproject.org/svn/sam/trunk/samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/grading/MediaIfc.java + * $ $Id: MediaIfc.java 11438 2006-06-30 20:06:03Z daisyf@stanford.edu $ + * ********************************************************************************** + * + * Copyright (c) 2004, 2005, 2006, 2008 The Sakai Foundation + * + * Licensed under the Educational Community License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.osedu.org/licenses/ECL-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + * + ********************************************************************************* + */ +package org.sakaiproject.tool.assessment.data.ifc.assessment; + +public interface ItemTextAttachmentIfc + extends AttachmentIfc { + + Long getAttachmentType(); + + void setAttachmentType(Long attachmentType); + + ItemTextIfc getItemText(); + + void setItemText(ItemTextIfc itemText); + +} Index: samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/assessment/ItemTextIfc.java =================================================================== --- samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/assessment/ItemTextIfc.java (revision 133459) +++ samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/assessment/ItemTextIfc.java (working copy) @@ -23,12 +23,16 @@ package org.sakaiproject.tool.assessment.data.ifc.assessment; -import java.util.ArrayList; +import java.util.List; import java.util.Set; public interface ItemTextIfc - extends java.io.Serializable + extends Comparable, java.io.Serializable { + public static Long EMI_THEME_TEXT_SEQUENCE = Long.valueOf(-1); + public static Long EMI_ANSWER_OPTIONS_SEQUENCE = Long.valueOf(-2); + public static Long EMI_LEAD_IN_TEXT_SEQUENCE = Long.valueOf(-3); + Long getId(); void setId(Long id); @@ -45,11 +49,40 @@ void setText(String text); - Set getAnswerSet(); + Set getAnswerSet(); - void setAnswerSet(Set answerSet); + void setAnswerSet(Set answerSet); - ArrayList getAnswerArray(); + List getAnswerArray(); - ArrayList getAnswerArraySorted(); + List getAnswerArraySorted(); + + Set getItemTextAttachmentSet(); + + void setItemTextAttachmentSet(Set itemTextAttachmentSet); + + List getItemTextAttachmentList(); + + /** + * This is an actual EMI Question Item (i.e. not Theme or Lead In Text or + * Complete Answer Options List) + * + * @return + * @since 2.10 + */ + public boolean isEmiQuestionItemText(); + + /** + * Get the number of required option + * + * @return the number of required options or 1 if not defined + * @since 2.10 + */ + public Integer getRequiredOptionsCount(); + + public void setRequiredOptionsCount(Integer requiredOptionsCount); + + public String getEmiCorrectOptionLabels(); + + public boolean getHasAttachment(); } Index: samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/assessment/SecureDeliveryModuleIfc.java =================================================================== --- samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/assessment/SecureDeliveryModuleIfc.java (revision 133459) +++ samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/assessment/SecureDeliveryModuleIfc.java (working copy) @@ -4,7 +4,6 @@ import javax.servlet.http.HttpServletRequest; -import org.sakaiproject.tool.assessment.shared.api.assessment.SecureDeliveryServiceAPI; import org.sakaiproject.tool.assessment.shared.api.assessment.SecureDeliveryServiceAPI.Phase; import org.sakaiproject.tool.assessment.shared.api.assessment.SecureDeliveryServiceAPI.PhaseStatus; Index: samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/shared/TypeIfc.java =================================================================== --- samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/shared/TypeIfc.java (revision 133459) +++ samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/shared/TypeIfc.java (working copy) @@ -26,22 +26,24 @@ public interface TypeIfc extends java.io.Serializable { // This has the exact same list as TypeFacade. Please keep both list updated - public static Long MULTIPLE_CHOICE = Long.valueOf(1); - public static Long MULTIPLE_CORRECT = Long.valueOf(2); - public static Long MULTIPLE_CHOICE_SURVEY = Long.valueOf(3); - public static Long TRUE_FALSE = Long.valueOf(4); - public static Long ESSAY_QUESTION = Long.valueOf(5); - public static Long FILE_UPLOAD = Long.valueOf(6); - public static Long AUDIO_RECORDING = Long.valueOf(7); - public static Long FILL_IN_BLANK = Long.valueOf(8); - public static Long MATCHING = Long.valueOf(9); - public static Long FILL_IN_NUMERIC = Long.valueOf(11); - public static Long MULTIPLE_CORRECT_SINGLE_SELECTION = Long.valueOf(12); - public static Long MATRIX_CHOICES_SURVEY = Long.valueOf(13); - public static Long CALCULATED_QUESTION = Long.valueOf(15); // CALCULATED_QUESTION + public static final Long MULTIPLE_CHOICE = Long.valueOf(1); + public static final Long MULTIPLE_CORRECT = Long.valueOf(2); + public static final Long MULTIPLE_CHOICE_SURVEY = Long.valueOf(3); + public static final Long TRUE_FALSE = Long.valueOf(4); + public static final Long ESSAY_QUESTION = Long.valueOf(5); + public static final Long FILE_UPLOAD = Long.valueOf(6); + public static final Long AUDIO_RECORDING = Long.valueOf(7); + public static final Long FILL_IN_BLANK = Long.valueOf(8); + public static final Long MATCHING = Long.valueOf(9); + public static final Long FILL_IN_NUMERIC = Long.valueOf(11); + public static final Long MULTIPLE_CORRECT_SINGLE_SELECTION = Long.valueOf(12); + public static final Long MATRIX_CHOICES_SURVEY = Long.valueOf(13); + public static final Long EXTENDED_MATCHING_ITEMS = Long.valueOf(14); + public static final Long CALCULATED_QUESTION = Long.valueOf(15); // CALCULATED_QUESTION // these are section type available in this site, public static Long DEFAULT_SECTION = Long.valueOf(21); // these are assessment template type available in this site, + public static final Long TEMPLATE_SYSTEM_DEFINED = Long.valueOf(142); public static Long TEMPLATE_QUIZ = Long.valueOf(41); public static Long TEMPLATE_HOMEWORK = Long.valueOf(42); public static Long TEMPLATE_MIDTERM = Long.valueOf(43); @@ -53,6 +55,17 @@ public static Long FINAL = Long.valueOf(64); public static String SITE_AUTHORITY = "stanford.edu"; public static String DOMAIN_ASSESSMENT_ITEM = "assessment.item"; + + enum TypeId{ + MULTIPLE_CHOICE_ID(MULTIPLE_CHOICE); + int id; + TypeId(Long l){ + id = l.intValue(); + } + public int id(){ + return id; + } + } Long getTypeId(); Index: samigo-api/src/java/org/sakaiproject/tool/assessment/samlite/api/Answer.java =================================================================== --- samigo-api/src/java/org/sakaiproject/tool/assessment/samlite/api/Answer.java (revision 133459) +++ samigo-api/src/java/org/sakaiproject/tool/assessment/samlite/api/Answer.java (working copy) @@ -21,5 +21,9 @@ return text; } - + public void postProcessing(int questionType) { + if (questionType == Question.EXTENDED_MATCHING_ITEMS_QUESTION) { + text = text.substring(text.lastIndexOf("[")+1, text.lastIndexOf("]")).trim(); + } + } } Index: samigo-api/src/java/org/sakaiproject/tool/assessment/samlite/api/Question.java =================================================================== --- samigo-api/src/java/org/sakaiproject/tool/assessment/samlite/api/Question.java (revision 133459) +++ samigo-api/src/java/org/sakaiproject/tool/assessment/samlite/api/Question.java (working copy) @@ -1,5 +1,6 @@ package org.sakaiproject.tool.assessment.samlite.api; +import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import java.util.Iterator; @@ -11,6 +12,12 @@ public static final int FILL_IN_THE_BLANK_QUESTION = 20; public static final int TRUE_FALSE_QUESTION = 30; public static final int SHORT_ESSAY_QUESTION = 40; + public static final int EXTENDED_MATCHING_ITEMS_QUESTION = 50; + // for EMI question + private String themeText; + private String leadInText; + private ArrayList emiAnswerOptions; // store List of possible options for an EMI question's anwers + private ArrayList emiQuestionAnswerCombinations; // store List of possible options for an EMI question's anwers private int questionNumber; private String questionPoints; @@ -96,7 +103,7 @@ public boolean hasPoints() { return hasPoints; } - + public int getQuestionType() { return questionType; } @@ -105,6 +112,40 @@ this.questionType = questionType; } + public void postProcessing() { + if (getQuestionType() == EXTENDED_MATCHING_ITEMS_QUESTION) { + int themeLineIndex = 1; + int optionLine = 2; + questionLines.set(themeLineIndex, questionLines.get(themeLineIndex).toString() + "

"); + Iterator answerLines = answers.iterator(); + String textToAdd = "Options: "; + questionLines.add(optionLine++, textToAdd + "
"); + while (answerLines.hasNext()) { + Answer answer = (Answer) answerLines.next(); + textToAdd = answer.getId() + ". " + answer.getText(); + if (!answer.isCorrect()) { + // add at next options position + questionLines.add(optionLine++, textToAdd + "
"); + } + else { + // add at end + //textToAdd = textToAdd.substring(0, textToAdd.indexOf("[")).trim() + "
"; + questionLines.add(textToAdd); + } + } + answerLines = answers.iterator(); + while (answerLines.hasNext()) { + Answer answer = (Answer)answerLines.next(); + if (!answer.isCorrect()) { + answerLines.remove(); + } + else { + answer.postProcessing(questionType); + } + } + } + } + public String getQuestionTypeAsString() { return questionTypeAsString; } @@ -112,5 +153,57 @@ public void setQuestionTypeAsString(String questionTypeAsString) { this.questionTypeAsString = questionTypeAsString; } - + +//************ Theme and Lead-In Text ****************** + + public String getLeadInText() { + if (leadInText == null) { + setThemeAndLeadInText(); + } + return leadInText; + } + + public String getThemeText() { + if (themeText == null) { + setThemeAndLeadInText(); + } + return themeText; + } + + public void setThemeAndLeadInText() { + themeText = (String)questionLines.get(1); + leadInText = (String)questionLines.get(2); + } + + + //************ EMI Answer Options and Q-A combinations****************** + + public ArrayList getEmiAnswerOptions() { + if (emiAnswerOptions==null) { + setEmiOptionsAndQACombinations(); + } + return emiAnswerOptions; + } + + public ArrayList getEmiQuestionAnswerCombinations() { + if (emiQuestionAnswerCombinations==null) { + setEmiOptionsAndQACombinations(); + } + return emiQuestionAnswerCombinations; + } + + private void setEmiOptionsAndQACombinations() { + emiAnswerOptions = new ArrayList(); + emiQuestionAnswerCombinations = new ArrayList(); + Iterator iter = answers.iterator(); + while (iter.hasNext()) { + Answer answer = (Answer)iter.next(); + if (answer.getId().matches("[0-9]+")) { + emiQuestionAnswerCombinations.add(answer); + } + else { + emiAnswerOptions.add(answer); + } + } + } } Index: samigo-api/src/java/org/sakaiproject/tool/assessment/shared/api/grading/GradingSectionAwareServiceAPI.java =================================================================== --- samigo-api/src/java/org/sakaiproject/tool/assessment/shared/api/grading/GradingSectionAwareServiceAPI.java (revision 133459) +++ samigo-api/src/java/org/sakaiproject/tool/assessment/shared/api/grading/GradingSectionAwareServiceAPI.java (working copy) @@ -97,7 +97,6 @@ /** - * added by gopalrc - Jan 2008 * @return * an EnrollmentRecord list for each student that the current user * is allowed to grade, who is in at least one of the release groups Index: samigo-api/src/java/xml/author/v1p2/emiTemplate.xml =================================================================== --- samigo-api/src/java/xml/author/v1p2/emiTemplate.xml (revision 0) +++ samigo-api/src/java/xml/author/v1p2/emiTemplate.xml (working copy) @@ -0,0 +1,75 @@ + + + This is a QTI implementation for Extended Matching Items (EMIs). + Note that this is only valid for Samigo's import export of EMI's. + This is not FULL QTI Standard + + + + + qmd_itemtype + Extended Matching Items + + + TEXT_FORMAT + HTML + + + ITEM_OBJECTIVE + + + + ITEM_KEYWORD + + + + ITEM_RUBRIC + + + + ATTACHMENT + + + + hasRationale + false + + + RANDOMIZE + false + + + + + + + + + + + + + + + + + + + + + + + + + + Overall Score + + + + + + + + + + Index: samigo-api/src/java/xml/author/v2p0/emiTemplate.xml =================================================================== --- samigo-api/src/java/xml/author/v2p0/emiTemplate.xml (revision 0) +++ samigo-api/src/java/xml/author/v2p0/emiTemplate.xml (working copy) @@ -0,0 +1,64 @@ + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + 0 + + + + + Index: samigo-api/src/java/xml/xsd/ccv1p2_qtiasiv1p2p1_v1p0.xsd =================================================================== --- samigo-api/src/java/xml/xsd/ccv1p2_qtiasiv1p2p1_v1p0.xsd (revision 0) +++ samigo-api/src/java/xml/xsd/ccv1p2_qtiasiv1p2p1_v1p0.xsd (working copy) @@ -0,0 +1,1916 @@ + + + + + + XSD Data File Information + ------------------------- + Author: Colin Smythe + Date: 1st October, 2011 + Version: 1.2 + Status: Final Release + Description: This model forms part of the IMS Common Cartridge v1.2 specification. This model is the + profile of the IMS QTI v1.2.1 specification. The changes made to the original specification + to create this profile are: + + Root + (a) Only one Assessment or one ObjectBank can be exchanged i.e. not Sections or Items; + (b) The qticomment attribute has been removed. + + Assessment + (a) Only a single Section must be contained in the Assessment; + (b) The metadata is mandatory (see the specification for the fields that must be defined) with a multiplicity of 1; + (c) All of the other Assessment fields have been removed apart from the optional PresentationMaterial; + (d) The title attribute has been made mandatory. + + Object Bank + (a) Only Items can be containd in the object bank; + (b) The Qticomment structure has been removed. + + Section + (a) All of the internal structure has been removed except the containment of Items (at least one is required); + (b) The language attribute has been removed. + + Item + (a) The deprecated attributes have been removed from the ItemMetadata class; + (b) All qticomment attributes have been removed from various classes; + (c) The Item pre and post condition attributes have been removed from the Item class; + (d) The itemproc_extension structure has been removed from the Item class; + (e) The reference structure has been removed from the Item class; + (f) The objectives attribute has been removed from the Item class; + (g) The itemcontrol attribute has been removed from the Item class; + (h) The item rubric attribute and its associated classes have been removed from the Item class; + (i) The duration attribute has been removed from the Item class; + (j) The itemmetadata attribute has been made mandatory in the Item class; + (k) The label, language and maxattempts attributes have been removed from the Item class; + (l) The interpretvar attribute has been removed frm the Outcomes class; + (m) The response_xy, response_num, response_grp and response_extension attributes have + been removed from the Presentation class; + (n) All extension attributes have been removed from various classes; + (o) The ItemType, LevelofDifficulty, RenderingType, ResponseMultiplicity, Status and TypeofSolution + have been deleted; + (p) The ItemFeedback Class has been restructured as only flow_mat is used; + (q) A single decvar is required i.e. for the default variable SCORE. + + Item-Response + (a) The Rrange and Rarea attributes have been removed from the ResponseLabel Class. + + Item-Render + (a) The render_hotspot attributes and the RenderHotspot class have been removed; + (b) The render_slider attributes and the RenderSlider class have been removed; + (c) The render_extension attribute has been removed from the ResponseType class; + (d) The response_na attribute has been removed; + (e) The qticomment attribute has been removed from the ResponseLabel class; + + Item-General + (a) The Interpretvar class has been removed; + (b) The DurationBase class has been removed and all derived attributes from the Conditionvar and CompositionLogic classes; + (c) The var_extension attribute has been removed from the Conditionvar class; + (d) The qticomment attributes have been removed from the Hint and Solution classes; + (e) Setvar is restricted to the Set action; + (f) Variable types are restricted to 'Integer' and 'Decimal'; + (g) The defaultval and cutvalue, attributes for decvar have been removed; + (h) Outcomes is limtied to a single decvar which must have only the variable "SCORE" declared; + (i) The classes varlt, varlte, vargt, vargte, varinside, varsubset and unanswered have been removed; + (j) The classes 'and', 'or', 'not' and 'conditionvar' have been significantly simplied i.e. see clause above for detail + (k) The feedbacktype attribute for displayfeedback has been made mandatory with no default. + + Selection and Ordering + (a) The entire Selection and Ordering (Package) has been removed. + + Outcomes + (a) The entire Outcomes Processing (Package) has been removed. + + Material + (a) The Reference Class has been removed as this is not required; + (b) All entityref attributes have been removed; + (c) Extensions have been removed; + (d) Only 'mattext', 'matref' and 'matbreak' are permitted as types of material. + + Common + (a) The Rubric class has been removed Items and Sections and it is only permitted to contain a single instance of material; + (b) The ContextControl class has been removed i.e. no Control switches required; + (c) The QtiComment Class has been removed; + (d) The MetadataRule Class has been removed; + (e) the Parameterization Class has been removed; + (f) The 'view' attribute has been removed; + (g) The Vocabulary Class has been removed and its attribute in the QtiMetadata Class also removed. + + History: Version 1.0: This profile is taken from the UML description of the QTIv1.2.1 specification. + Version 1.1: Material has been returned as an alternative to flow_mat in ItemFeedback, + SolutionMaterial and HintMaterial. Also, Assessment Rubric has been permitted but it must + only contain a single instance of material. + Version 1.2: The 'or' element has been re-introduced. + + License: IPR, License and Distribution Notices + This machine readable file is derived from IMS Global Learning Consortium (GLC) specification IMS Common Cartridge Version 1.2 + found at http://www.imsglobal.org/cc/ and the original IMS GLC schema binding or code base + http://www.imsglobal.org/cc/. + + Recipients of this document are requested to submit, with their comments, notification of any + relevant patent claims or other intellectual property rights of which they may be aware that might be + infringed by the schema binding contained in this document. + + IMS GLC takes no position regarding the validity or scope of any intellectual property or other + rights that might be claimed to pertain to the implementation or use of the technology described in this + document or the extent to which any license under such rights might or might not be available; neither + does it represent that it has made any effort to identify any such rights. Information on IMS GLCs + procedures with respect to rights in IMS GLC specifications can be found at the IMS GLC Intellectual Property + Rights web page: http://www.imsglobal.org/ipr/imsipr_policyFinal.pdf. + + Copyright (c) IMS Global Learning Consortium 1999-2011. All Rights Reserved. + + License Notice for Users + + Users of products or services that include this document are hereby granted a worldwide, royalty-free, + non-exclusive license to use this document. + + Distribution Notice for Developers + + Developers of products or services that are not original incorporators of this document and + have not changed this document, that is, are distributing a software product that incorporates this + document as is from a third-party source other than IMS, are hereby granted permission to copy, + display and distribute the contents of this document in any medium for any purpose without fee or + royalty provided that you include this IPR, License and Distribution notice in its entirety on ALL + copies, or portions thereof. + + Developers of products or services that are original incorporators of this document and wish + to provide distribution of this document as is or with modifications and developers of products and + services that are not original incorporators of this document and have changed this document, are + required to register with the IMS GLC community on the IMS GLC website as described in the following two + paragraphs:- + + * If you wish to distribute this document as is, with no modifications, you are hereby granted + permission to copy, display and distribute the contents of this document in any medium for any + purpose without fee or royalty provided that you include this IPR, License and Distribution notice in + its entirety on ALL copies, or portions thereof, that you make and you complete a valid license + registration with IMS and receive an email from IMS granting the license. To register, follow the + instructions on the IMS website: http://www.imsglobal.org/specificationdownload.cfm. Once + registered you are granted permission to transfer unlimited distribution rights of this document for the + purposes of third-party or other distribution of your product or service that incorporates this + document as long as this IPR, License and Distribution notice remains in place in its entirety; + + * If you wish to create and distribute a derived work from this document, you are hereby + granted permission to copy, display and distribute the contents of the derived work in any medium for + any purpose without fee or royalty provided that you include this IPR, License and Distribution + notice in its entirety on ALL copies, or portions thereof, that you make and you complete a valid + profile registration with IMS GLC and receive an email from IMS GLC granting the license. To register, follow + the instructions on the IMS GLC website: http://www.imsglobal.org/profile/. Once registered you are + granted permission to transfer unlimited distribution rights of the derived work for the purposes of + third-party or other distribution of your product or service that incorporates the derived work as long + as this IPR, License and Distribution notice remains in place in its entirety. + + The limited permissions granted above are perpetual and will not be revoked by IMS GLC or its + successors or assigns. + + THIS SPECIFICATION IS BEING OFFERED WITHOUT ANY WARRANTY WHATSOEVER, AND IN PARTICULAR, ANY WARRANTY OF NONINFRINGEMENT IS + EXPRESSLY DISCLAIMED. ANY USE OF THIS SPECIFICATION SHALL BE MADE ENTIRELY AT THE IMPLEMENTERS OWN RISK, AND NEITHER THE CONSORTIUM + NOR ANY OF ITS MEMBERS OR SUBMITTERS, SHALL HAVE ANY LIABILITY WHATSOEVER TO ANY IMPLEMENTER OR THIRD PARTY FOR ANY DAMAGES OF + ANY NATURE WHATSOEVER, DIRECTLY OR INDIRECTLY, ARISING FROM THE USE OF THIS SPECIFICATION. + + Source UML File Information + --------------------------- + The source file information must be supplied as an XMI file (without diagram layout information). + The supported UML authoring tools are: + (a) Poseidon - v6 (and later) + + Source XSLT File Information + ---------------------------- + XSL Generator: UMLtoXSDTransformv0p9p5.xsl + XSLT Processor: Xalan + Release: 1.0 Beta 4 + Date: 31st March, 2011 + + IMS GLC Auto-generation Binding Tool-kit (I-BAT) + ------------------------------------------------ + This file was auto-generated using the IMS GLC Binding Auto-generation Tool-kit (I-BAT). While every + attempt has been made to ensure that this tool auto-generates the files correctly, users should be aware + that this is an experimental tool. Permission is given to make use of this tool. IMS GLC makes no + claim on the materials created by third party users of this tool. Details on how to use this tool + are contained in the IMS GLC "I-BAT" Documentation available at the IMS GLC web-site. + + Tool Copyright: 2005-2011 (c) IMS Global Learning Consortium Inc. All Rights Reserved. + + + + + + Schematron Validation Rules Information + --------------------------------------- + Author: Colin Smythe + Date: 1st October, 2011 + Version: 1.2 + Status: Final Release + + Description: This set of schematron rules have been created to increase the validation capability of the QTIv1.2.1 XSD. + A total of 12 rule sets have been created to ensure that: + [1] Only valid Assessment metadata is defined; + [2] Only valid Question types are defined in the Itemmetatadata fields; + [3] The structure of a True/False question is correct; + [4] The structure of a Multiple-Choice (Single Response) question is correct; + [5] The structure of a Multiple-Choice (Multiple Response) question is correct; + [6] The structure of a Fill In Blank question is correct; + [7] The structure of a Pattern Match question is correct; + [8] The structure of an Essay question is correct; + [9] The structures of the response processing/response-label are correct; + [10] The structure of a Hint in an Item is correct; + [11] The structure of a Solution in an Item is correct; + [12] The structure of the response processing feedback structure in an Item is correct; + [13] Generic features of an Item are correctly implemented. + + Rule Set: [1] The set of rules to ensure that only valid Assessment metadata is defined. + The rules are: + (a) Only valid entries are defined for the Assessment metadata fieldlabel values; + (b) Only valid entries are defined for the Assessment metadata fieldentry values for fieldlabel = 'qmd_assessmenttype'; + (c) Only valid entries are defined for the Assessment metadata fieldentry values for fieldlabel = 'qmd_scoretype'; + (d) Only valid entries are defined for the Assessment metadata fieldentry values for fieldlabel = 'qmd_feedbackpermitted'; + (e) Only valid entries are defined for the Assessment metadata fieldentry values for fieldlabel = 'qmd_hintspermitted'; + (f) Only valid entries are defined for the Assessment metadata fieldentry values for fieldlabel = 'qmd_solutionspermitted'; + (g) Only valid entries are defined for the Assessment metadata fieldentry values for fieldlabel = 'qmd_timelimit'; + (h) Only valid entries are defined for the Assessment metadata fieldentry values for fieldlabel = 'cc_allow_late_submission'; + (i) Only valid entries are defined for the Assessment metadata fieldentry values for fieldlabel = 'cc_maxattempts'; + (j) Only valid entries are defined for the Assessment metadata fieldentry values for fieldlabel = 'cc_profile'; + (k) There must be only one Assessment metadata field with fieldlabel='cc_profile' i.e. it is mandatory; + (l) There must be no more than one Assessment metadata field with fieldlabel='qmd_assessmenttype'; + (m) There must be no more than one Assessment metadata field with fieldlabel='qmd_scoretype'; + (n) There must be no more than one Assessment metadata field with fieldlabel='qmd_feedbackpermitted'; + (o) There must be no more than one Assessment metadata field with fieldlabel='qmd_hintspermitted'; + (p) There must be no more than one Assessment metadata field with fieldlabel='qmd_solutionspermitted'; + (q) There must be no more than one Assessment metadata field with fieldlabel='qmd_timelimit'; + (r) There must be no more than one Assessment metadata field with fieldlabel='cc_allow_late_submission'; + (s) There must be no more than one Assessment metadata field with fieldlabel='cc_maxattempts'. + + [2] The set of rules to ensure that only valid Question types are defined in the Itemmetatadata fields. + The rules are: + (a) Only valid entries are defined for the Itemmetadata fieldlabel values; + (b) Only valid entries are defined for the Itemmetadata fieldentry values for fieldlabel = 'cc_profile'; + (c) Only valid entries are defined for the Itemmetadata fieldentry values for fieldlabel = 'cc_weighting'; + (d) Only valid entries are defined for the Itemmetadata fieldentry values for fieldlabel = 'qmd_scoringpermitted'; + (e) Only valid entries are defined for the Itemmetadata fieldentry values for fieldlabel = 'qmd_computerscored'; + (f) The Item metadata field with fieldlabel='cc_profile' must be present; + (g) There must only be one Item metadata fields with fieldlabel='cc_profile'for each Item; + (h) There must be no more than one Item metadata field with fieldlabel='cc_weighting'for each Item; + (i) There must be no more than one Item metadata field with fieldlabel='qmd_scoringpermitted' for each Item; + (j) There must be no more than one Item metadata field with fieldlabel='qmd_computerscored'for each Item. + + [3] The set of rules to ensure that the structure of a True/False question is correct. + The rules are: + (a) That @rcardinality='Single'; + (b) The element 'response_str' is not used; + (c) The element 'render_fib' is not used; + (d) That there are zero or two response labels; + (e) That the response processing uses the correct identifiers i.e. varequal/@respident value is equal to the response_lid/@ident; + (f) The varsubstring element must not be used. + + [4] The set of rules to ensure that the structure of a Multiple-Choice (Single Response) question is correct. + The rules are: + (a) That @rcardinality='Single'; + (b) The element 'response_str' is not used; + (c) The element 'render_fib' is not used; + (d) That there are at least three response labels; + (e) That the response processing uses the correct identifiers i.e. varequal/@respident value is equal to the response_lid/@ident; + (f) The varsubstring element must not be used. + + [5] The set of rules to ensure that the structure of a Multiple-Choice (Multiple Response) question is correct. + The rules are: + (a) That @rcardinality='Multiple'; + (b) The element 'response_str' is not used; + (c) The element 'render_fib' is not used; + (d) That there are at least two response labels; + (e) That the response processing uses the correct identifiers i.e. varequal/@respident value is equal to the response_lid/@ident; + (f) The varsubstring element must not be used.. + + [6] The set of rules to ensure that the structure of a Fill-in-Blank question is correct. + The rules are: + (a) The element 'response_lid' is not used; + (b) The element 'render_choice' is not used; + (c) That the response processing uses the correct identifiers i.e. varequal/@respident value is equal to the response_str/@ident; + (d) There is no use of the 'varsubstring' element. + + [7] The set of rules to ensure that the structure of a Pattern Match question is correct. + The rules are: + (a) The element 'response_lid' is not used; + (b) The element 'render_choice' is not used; + (c) That the response processing uses the correct identifiers i.e. varequal/@respident value is equal to the response_str/@ident. + + [8] The set of rules to ensure that the structure of an Essay question is correct. + The rules are: + (a) The element 'response_lid' is not used; + (b) The element 'render_choice' is not used; + (c) There is no use of the 'varequal' element; + (d) There is no use of the 'varsubstring' element; + (e) No more than a single Solution feedback can be supplied; + (f) The fieldentry Item metadata for an Essay question with the fieldlabel='qmd_computerscored' must be set as 'No'. + + [9] The set of rules to ensure that the Response Processing/Response-Label structures are valid. + The rules are: + (a) There are no invalid response labels used in the 'varequal' element for T/F and MC questions. + + [10] The set of rules to ensure that the structure of a Hint in an Item is correct. + The rules are: + (a) The element 'displayfeedback@feedbacktype=Hint' is accompanied by the @linkrefid='hint' attribute; + (b) The element 'itemfeedback@ident=hint' is not followed by the 'solution' element; + (c) The element 'itemfeedback@ident=hint' is not followed by the 'flow_mat' element; + (d) If the element 'displayfeedback@feedbacktype=Hint' is used it must be accompanied by hint feedback. + + [11] The set of rules to ensure that the structure of a Solution in an Item is correct. + The rules are: + (a) The element 'displayfeedback@feedbacktype=Solution' is accompanied by the @linkrefid='solution' attribute; + (b) The element 'itemfeedback@ident=solution' is not followed by the 'hint' element; + (c) The element 'itemfeedback@ident=solution' is not followed by the 'flow_mat' element; + (d) If the element 'displayfeedback@feedbacktype=Solution' is used it must be accompanied by solution feedback. + + [12] The set of rules to ensure that the general structure of the Response Processing in an Item is correct. + The rules are: + (a) The element 'displayfeedback@feedbacktype=Response' is not accompanied by the @linkrefid='solution' attribute; + (b) The element 'displayfeedback@feedbacktype=Response' is not accompanied by the @linkrefid='hint' attribute; + (c) To check that for each element 'displayfeedback@feedbacktype=Response' the corresponding 'itemfeedback' element exists; + (d) To check that a given response processing itemfeedback identifier there is a corresponding displayfeedback trigger for that identifier. + + [13] The set of rules to ensure that the general features in an Item are correct. + The rules are: + (a) To ensure that each Item has a unique @ident attribute. + + + + Schematron validation rules for the Common Cartridge v1p1 profile of QTI v1.2.1 + + + + RULE SET 1: Ensure that only valid metadata is defined in the Assessment metadata fields + + + + [RULE 1a] Invalid Assessment metadata fieldlabel value: . + + + + + + [RULE 1b] Invalid fieldentry Assessment metadata for the fieldlabel='qmd_assessmenttype' value: . + + + + + + [RULE 1c] Invalid fieldentry Assessment metadata for the fieldlabel='qmd_scoretype' value: . + + + + + + [RULE 1d] Invalid fieldentry Assessment metadata for the fieldlabel='qmd_feedbackpermitted' value: . + + + + + + [RULE 1e] Invalid fieldentry Assessment metadata for the fieldlabel='qmd_hintspermitted' value: . + + + + + + [RULE 1f] Invalid fieldentry Assessment metadata for the fieldlabel='qmd_solutionspermitted' value: . + + + + + + [RULE 1g] Invalid fieldentry Assessment metadata for the fieldlabel='qmd_timelimit' i.e. not a valid integer with value: . + + + + + + [RULE 1h] Invalid fieldentry Assessment metadata for the fieldlabel='cc_allow_late_submission' value: . + + + + + + [RULE 1i] Invalid fieldentry Assessment metadata for the fieldlabel='cc_maxattempts' value: . + + + + + + [RULE 1j] Invalid fieldentry Assessment metadata for the fieldlabel='cc_profile' value: . + + + + + + + [RULE 1k] The required metadata fields of fieldlabel='cc_profile' is either missing or too many i.e. it has count=. + + + + [RULE 1l] There are repeated assessment metadata fields of fieldlabel='qmd_assessmenttype' with count=. + + + + [RULE 1m] There are repeated assessment metadata fields of fieldlabel='qmd_scoretype' with count=. + + + + [RULE 1n] There are repeated assessment metadata fields of fieldlabel='qmd_feedbackpermitted' with count=. + + + + [RULE 1o] There are repeated assessment metadata fields of fieldlabel='qmd_hintspermitted' with count=. + + + + [RULE 1p] There are repeated assessment metadata fields of fieldlabel='qmd_solutionspermitted' with count=. + + + + [RULE 1q] There are repeated assessment metadata fields of fieldlabel='qmd_timelimit' with count=. + + + + [RULE 1r] There are repeated assessment metadata fields of fieldlabel='cc_allow_late_submission' with count=. + + + + [RULE 1s] There are repeated assessment metadata fields of fieldlabel='cc_maxattempts' with count=. + + + + + + + + + + RULE SET 2: Ensure that only valid metadata is defined in the Itemmetatadata fields + + + + [RULE 2a] Invalid Itemmetadata fieldlabel value: . + + + + + + [RULE 2b] Invalid fieldentry Question Type (fieldlabel='cc_profile') value: . + + + + + + [RULE 2c] Invalid fieldentry Item metadata weighting for the fieldlabel='cc_weighting' i.e. not an integer in the range 1..99, with value: . + + + + + + [RULE 2d] Invalid fieldentry Item metadata for the fieldlabel='qmd_scoringpermitted' with value: . + + + + + + [RULE 2e] Invalid fieldentry Item metadata for the fieldlabel='qmd_computerscored' with value: . + + + + + + + [RULE 2f] The Item metadata field with fieldlabel='cc_profile' is missing. + + + + [RULE 2g] There are too many Item metadata fields with fieldlabel='cc_profile' i.e. count=. + + + + [RULE 2h] There are too many Item metadata fields with fieldlabel='cc_weighting' i.e. count=. + + + + [RULE 2i] There are too many Item metadata fields with fieldlabel='qmd_scoringpermitted' i.e. count=. + + + + [RULE 2j] There are too many Item metadata fields with fieldlabel='qmd_computerscored' i.e. count=. + + + + + + + + + + RULE SET 3: Ensure that the structure of a True/False question is correct + + + + [RULE 3a] Incorrect cardinality attribute value for the T/F question: + + + + [RULE 3b] The invalid 'response_str' element has been used for a T/F question. + + + + [RULE 3c] The invalid 'render_fib' element has been used for a T/F question. + + + + [RULE 3d] There are too many or too few response labels for the T/F question. + + + + [RULE 3e] The T/F response processing Varequal respident attribute + () + value is not equal to the corresonding Response_lid ident + () + attribute for the True/False question. + + + + [RULE 3f] There is an invalid use of the varsubstring element in a T/F question. + + + + + + + + + + RULE SET 4: Ensure that the structure of a MC-SR question is correct + + + + [RULE 4a] Incorrect cardinality attribute value for the MC-SR question: . + + + + [RULE 4b] The invalid 'response_str' element has been used for a MC-SR question. + + + + [RULE 4c] The invalid 'render_fib' element has been used for a MC-SR question. + + + + [RULE 4d] There are too too few response labels for the MC-SR question. + + + + [RULE 4e] The MC-SR response processing Varequal respident attribute + () + value is not equal to the corresonding Response_lid ident + () + attribute for the Multiple Choice single response question. + + + + [RULE 4f] There is an invalid use of the varsubstring element in a MC-SR question. + + + + + + + + + + RULE SET 5: Ensure that the structure of a MC-MR question is correct + + + + + [RULE 5a] Incorrect cardinality attribute value for the MC-MR question: . + + + + [RULE 5b] The invalid 'response_str' element has been used for a MC-MR question. + + + + [RULE 5c] The invalid 'render_fib' element has been used for a MC-MR question. + + + + [RULE 5d] There are too too few response labels for the MC-MR question. + + + + [RULE 5e] The MC-MR response processing Varequal respident attribute + () + value is not equal to the corresonding Response_lid ident + () + attribute for the Multiple Choice multiple response question. + + + + [RULE 5f] There is an invalid use of the varsubstring element in a MC-MR question. + + + + + + + + + + RULE SET 6: Ensure that the structure of a FIB question is correct + + + + + [RULE 6a] The invalid 'response_lid' element has been used for a FIB question. + + + + [RULE 6b] The invalid 'render_choice' element has been used for a FIB question. + + + + [RULE 6c] The FIB response processing Varequal respident attribute + () + value is not equal to the corresonding Response_str ident + () + attribute for the FIB question. + + + + [RULE 6d] There is an invalid use of the 'varsubstring' element in the FIB question. + + + + + + + + + + RULE SET 7: Ensure that the structure of a Pattern Match question is correct + + + + + [RULE 7a] The invalid 'response_lid' element has been used for a Pattern Match question. + + + + [RULE 7b] The invalid 'render_choice' element has been used for a Pattern Match question. + + + + [RULE 7c] The FIB response processing Varequal respident attribute + () + value is not equal to the corresonding Response_str ident + () + attribute for the Pattern Match question. + + + + + + + + + + RULE SET 8: Ensure that the structure of a Essay question is correct + + + + + [RULE 8a] The invalid 'response_lid' element has been used for an Essay question. + + + + [RULE 8b] The invalid 'render_choice' element has been used for an Essay question. + + + + [RULE 8c] There is an invalid use of the 'varequal' element in an Essay question. + + + + [RULE 8d] There is an invalid use of the 'varsubstring' element in an Essay question. + + + + [RULE 8e] Too many Solution feedback structures are supplied. + + + + [RULE 8f] Invalid fieldentry Item metadata for an Essay question with the fieldlabel='qmd_computerscored' with value: . + + + + + + + + + + + + + + RULE SET 10: Ensure that the structure of a Hint in an Item is correct + + + + + [RULE 10a] The displayfeedback@feedbacktype='Solution' has been used to identify a Hint. + + + + [RULE 10b] The itemfeedback@ident='hint' has been used to identify a Solution. + + + + [RULE 10c] The itemfeedback@ident='hint' has been used to identify Response feedback. + + + + + + + [RULE 10d] A displayfeedback[@feedbacktype='Hint'] trigger has no accompanying hint feedback. + + + + + + + + + RULE SET 11: Ensure that the structure of a Solution in an Item is correct + + + + + [RULE 11a] The displayfeedback@feedbacktype='Hint' has been used to identify a Solution. + + + + [RULE 11b] The itemfeedback@ident='solution' has been used to identify a Hint. + + + + [RULE 11c] The itemfeedback@ident='solution' has been used to identify Response feedback. + + + + + + + [RULE 11d] A displayfeedback[@feedbacktype='Solution'] trigger has no accompanying solution feedback. + + + + + + + + + RULE SET 12: Ensure that the structure of the response processing feedback structure in an Item is correct + + + + + [RULE 12a] The displayfeedback@feedbacktype='Response' has been used to identify a Solution. + + + + [RULE 12b] The displayfeedback@feedbacktype='Response' has been used to identify a Hint. + + + + + + + [RULE 12c] For the given displayfeedback identifier () there is no itemfeedback with the correct identifier (). + + + + + + [RULE 12d] For the given response processing itemfeedback identifier () there is no displayfeedback trigger with the correct identifier (). + + + + + + + + + RULE SET 13: Ensure that the generic features of an Item are correct + + + + + [RULE 13a] There are Items that have common identifiers: . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is the container for alternative content. This content is to be + displayed if, for whatever reason, the primary content cannot be + rendered. Alternative language implementations of the host 'material' + element are also supported using this structure. + + + + + + + + + + + + + + + + QTI General + + This defines the set of clauses that can be used within the + logic statements of 'and', 'or' and 'not'. These logic statements + enable the construction of complex conditional tests. + + Common Cartridge Profile + + The extension has been removed. All of the conditions operating + on duration have been removed. The 'or' conditional has been removed + and 'and' and 'not' have been considerably simplified. + + + + + + + + + + + + + + QTI General + + An Assessment object is the logical construction of the test. An Assessment must + contain at least one Section which in turn will contain Items and/or Sections. An + Assessment must eventually be constructed from a set of Items i.e. questions + that are to be offered in the test. An Assessment object contains all of the information + to make the use of individual Items meaningful i.e. apart from the Sections the object + includes the relationships between the Sections, the group evaluation processing and + the corresponding feedback. + + Common Cartridge Profile + + The Assessment must consist of only one Section. The only other permitted attributes + are the mandatory identifier and title. Optional language, metadata, rubric and + presentation_material is also supported. + + + + + + + + + + + + + + + + + QTI General + + The conditional test that is to be applied to the user’s response. + A wide range of separate and combinatorial tests can be applied. + + Common Cartridge Profile + + The extension has been removed. All of the conditions operating + on duration have been removed. The only permited conditions are + 'varequal', 'varsubstring', 'and', 'other'. + + + + + + + + + + + + + + + + This is the container for all of the instructions for the presentation with flow + blocking of the question during a test. This information includes the actual + material to be presented. The labels for the possible responses are also + identified and these are used by the response processing element defined + elsewhere in the Item. + + + + + + + + + + + + + + + + + + This is the blocking/paragraph equivalent to the 'response_label' + structure. This structure shold always be used to encapsulate the + 'response_label construct. + + + + + + + + + + + + + + + This allows the materials to be displayed to the users to be grouped together + using flows. The manner in which these flows are handled is dependent upon + the display-engine. + + + + + + + + + + + + + + + + QTI General + + Contains the hints(s) that are to be revealed to the participant. When these hints are revealed is outside the scope of the + specification. The information can be revealed in several manners. The default mode is to show the 'Complete' hint. + + Common Cartridge Profile + + The material is presented in the form of flow_mat only. The only form of feedback is 'Complete'. + + + + + + + + + + + + + + + + + + This is the information that is presented as a hint. + + + + + + + + + + + + An Item the smallest exchangeable object within QTI-XML. An Item is more than a + ‘Question’ in that it contains the ‘Question’, the presentation/rendering instructions, + the response processing to be applied to the participant’s response(s), the feedback + that may be presented (including hints and solutions) and the meta-data describing + the Item. + + + + + + + + + + + + + + + + + The container for the feedback that is to be presented as a result of the + user’s responses. The feedback can include hints and solutions and + both of these can be revealed in a variety of different ways. + + + + + + + + + + + + + + + + + + + + Contains all of the QTI-specific metada-data + to be applied to the Item. This meta-data can + consist of either entries defined using an + external vocabulary or the individually named + entries. Usage of the contained attributes are + deprecated apart from the 'qtimetadata' attribute. + + + + + + + + + + + This is the container for any content that is to be displayed by the question-engine. + The supported content types are text (emphasised or not), images, audio, video, + application and applet. The content can be internally referenced to avoid the need + for duplicate copies. Alternative information can be defined – this is used if the + primary content cannot be displayed. + + Common Cartridge Profile + + Only the 'mattext', 'matref' and 'matbreak' types are permitted. + + + + + + + + + + + + + + + + + + QTI General + + This defines the set of clauses that can be used within the + logic statements of 'and', 'or' and 'not'. These logic statements + enable the construction of complex conditional tests. + + Common Cartridge Profile + + The extension has been removed. All of the conditions operating + on duration have been removed. The 'or' conditional has been removed + and 'and' and 'not' have been considerably simplified. + + + + + + + + + + + + + + + QTI General + + An object bank is an unordered set of items and sections. It is recommended + that there is a metadata description for the object bank as a whole. The object + bank should have a globally unique identifier. + + Common Cartridge Profile + + In the Common Cartridge the object-bank can only contain Items. Meta-data + support is available but the profile has no mandated entries. + + + + + + + + + + + + + QTI General + + This defines the set of clauses that can be used within the + logic statements of 'and', 'or' and 'not'. These logic statements + enable the construction of complex conditional tests. + + Common Cartridge Profile + + The extension has been removed. All of the conditions operating + on duration have been removed. The 'or' conditional has been removed + and 'and' and 'not' have been considerably simplified. + + + + + + + + + + + + + + Contains all of the variable declarations that are to be + made available to the scoring algorithm. Each variable + is declared using the 'decvar' structure apart from the + default variable called ‘SCORE’ that is an integer and + has a default value of zero (0). + + Common Cartridge Profile + + A single variable is permitted. This is "SCORE". + + + + + + + + + + + Contains all of the instructions for the presentation of the question + during an evaluation. This information includes the actual material + to be presented. The labels for the possible responses are also + identified and these are used by the response processing element + defined elsewhere in the Item. + + + + + + + + + + + + + + + + + + + + + + + + This is the information that is to be presented to set the context for the + contained objects. This can be used to contain question-based material + that is common to all of the child objects. This is used in Assessment and + Section objects. + + + This is the information that is used to describe the solution. + + + + + + + + + + + QTI General + + The QTI-specific meta-data assigned to the parent object i.e. + Assessment, Section, Item or Object-bank. This approach + requires that the approriate external vocabulary is defined and + referenced in label/field tuple. + + Common Cartridge Profile + + The Vocabulary structure has been removed. + + + + + + + + + + + The structure responsible for containing each of + the QTI-specific meta-data fields. The label should + appear in the vocabulary. If no vocabulary is used + then external validation cannot take place. + + + + + + + + + + + + + The root structure can consist of either: + + * A single object bank; + * An assessment; + * A set of item(s); + * A set of section(s); + * Any combination of items and sections. + + As the root this is mandatory and can + occur once. + + Common Cartridge Profile + + A Commn Cartridge is allowed to contain + only an objectbank or an assessement. + + + + + + + + + + + + + + Contains the instructions for the question-engine to render the question + using a classical multiple choice format. The number of possible responses + is determined by the 'response_label' structures contained. Both flowed and + non-flowed formats are supported + + + + + + + + + + + + + + + + + + + + + + + + + + Contains the instructions for the question-engine to render the question + using a classical fill-in blank format. The number of possible responses + is determined by the 'response_label' structures contained. Both flowed + and non-flowed formats are supported. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Contains the actual test to be applied to the user responses + to determine their correctness or otherwise. Each 'respcondition' + contains an actual test, the assignment of a value to the associate + scoring variables and the identification of the feedback to be + associated with the test. + + + + + + + + + + + + + + + + + + + + + + This contains the possible response choices that are presented + to the user. This information includes the material to be shown + to the user and the logical label that is associated with that + response. The label is used in the response processing. Flow + and non-flow approaches are supported. + + + + + + + + + + + + + + + + + + + + + + + + + + + QTI General + + This contains the instructions for the presentation of questions whose response will be either a 'response_lid' (logical identifier), + 'response_xy' (xy-co-ordinate), 'response_str' (a string), 'response_num' (a number) and 'response_grp' ( a group of logical + identifiers). The question can be rendered in a variety of ways depending on the way in which the material is to be presented to the + participant. + + Common Cartridge Profile + + Only the response_lid and response_str response types are supported with render_choice and render_fib rendering. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + QTI General + + This contains the instructions for the presentation of questions whose response will be either a 'response_lid' (logical identifier), + 'response_xy' (xy-co-ordinate), 'response_str' (a string), 'response_num' (a number) and 'response_grp' ( a group of logical + identifiers). The question can be rendered in a variety of ways depending on the way in which the material is to be presented to the + participant. + + Common Cartridge Profile + + Only the response_lid and response_str response types are supported with render_choice and render_fib rendering. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This contains all of the instructions for the response + processing. This includes the scoring variables to contain + the associated scores and the set of response condition + tests that are to be applied to the received user response. + + + + + + + + + + + + + + This is used to contain contextual information i.e. rubric that + is important to the object e.g. it could contain standard data + values that might or might not be useful for answering the + question. + + Common Cartridge Profile + + This is used in assessments to provide instructions. Only a + single mattext is permitted in the material. + + + + + + + + + + + QTI General + + A Section is the core grouping concept within QTI. A Section consists of one or more Items or Sections (or + references to Items and Sections). In general, the objects contained within a Secton will have some relationship + either in terms of content or content delivery. The Section data structure is used to define arbitrarily complex + hierarchical section and item data structures. It may contain meta-data, objectives, rubric control switches, + assessment-level processing, feedback and selection and sequencing information for sections and items. + + Common Cartridge Profile + + In Common Cartridge the Section can only contain a list of Items. No metadata is permitted. The identifier is + mandatory but the title and language are optional. + + + + + + + + + + + + + + + QTI General + + Contains the solution(s) that are to be revealed to the participant. When these solutions are revealed is outside the scope of the + specification. The information can be revealed in several manners. The default mode is to show the 'Complete' solution. + + Common Cartridge Profile + + The material is presented in the form of flow_mat only. The only form of feedback is 'Complete'. + + + + + + + + + + + + + + + + + + This is the information that is used to describe the solution. + + + + + + + + + + + + This is the container of any text that is to be displayed to the users. + It is the base type for normal and emphasised text. + + + + + + + + + + + + + + + + + + + + + + This is used to contain a reference to the required full material block. This + material will have had an identifier assigned to enable such a reference to + be reconciled when the instance is parsed into the system. + + + + + + + + + + + + + This is used to contain a reference to the required full material block. This + material will have had an identifier assigned to enable such a reference to + be reconciled when the instance is parsed into the system. + + + + + + + + + + + + + QTI General + + This is used for the declaration of the scoring variables. + The name of the variable that is to be declared. The default + name is ‘SCORE’. All numeric variables have the associated + ‘x.min’, ‘x.max’ and ‘x.normalised’ variables declared. + Several of the optional attributes depend upon the type of + variable that is declared. + + Common Cartridge Profile + + Only the variable types of decimal and integer are permitted. + Only a single "SCORE" variable is permitted. + + + + + + + + + + + + + + + + + + + + + + + QTI General + + This is responsible for changing the value of the scoring + variable as a result of the associated response processing test. + The default action is to 'Set' the 'SCORE' variable to the value + given in the string. + + Common Cartridge Profile + + Only the actons Set, Add and Subtract are premitted. + + + + + + + + + + + + + + + + + + + + This is the test of equivalence. The data for the test is + contained as a string. The accompanying attributes are + the identifier for the associated 'response_label', the + ordinal 'index' of the response and whether or not the + value is case-sensitive when processing strings. + + + + + + + + + + + + + + + + + + + + + This is used for assigning an associated feedback to the + aggregated scoring if the ‘True’ state results. Feedback + for hints, solutions and response processing are supported. + The feedback is identified using the pointer 'linkrefid'. + + + + + + + + + + + + + + + + + + + + + + This is the test for a contained substring. + The data for comparison is presented as a + string. The associated attributes are the + response label identifier, the ordinal index of + the response and whether or not the value is + case-sensitive when processing the strings. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: samigo-api/src/java/xml/xsl/dataTransform/import/v1p2/extractEMIItem.xsl =================================================================== --- samigo-api/src/java/xml/xsl/dataTransform/import/v1p2/extractEMIItem.xsl (revision 0) +++ samigo-api/src/java/xml/xsl/dataTransform/import/v1p2/extractEMIItem.xsl (working copy) @@ -0,0 +1,87 @@ + + + + + + + + + + + <xsl:value-of select="//item/@title" /> + + + + + + []() + + + + + []() + + + + + []() + + + + + []() + + + + + [] + + + + + + + + + + [|] + @ATTACH@ + + @[]() + + + @[]() + + + @[]() + + + @[]() + + @ANSWERS@ + + [](|) + + + + + + + Index: samigo-api/src/java/xml/xsl/dataTransform/import/v1p2/extractItem.xsl =================================================================== --- samigo-api/src/java/xml/xsl/dataTransform/import/v1p2/extractItem.xsl (revision 133459) +++ samigo-api/src/java/xml/xsl/dataTransform/import/v1p2/extractItem.xsl (working copy) @@ -13,6 +13,7 @@ + <xsl:value-of select="//item/@title" /> @@ -20,6 +21,7 @@ + Index: samigo-app/pom.xml =================================================================== --- samigo-app/pom.xml (revision 133459) +++ samigo-app/pom.xml (working copy) @@ -127,6 +127,7 @@ javax.servlet.jsp jsp-api + provided javax.servlet @@ -179,6 +180,7 @@ org.springframework spring-webmvc + runtime struts Index: samigo-app/src/java/org/sakaiproject/jsf/renderer/RichTextEditArea.java =================================================================== --- samigo-app/src/java/org/sakaiproject/jsf/renderer/RichTextEditArea.java (revision 133459) +++ samigo-app/src/java/org/sakaiproject/jsf/renderer/RichTextEditArea.java (working copy) @@ -37,7 +37,6 @@ import org.sakaiproject.component.cover.ServerConfigurationService; import org.sakaiproject.tool.assessment.services.assessment.AssessmentService; -import org.sakaiproject.tool.assessment.ui.listener.util.ContextUtil; import org.sakaiproject.tool.assessment.util.TextFormat; import org.sakaiproject.tool.cover.ToolManager; import org.sakaiproject.util.EditorConfiguration; @@ -88,6 +87,7 @@ ResponseWriter writer = context.getResponseWriter(); Object value = null; + String identity = (String) component.getAttributes().get("identity"); String reset = (String) component.getAttributes().get("reset"); if (reset == null || !reset.equals("true")) { if (component instanceof UIInput) @@ -180,18 +180,18 @@ String justArea = (String) component.getAttributes().get("justArea"); if (editor.equalsIgnoreCase("FCKeditor") || editor.equalsIgnoreCase("ckeditor")) { - encodeFCK(writer, contextPath, (String) value, outCol, + encodeFCK(writer, contextPath, (String) value, identity, outCol, outRow, justArea, clientId, valueHasRichText, hasToggle); } else { - encodeHtmlarea(writer, contextPath, (String) value, outCol + "px", outRow + "px", + encodeHtmlarea(writer, contextPath, (String) value, identity, outCol + "px", outRow + "px", tmpCol, tmpRow, lineOfToolBar, justArea, clientId); } } - private void encodeHtmlarea(ResponseWriter writer, String contextPath, String value, String outCol, + private void encodeHtmlarea(ResponseWriter writer, String contextPath, String value, String identity, String outCol, String outRow, String tmpCol, String tmpRow, int lineOfToolBar, String justArea, String clientId) throws IOException { @@ -212,7 +212,9 @@ writer.write(clientId); writer.write("_textinput\" id=\""); writer.write(clientId); - writer.write("_textinput\" disabled>"); + writer.write("_textinput\" "); + writer.write(getIdentityAttribute(identity)); + writer.write("disabled>"); writer.write( (String) value); writer.write("\n"); if ( (tmpCol != null) && (tmpRow != null)) @@ -286,7 +288,8 @@ writer.write(clientId); writer.write("_textinput\" id=\""); writer.write(clientId); - writer.write("_textinput\""); + writer.write("_textinput\" "); + writer.write(getIdentityAttribute(identity)); writer.write(">\n"); if (lineOfToolBar == 3) @@ -344,7 +347,9 @@ writer.write(clientId); writer.write("_textinput\" id=\""); writer.write(clientId); - writer.write("_textinput\">"); + writer.write("_textinput\" "); + writer.write(getIdentityAttribute(identity)); + writer.write(">"); writer.write( (String) value); writer.write("\n"); if (lineOfToolBar == 3) @@ -401,7 +406,7 @@ } - private void encodeFCK(ResponseWriter writer, String contextPath, String value, String outCol, + private void encodeFCK(ResponseWriter writer, String contextPath, String value, String identity, String outCol, String outRow, String justArea, String clientId, boolean valueHasRichText, String hasToggle) throws IOException { //come up w/ rows/cols for the textarea if needed @@ -429,7 +434,7 @@ value = FormattedText.escapeHtmlFormattedTextarea((String) value); } - writer.write(""); if (shouldToggle) { @@ -664,4 +669,15 @@ org.sakaiproject.jsf.component.RichTextEditArea comp = (org.sakaiproject.jsf.component.RichTextEditArea) component; comp.setSubmittedValue(finalValue); } + + private String getIdentityAttribute(String identity){ + if(identity != null){ + StringBuilder buf = new StringBuilder(" identity=\""); + buf.append(identity); + buf.append("\" "); + return buf.toString(); + }else{ + return " "; + } + } } Index: samigo-app/src/java/org/sakaiproject/jsf/tag/RichTextEditArea.java =================================================================== --- samigo-app/src/java/org/sakaiproject/jsf/tag/RichTextEditArea.java (revision 133459) +++ samigo-app/src/java/org/sakaiproject/jsf/tag/RichTextEditArea.java (working copy) @@ -29,6 +29,7 @@ public class RichTextEditArea extends UIComponentTag { + private String identity; private String value; private String columns; private String rows; @@ -36,6 +37,16 @@ private String hasToggle; private String reset; + public void setIdentity(String newIdentity) + { + identity = newIdentity; + } + + public String getIdentity() + { + return identity; + } + public void setValue(String newValue) { value = newValue; @@ -109,6 +120,7 @@ protected void setProperties(UIComponent component) { super.setProperties(component); + setString(component, "identity", identity); setString(component, "value", value); setString(component, "columns", columns); setString(component, "rows", rows); @@ -120,6 +132,7 @@ public void release() { super.release(); + identity = null; value = null; columns = null; rows = null; Index: samigo-app/src/java/org/sakaiproject/jsf/util/SamigoJsfTool.java =================================================================== --- samigo-app/src/java/org/sakaiproject/jsf/util/SamigoJsfTool.java (revision 133459) +++ samigo-app/src/java/org/sakaiproject/jsf/util/SamigoJsfTool.java (working copy) @@ -42,10 +42,12 @@ import org.sakaiproject.tool.cover.ToolManager; import org.sakaiproject.util.Web; import org.sakaiproject.tool.assessment.data.ifc.assessment.AssessmentIfc; +import org.sakaiproject.tool.assessment.data.ifc.assessment.ItemTextAttachmentIfc; import org.sakaiproject.tool.assessment.facade.AssessmentFacade; import org.sakaiproject.tool.assessment.services.assessment.AssessmentService; import org.sakaiproject.tool.assessment.services.assessment.PublishedAssessmentService; import org.sakaiproject.tool.assessment.ui.listener.util.ContextUtil; +import org.sakaiproject.tool.assessment.ui.bean.author.AnswerBean; import org.sakaiproject.tool.assessment.ui.bean.author.AssessmentSettingsBean; import org.sakaiproject.tool.assessment.ui.bean.author.AssessmentBean; import org.sakaiproject.tool.assessment.ui.bean.author.AuthorBean; @@ -243,7 +245,15 @@ && ("true").equals(toolSession.getAttribute("SENT_TO_FILEPICKER_HELPER"))){ ItemAuthorBean bean = (ItemAuthorBean) ContextUtil.lookupBeanFromExternalServlet( "itemauthor", req, res); - bean.setItemAttachment(); + + // For EMI Item Attachments + AnswerBean emiQAComboItem = bean.getCurrentAnswer(); + if (emiQAComboItem == null) { + bean.setItemAttachment(); + } + else { + emiQAComboItem.setItemTextAttachment(); + } toolSession.removeAttribute("SENT_TO_FILEPICKER_HELPER"); } Index: samigo-app/src/java/org/sakaiproject/tool/assessment/bundle/AuthorMessages.properties =================================================================== --- samigo-app/src/java/org/sakaiproject/tool/assessment/bundle/AuthorMessages.properties (revision 133459) +++ samigo-app/src/java/org/sakaiproject/tool/assessment/bundle/AuthorMessages.properties (working copy) @@ -8,8 +8,11 @@ add_matches= Add Matches: add_more_answer_sect=Add more answer section:-- add_more_answer_sects=Add more answer sections:-- +add_more_options=Add more options +add_more_items=Add more items addr=Addresses: admin=Admin +all=all button_back=Back all_user_input_saved=All user input saved automatically. allow_only_specified=Allow only specified IP @@ -18,8 +21,14 @@ anonymous_grading_on=Anonymous Grading Only another_p=Another Part answer=Answer +answer_options_rich=Enter option text and/or Add Attachments below +answer_options=Enter options individually +answer_options_paste=Paste a list (one option per line, no bullets) +answer_options_populate=Populate answer options +answer_options_count=Number of options in this question (e.g. A to G = 7) +required_options_count=Number of required answers +answers_required=answer(s) required answer_point_value=Answer Point Value -answer_point_value=Answer Point Value answer_provide_a_mo=Answer: Provide a model answer to show students and to assist graders along with any feedback. answer_text_predefi=Answer Text: Predefined set of scales for survey reporting. answers=Answers @@ -48,6 +57,7 @@ but_remember=but remember button_add=Add copy_to_pool=Copy to Pool +button_save=Save button_save_pair=Save Pairing button_close=Close button_save_pub=Save and Publish Assessment @@ -153,9 +163,12 @@ copy_all_to_pool=Copy All Questions to Pool correct_answer=Correct Answer correct_answer_opti=Correct Answer (optional) +correct_options=Correct Options correct_incorrect_an=Correct/Incorrect Answer Feedback correct_match_feedback_opt=Correct Match Feedback(optional) incorrect_match_feedback_opt=Incorrect Match Feedback(optional) +correct_option_labels=Correct Option Labels (e.g. A or ABC) +correct_response=Correct Response create_modify_a=Add/Edit Assessment create_modify_p=Add/Edit Part create_pairing=Add/Edit Pairing and Optional Feedback @@ -169,8 +182,10 @@ each_p_is_on_a_se=Each Part is on a separate Web page. each_q_is_on=Each question is on a separate Web page. editor=Editor +example_emi_question=The parts of an Extended Matching Items question existing_qs=Existing Questions existing_q=Existing Question +extended_matching_items=Extended Matching Items false_msg=False feedback_will_be_dis=Feedback will be displayed to the student at a specified date file_upload=File Upload @@ -201,6 +216,8 @@ incorrect_answer_op=Incorrect Answer (optional) ins_new_q=Insert New Question insert_additional_a=Insert Additional Answers +insert_additional_q_a_combos=Insert Additional Items +insert_additional_answer_options=Insert Additional Answer Options insert_p=Insert Part insert_q=Insert Question item=Item @@ -213,6 +230,12 @@ late_submissions_wil=Late Submissions will be accepted and will be tagged late during grading. linear_access_to_que=Linear Access to questions with NO return to previous pages.
      There are only NEXT buttons only to go forward.
      There is NO Table of Contents page.
match=Match +lead_in_statement=Lead In +default_lead_in_statement_description=The following default text will be used unless you click on this box and enter your own.
\ +
\ +Default text:
\ + +default_lead_in_statement=For each of the items below, select the most appropriate answer option(s) above. Each answer option may be used once, more than once, or not at all. matching=Matching matching_choice_col=Choice matching_match_col=Match @@ -236,6 +259,9 @@ no_feedback_will_be=NO Feedback will be displayed to the student. no_toc= There is NO Table of Contents page. none=none +note_emi_correct_options=Place correct options for each item in square brackets ([]) at the end of the item text. +note_emi_separate=Separate these with commas (,) if there are more than one correct options. +note_emi_example=For example: Which of the listed bones are found in the arm? [a,d,e] note_p_headers_w=NOTE: Part headers with the title "Default" will not be visible to assessment takers. note_point_value_for_question=Answer Point Value is a required field. Please enter a positive value note_place_curly=NOTE: Place curly braces ({}) around words requiring a blank. @@ -293,8 +319,11 @@ q_text=Question Text qs=Questions question=Question +question_answer_combinations=Items Stems question_text=Question Text -random_access_to_que=Random access to questions from a Table of Contents.
There are NEXT and PREV buttons on each page for navigation. +question_theme_text=Theme +random_access_to_que=Random access to questions from a Table of Contents.
\ +There are NEXT and PREV buttons on each page for navigation. random_draw_from_que=Random draw from question pool random_within_p=Random within Part randomize_answers=Randomize Answers @@ -321,6 +350,8 @@ secondary_id_and_pass=Secondary ID and Password select=[Select] select_menu=select +select_appropriate_format=Select the appropriate format +options_text=Options select_a_pool_name=Select a pool name (optional) select_a_pool_for_random_draw=Select a question pool select_num_questions=(###) @@ -551,6 +582,8 @@ t_assessment=Assessment t_question=Question t_removeC=Remove Choice +t_removeO=Remove Option +t_removeI=Remove Item # add attachments to questions attachments = Attachments @@ -582,6 +615,31 @@ reset_score_values=Reset Score Values enter_new_pc_value=Enter new value (optional) +# error messages for EMI questions (used in Javascript validation) +answer_point_value_error=A valid answer point value has not been entered. +theme_text_error=Theme text has not been entered. +simple_text_options_blank_error=Some simple text options are left blank - Please enter option text or remove options before saving. +number_of_rich_text_options_error=Number of rich text options not selected. +missing_or_invalid_answer_options_labels_error=Missing or invalid answer option labels +rich_text_options_error=Rich text answer options text or attachment required +at_least_two_options_required_error=At least 2 options required +at_least_two_pasted_options_required_error=At least 2 pasted options required +blank_or_non_integer_item_sequence_error=Blank or non-integer item sequence encountered for item: +correct_option_labels_error=Correct option labels blank or contain other than alpha characters and commas for item: +correct_option_labels_invalid_error=Invalid option in correct option labels for item: +item_text_not_entered_error=Item text or attachment not entered for item: +simple_text_option_label=Simple text - for a list of items with no formatting +simple_text_paste_label=Simple text - for pasting options +rich_text_option_label=Rich text / Attachments - for styled text, tables, labelled images + +#message parameters: +#0: user input +#1: question number +#2: sequence number +#3: valid options +please_select_from_available=Question {1} has an invalid answer, ['{0}']. Only the following letters of the alphabet are acceptable: {3} +duplicate_responses=Duplicate responses: + # MC what's this link mc_whats_this_main_text=The grading logic of multiple choice questions depends on the option you select. mcsc_whats_this_text=This is the default option because it's the most common: students get the full point value for selecting a single correct answer and zero points for selecting anything else. This option can be further modified by selecting Enable Partial Credit or Enable Negative Marking. @@ -623,6 +681,19 @@ less_than_two_columns=columns field need to have at least two inputs, separated by "Return" key selectFromFavorites=Select from Favorites +emi_pt=Item Points +emi_whats_this=? +emi_whats_answer_point_title=Answer Point +emi_whats_answer_point=Points are given per item. The overall point score for the question is automatically calculated from the sum of the item points. +emi_whats_theme_title=Theme +emi_whats_theme=The theme describes the main topic/domain that the item set will address, and is linked to the learning objectives. A more generic theme (such as "Diarrhoea") may be used for sampling knowledge over wider fields, and items in that set may include pharmacology, epidemiology and investigations. A more focussed theme (such as "Management of diarrhoea") is used to sample in-depth knowledge, in this case all related to pharmacology. +emi_whats_options_title=Options +emi_whats_options=The options list consists of the potential answer choices to the item, and includes the distracters that are the incorrect or less likely answers for this particular item. The options should be homogenous, or "the same kind of thing" such as drugs, organisms, cells or investigations, and should be listed only as words or short phrases. Options that are unnecessarily complicated (combinations of options) or "all/none of the above" are not allowed. +emi_whats_leadin_title=Lead In +emi_whats_leadin=The lead-in statement specifies the association between the stem and the option list. In the R-type format, the options list (for example, 8 or more potential diagnoses) is summarized in the lead-in statement, for example, "For each of the following patients presenting to the Emergency Room, select the most likely diagnosis." The lead-in should provide clear instructions how the student should respond to the item set. +emi_whats_items_title=Item Stems +emi_whats_items=The stem or item describes the case and what is required from the student. It usually consists of a clinical scenario and a question, for example "A 30yr old man presents with... Select the most likely diagnoses." In the R-type format, the question may be included in the stem or may be situated in the lead-in statement. + character_count=Character count: character_limit=200 character limit Index: samigo-app/src/java/org/sakaiproject/tool/assessment/bundle/EvaluationMessages.properties =================================================================== --- samigo-app/src/java/org/sakaiproject/tool/assessment/bundle/EvaluationMessages.properties (revision 133459) +++ samigo-app/src/java/org/sakaiproject/tool/assessment/bundle/EvaluationMessages.properties (working copy) @@ -135,6 +135,7 @@ retake_confirmation_2=to submit one more time? export_msg=Click Export to export and download all assessment responses in Excel format. assessment=Assessment +item=Item rationale=Rationale comments_for_student=Comments for Student grader_comments=Grader's comments @@ -184,6 +185,7 @@ q_fin=Numeric Response q_mult_surv=Multiple Choice Survey q_match=Matching +q_emi=Extended Matching Items q_short_ess=Short Answer/Essay q_tf=True/False Question q_matrix_choices_surv=Survey: Matrix of Choices Index: samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/author/AnswerBean.java =================================================================== --- samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/author/AnswerBean.java (revision 133459) +++ samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/author/AnswerBean.java (working copy) @@ -23,18 +23,44 @@ package org.sakaiproject.tool.assessment.ui.bean.author; import java.io.Serializable; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.sakaiproject.util.ResourceLoader; + +import org.sakaiproject.content.api.ContentResource; +import org.sakaiproject.content.api.FilePickerHelper; +import org.sakaiproject.entity.api.Reference; +import org.sakaiproject.entity.cover.EntityManager; +import org.sakaiproject.exception.IdUnusedException; +import org.sakaiproject.exception.PermissionException; +import org.sakaiproject.exception.TypeException; +import org.sakaiproject.tool.api.ToolSession; +import org.sakaiproject.tool.assessment.data.ifc.assessment.AttachmentIfc; +import org.sakaiproject.tool.assessment.data.ifc.assessment.ItemTextAttachmentIfc; +import org.sakaiproject.tool.assessment.data.ifc.assessment.ItemDataIfc; +import org.sakaiproject.tool.assessment.data.ifc.assessment.ItemTextIfc; +import org.sakaiproject.tool.assessment.services.ItemService; +import org.sakaiproject.tool.assessment.services.PublishedItemService; +import org.sakaiproject.tool.assessment.services.assessment.AssessmentService; import org.sakaiproject.tool.assessment.ui.listener.util.ContextUtil; -import org.sakaiproject.util.ResourceLoader; +import org.sakaiproject.tool.cover.SessionManager; + import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext; import javax.faces.component.UIComponent; import javax.faces.component.UIInput; -import javax.print.attribute.standard.Severity; +import javax.faces.context.ExternalContext; import org.sakaiproject.tool.assessment.jsf.convert.AnswerSurveyConverter; -public class AnswerBean implements Serializable{ - +@SuppressWarnings("deprecation") +public class AnswerBean implements Serializable, Comparable{ private static final long serialVersionUID = 7526471155622776147L; private String text; @@ -42,6 +68,21 @@ private String label; private String feedback; private Boolean isCorrect; + + // for EMI questions + private String correctOptionLabels; + // for EMI questions + private String requiredOptionsCount; + //for EMI questions + private Double score = new Double(0.0); + // Whether the user set the score or it was auto set + private Boolean scoreUserSet = Boolean.FALSE; + //Attachments for EMI questions + private List attachmentList; + //for navigation + private String outcome; + + private static Log log = LogFactory.getLog(AnswerBean.class); private String partialCredit = "0"; //to incorporate partial credit private static ResourceLoader rb = new ResourceLoader("org.sakaiproject.tool.assessment.bundle.AuthorMessages"); @@ -54,7 +95,7 @@ this.label = plabel; this.feedback= pfdbk; this.isCorrect = pcorr; - + this.score = pscore; } public String getText() { @@ -114,6 +155,40 @@ this.partialCredit = pCredit; } + public int compareTo(Object o) { + if (o==null || getSequence()==null || ((AnswerBean)o).getSequence()==null) { + return -1; + } + else { + return getSequence().compareTo(((AnswerBean)o).getSequence()); + } + } + + // for EMI questions + public String getCorrectOptionLabels() { + return correctOptionLabels; + } + + // for EMI questions + public void setCorrectOptionLabels(String correctOptionLabels) { + if (correctOptionLabels != null) correctOptionLabels = correctOptionLabels.trim().toUpperCase(); + String optionLabel = null; + String temp = ""; + // remove white space and delimiter characters + for (int i=0; i0) + return true; + else + return false; + } + + // Attachments at Answer Level + public void setHasAttachment(boolean hasAttachment) { + // Do nothing - required by jsf + } + + public String getOutcome() + { + return outcome; + } + + /** + * set the survey scale + * @param param + */ + public void setOutcome(String param) + { + this.outcome= param; + } + + // for EMI - Attachments at Answer Level + public String addAttachmentsRedirect() { + ItemAuthorBean itemAuthorBean = (ItemAuthorBean) ContextUtil.lookupBean("itemauthor"); + itemAuthorBean.setCurrentAnswer(this); + ToolSession currentToolSession = SessionManager.getCurrentToolSession(); + + // 1. load resources into session for resources mgmt page + // then redirect to resources mgmt page + try { + List filePickerList = prepareAttachmentReferenceList(this.getAttachmentList()); + currentToolSession.setAttribute( + FilePickerHelper.FILE_PICKER_ATTACHMENTS, filePickerList); + ExternalContext context = FacesContext.getCurrentInstance() + .getExternalContext(); + context.redirect("sakai.filepicker.helper/tool"); + } catch (Exception e) { + log.error("fail to redirect to attachment page: " + e.getMessage()); + } + + return getOutcome(); + } + + // For EMI Item Attachments + /* called by SamigoJsfTool.java on exit from file picker */ + public void setItemTextAttachment(){ + AuthorBean author = (AuthorBean) ContextUtil.lookupBean("author"); + boolean isEditPendingAssessmentFlow = author.getIsEditPendingAssessmentFlow(); + ItemService service = null; + if (isEditPendingAssessmentFlow) { + service = new ItemService(); + } + else { + service = new PublishedItemService(); + } + ItemDataIfc itemData = null; + ItemTextIfc itemText = null; + ItemAuthorBean itemauthorbean = (ItemAuthorBean) ContextUtil.lookupBean("itemauthor"); + // itemId == null => new questiion + if (itemauthorbean.getItemId()!=null){ + try{ + itemData = service.getItem(itemauthorbean.getItemId()); + itemText =itemData.getItemTextBySequence(getSequence()); + } + catch(Exception e){ + log.warn(e.getMessage()); + } + } + + // list returns contains modified list of attachments, i.e. new + // and old attachments. This list will be + // persisted to DB if user hit Save on the Item Modifying page. + List list = prepareItemTextAttachment(itemText, isEditPendingAssessmentFlow); + setAttachmentList(list); + } + + // For EMI Item Attachments + private List prepareAttachmentReferenceList(List attachmentList){ + List list = new ArrayList(); + if (attachmentList == null){ + return list; + } + for (int i=0; i sectionSet = assessbean.getSections(); + Iterator iter = sectionSet.iterator(); int i =0; while (iter.hasNext()){ i = i + 1; - SectionContentsBean part = (SectionContentsBean) iter.next(); + SectionContentsBean part = iter.next(); SelectItem selection = new SelectItem(); // need to filter out all the random draw parts @@ -771,12 +777,12 @@ "org.sakaiproject.tool.assessment.bundle.AuthorMessages"); AssessmentBean assessbean = (AssessmentBean) ContextUtil .lookupBean("assessmentBean"); - ArrayList sectionSet = assessbean.getSections(); - Iterator iter = sectionSet.iterator(); + List sectionSet = assessbean.getSections(); + Iterator iter = sectionSet.iterator(); int i = 0; while (iter.hasNext()) { i = i + 1; - SectionContentsBean part = (SectionContentsBean) iter.next(); + SectionContentsBean part = iter.next(); // need to filter out all the random draw parts if (part.getSectionAuthorType().equals( @@ -1111,6 +1117,10 @@ public String addAttachmentsRedirect() { // 1. load resources into session for resources mgmt page // then redirect to resources mgmt page + + // not EMI item (ItemText) attachment + setCurrentAnswer(null); + try { prepareMCcorrAnswers(); List filePickerList = prepareReferenceList(attachmentList); @@ -1124,7 +1134,7 @@ } return getOutcome(); } - + /* called by SamigoJsfTool.java on exit from file picker */ public void setItemAttachment(){ AuthorBean author = (AuthorBean) ContextUtil.lookupBean("author"); @@ -1289,4 +1299,11 @@ } } + public AnswerBean getCurrentAnswer() { + return currentAnswer; + } + + public void setCurrentAnswer(AnswerBean currentAnswer) { + this.currentAnswer = currentAnswer; + } } Index: samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/author/ItemBean.java =================================================================== --- samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/author/ItemBean.java (revision 133459) +++ samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/author/ItemBean.java (working copy) @@ -26,21 +26,22 @@ import java.io.Serializable; import java.util.ArrayList; +import java.util.Collections; import java.util.HashSet; import java.util.Iterator; +import java.util.List; import java.util.Set; import java.util.StringTokenizer; -import java.util.List; import org.sakaiproject.util.ResourceLoader; import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext; -import javax.faces.event.AbortProcessingException; import javax.faces.event.ValueChangeEvent; import javax.faces.model.SelectItem; import javax.faces.model.SelectItemGroup; +import org.sakaiproject.tool.assessment.data.ifc.assessment.ItemDataIfc; import org.sakaiproject.component.cover.ServerConfigurationService; import org.sakaiproject.tool.assessment.facade.TypeFacade; import org.sakaiproject.tool.assessment.facade.AgentFacade; @@ -80,6 +81,20 @@ private String corrAnswer; // store text value for single correct answer, as in true/false , mcsc, also used for essay's model answer private ArrayList multipleChoiceAnswers; // store List of answers multiple choice items, ArrayList of AnswerBean private String additionalChoices = "0"; // additonal multiple choice answers to be add. for the select menu + private List emiAnswerOptions; // ArrayList of AnswerBean - store List of possible options for an EMI question's anwers + private String additionalEmiAnswerOptions = "3"; //Additonal options for an EMI question's answers - Jul 2010 forced to 3, no longer selected from a list + private String leadInStatement; + private ArrayList emiQuestionAnswerCombinations; //ArrayList of AnswerBean - store List of possible options for an EMI question's anwers + private String additionalEmiQuestionAnswerCombinations = "3"; // additonal options for an EMI question's answers - Jul 2010 forced to 3, no longer selected from a list + private String emiVisibleItems = "0"; //The number of visible EMI items + private String emiAnswerOptionsRich; + private String emiAnswerOptionsPaste; + private String answerOptionsRichCount = "0"; + private String answerOptionsSimpleOrRich = ItemDataIfc.ANSWER_OPTIONS_SIMPLE.toString(); + + public static final int DEFAULT_MAX_NUMBER_EMI_OPTIONS_FOR_UI = 26; + public static final int DEFAULT_MAX_NUMBER_EMI_ITEMS_FOR_UI = 60; //Twice the actual number to allow for javascript add/delete + private int totalMCAsnwers; private CalculatedQuestionBean calculatedQuestion; @@ -167,14 +182,17 @@ { return outcome; } + public void setOutcome(String outcome) { this.outcome=outcome; } + public String getPoolOutcome() { return poolOutcome; } + public void setPoolOutcome(String poolOutcome) { this.poolOutcome=poolOutcome; @@ -198,6 +216,7 @@ { return itemType; } + public void setItemType(String param) { this.itemType= param; @@ -208,6 +227,7 @@ { return itemText; } + public void setItemText(String itemText) { this.itemText = itemText; @@ -321,6 +341,7 @@ { return corrAnswer; } + /** * set correct answer for True/False * @param answers ordered array of correct answers @@ -462,6 +483,7 @@ { this.choiceCorrectArray[n] = correctChoice; } + /** * for audio recording * @return maximum time for recording @@ -470,6 +492,7 @@ { return maxRecordingTime; } + /** * for audio recording * @param maxRecordingTime maximum time for recording @@ -478,6 +501,7 @@ { this.maxRecordingTime = maxRecordingTime; } + /** * for audio recording * @return maximum attempts @@ -627,6 +651,7 @@ { return timeAllowed; } + public void setTimeAllowed(String param) { this.timeAllowed= param; @@ -636,6 +661,7 @@ { return numAttempts; } + public void setNumAttempts(String param) { this.numAttempts= param; @@ -769,6 +795,7 @@ public String getInstruction() { return instruction; } + public void setInstruction(String param) { this.instruction= param; } @@ -994,7 +1021,6 @@ */ public void setOrigSection(String param) { this.origSection= param; - } public ArrayList getMultipleChoiceAnswers() { @@ -1036,33 +1062,7 @@ } } -/* -// this doesn't seem to be used - public void addChoices(ValueChangeEvent event) { - // build a default list of 4 choices, a, b, c, d, - FacesContext context = FacesContext.getCurrentInstance(); - String newvalue = (String) event.getNewValue(); - ArrayList list = getMultipleChoiceAnswers(); // get existing list - if (list!=null) { - // add additional answer bean - int currentsize = list.size(); - int newlength = currentsize+ new Integer(newvalue).intValue(); - for (int i=currentsize; i list) + { + this.emiAnswerOptions= list; + } + + // Modified for Javascript Add/Remove + public List getEmiAnswerOptions() { + if (emiAnswerOptions==null) { + emiAnswerOptions = new ArrayList(); + } + int defaultlength = DEFAULT_MAX_NUMBER_EMI_OPTIONS_FOR_UI; + // build or extend the list of items 26 a-z + // for efficiency, these will now be shown/hidden using javascript + if (emiAnswerOptions.size() < defaultlength) { + List list = new ArrayList(); + list.addAll(emiAnswerOptions); + for (int i=emiAnswerOptions.size(); i getEmiAnswerOptionsClean() { + List list = new ArrayList(); + if (emiAnswerOptions!=null) { + list.addAll(emiAnswerOptions); + } + for (int i=list.size()-1; i>=0; i--) { + AnswerBean answerbean = (AnswerBean)list.get(i); + if (answerbean.getText() == null || answerbean.getText().trim().equals("")) { + list.remove(i); + } + else { + break; + } + } + emiAnswerOptions = list; + return list; + } + public boolean isPartialCreditEnabled() { if (partialCreditEnabledChecked) { return partialCreditEnabled; @@ -1491,9 +1515,8 @@ } public void togglePartialCredit(ValueChangeEvent event) { - String switchEvent = (String) event.getNewValue(); - + if (Boolean.parseBoolean(switchEvent)) { setPartialCreditFlag("true"); this.resetPartialCreditValues(); @@ -1505,8 +1528,99 @@ } } - public void resetPartialCreditValues() { + public String populateEmiAnswerOptionsFromPasted() { + String pasted = getEmiAnswerOptionsPaste(); + if (pasted == null || pasted.trim().equals("")) return "emiItem"; + + ArrayList list = new ArrayList(); + String[] pastedOptions = getEmiAnswerOptionsPaste().split("\n"); + int labelCount = 0; + for (int i=0; i