Class ItemHelper20Impl

  • All Implemented Interfaces:
    ItemHelperIfc

    public class ItemHelper20Impl
    extends ItemHelperBase
    implements ItemHelperIfc

    Copyright: Copyright (c) 2004

    Organization: Sakai Project

    Version for QTI 2.0 item XML, significant differences between 1.2 and 2.0

    Version:
    $Id$
    Author:
    Ed Smiley esmiley@stanford.edu
    • Constructor Detail

      • ItemHelper20Impl

        public ItemHelper20Impl()
    • Method Detail

      • addMaxScore

        public void addMaxScore​(Double score,
                                Item itemXml)
        Add maximum score to item XML.
        Specified by:
        addMaxScore in interface ItemHelperIfc
        Parameters:
        score -
        itemXml -
      • addMinScore

        public void addMinScore​(Double score,
                                Item itemXml)
        Add minimum score to item XML
        Specified by:
        addMinScore in interface ItemHelperIfc
        Parameters:
        score -
        itemXml -
      • addCorrectAnswer

        public void addCorrectAnswer​(String correctAnswerLabel,
                                     Item itemXml)
        Flags an answer as correct.
        Specified by:
        addCorrectAnswer in interface ItemHelperIfc
        Parameters:
        correctAnswerLabel -
      • getMetaXPath

        public String getMetaXPath()
        assessmentItem/qtiMetadata not be permissible in QTI 2.0 this this should be used by manifest Get the metadata field entry XPath
        Specified by:
        getMetaXPath in interface ItemHelperIfc
        Returns:
        the XPath
      • getMetaLabelXPath

        public String getMetaLabelXPath​(String fieldlabel)
        assessmentItem/qtiMetadata not be permissible in QTI 2.0 this this should be used by manifest Get the metadata field entry XPath for a given label
        Specified by:
        getMetaLabelXPath in interface ItemHelperIfc
        Parameters:
        fieldlabel -
        Returns:
        the XPath
      • getText

        public String getText​(Item itemXml)
        Get the text for the item
        Specified by:
        getText in interface ItemHelperIfc
        Parameters:
        itemXml -
        Returns:
        the text
      • setItemTexts

        public void setItemTexts​(List<org.sakaiproject.tool.assessment.data.ifc.assessment.ItemTextIfc> itemTextList,
                                 Item itemXml)
        Set the (one or more) item texts. Valid for single and multiple texts.
        Specified by:
        setItemTexts in interface ItemHelperIfc
        Parameters:
        itemXml -
        itemText - text to be updated
      • getItemType

        public String getItemType​(Item itemXml)
        get item type string we use title for this for now
        Specified by:
        getItemType in interface ItemHelperIfc
        Parameters:
        itemXml -
        Returns:
        type as string
      • setAnswers

        public void setAnswers​(List<org.sakaiproject.tool.assessment.data.ifc.assessment.ItemTextIfc> itemTextList,
                               Item itemXml)
        Set the answer texts for item.
        Specified by:
        setAnswers in interface ItemHelperIfc
        Parameters:
        itemTextList - the text(s) for item
      • setFeedback

        public void setFeedback​(List<org.sakaiproject.tool.assessment.data.ifc.assessment.ItemTextIfc> itemTextList,
                                Item itemXml)
        Description copied from interface: ItemHelperIfc
        Set the feedback texts for item.
        Specified by:
        setFeedback in interface ItemHelperIfc
        Parameters:
        itemTextList - the text(s) for item
      • addIncorrectAnswer

        public void addIncorrectAnswer​(String incorrectAnswerLabel,
                                       Item itemXml)
        Description copied from interface: ItemHelperIfc
        Flags an answer as NOT correct.
        Specified by:
        addIncorrectAnswer in interface ItemHelperIfc
        Parameters:
        incorrectAnswerLabel -
        itemXml -
      • setItemText

        public void setItemText​(String itemText,
                                String flowClass,
                                Item itemXml)
        Description copied from interface: ItemHelperIfc
        Set the (usually instructional text) for the item for the specified flow.
        Specified by:
        setItemText in interface ItemHelperIfc
      • setAttachments

        public void setAttachments​(Set<? extends org.sakaiproject.tool.assessment.data.ifc.assessment.AttachmentIfc> attachmentSet,
                                   Item item)
        Specified by:
        setAttachments in interface ItemHelperIfc