Esempio n. 1
0
        /// <summary>
        /// Initializes an Activity object.
        /// </summary>
        /// <param name="owner">The owner of this actitity tree.</param>
        /// <param name="activityId">The unique identifier of this activity.</param>
        /// <param name="rawStaticData">Refers to an xml block in Static Activity XML format.</param>
        /// <param name="rawSequencingData">Refers to an xml block in Sequencing Activity XML format.</param>
        /// <param name="rawDynamicData">Refers to an xml block in Dynamic Activity XML format.</param>
        /// <param name="commentsFromLms">Refers to an xml block in LMS Comments XML format.</param>
        /// <param name="wrap">Delegate to wrap attachments.</param>
        /// <param name="wrapGuid">Delegate to wrap guids that represent attachments.</param>
        /// <param name="randomPlacement">Random placement of this activity within its parent, or -1 if the original placement is to be used.</param>
        /// <param name="objectivesGlobalToSystem">Whether or not objectives are global to the system within this activity tree.</param>
        /// <param name="writeValidationMode">Validation mode to determine if the data model is writable.</param>
        /// <param name="learnerId">The unique identifier of the learner.</param>
        /// <param name="learnerName">The name of the learner.</param>
        /// <param name="learnerLanguage">The language code for the learner.</param>
        /// <param name="learnerCaption">The AudioCaptioning setting for the learner.</param>
        /// <param name="learnerAudioLevel">The audio level setting for the learner.</param>
        /// <param name="learnerDeliverySpeed">The delivery speed setting for the learner.</param>
        internal Activity(Navigator owner, long activityId, XPathNavigator rawStaticData, XPathNavigator rawSequencingData,
                          XPathNavigator rawDynamicData, XPathNavigator commentsFromLms,
                          LearningDataModel.WrapAttachmentDelegate wrap, LearningDataModel.WrapAttachmentGuidDelegate wrapGuid,
                          int randomPlacement, bool objectivesGlobalToSystem, DataModelWriteValidationMode writeValidationMode, string learnerId, string learnerName, string learnerLanguage,
                          AudioCaptioning learnerCaption, float learnerAudioLevel, float learnerDeliverySpeed)
        {
            m_owner        = owner;
            m_activityId   = activityId;
            m_rawStaticXml = rawStaticData.SelectSingleNode("/item");
            PackageFormat format;

            if (owner.PackageFormat == PackageFormat.V1p2)
            {
                if (GetResourceType(m_rawStaticXml) == ResourceType.Lrm)
                {
                    format = PackageFormat.Lrm;
                }
                else
                {
                    format = PackageFormat.V1p2;
                }
            }
            else
            {
                format = owner.PackageFormat;
            }
            m_dataModel = new LearningDataModel(format, m_rawStaticXml, rawSequencingData,
                                                rawDynamicData, commentsFromLms, wrap, wrapGuid, writeValidationMode, learnerId, learnerName, learnerLanguage,
                                                learnerCaption, learnerAudioLevel, learnerDeliverySpeed);
            m_dataModel.DataChange     = OnDataModelChanged;
            m_randomPlacement          = randomPlacement;
            m_objectivesGlobalToSystem = objectivesGlobalToSystem;
            // only call the following after m_rawStaticXml is set.
            m_dataModel.Tracked = Sequencing.Tracked;
            if (IsLeaf)
            {
                m_dataModel.CompletionSetByContent = Sequencing.CompletionSetByContent;
                m_dataModel.ObjectiveSetByContent  = Sequencing.ObjectiveSetByContent;
            }
            m_dataModel.UpdateScore = UpdateScore;
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes an Activity object.
 /// </summary>
 /// <param name="owner">The owner of this actitity tree.</param>
 /// <param name="activityId">The unique identifier of this activity.</param>
 /// <param name="rawStaticData">Refers to an xml block in Static Activity XML format.</param>
 /// <param name="rawSequencingData">Refers to an xml block in Sequencing Activity XML format.</param>
 /// <param name="rawDynamicData">Refers to an xml block in Dynamic Activity XML format.</param>
 /// <param name="commentsFromLms">Refers to an xml block in LMS Comments XML format.</param>
 /// <param name="wrap">Delegate to wrap attachments.</param>
 /// <param name="wrapGuid">Delegate to wrap guids that represent attachments.</param>
 /// <param name="randomPlacement">Random placement of this activity within its parent, or -1 if the original placement is to be used.</param>
 /// <param name="objectivesGlobalToSystem">Whether or not objectives are global to the system within this activity tree.</param>
 /// <param name="writeValidationMode">Validation mode to determine if the data model is writable.</param>
 /// <param name="learnerId">The unique identifier of the learner.</param>
 /// <param name="learnerName">The name of the learner.</param>
 /// <param name="learnerLanguage">The language code for the learner.</param>
 /// <param name="learnerCaption">The AudioCaptioning setting for the learner.</param>
 /// <param name="learnerAudioLevel">The audio level setting for the learner.</param>
 /// <param name="learnerDeliverySpeed">The delivery speed setting for the learner.</param>
 internal Activity(Navigator owner, long activityId, XPathNavigator rawStaticData, XPathNavigator rawSequencingData, 
     XPathNavigator rawDynamicData, XPathNavigator commentsFromLms, 
     LearningDataModel.WrapAttachmentDelegate wrap, LearningDataModel.WrapAttachmentGuidDelegate wrapGuid,
     int randomPlacement, bool objectivesGlobalToSystem, DataModelWriteValidationMode writeValidationMode, string learnerId, string learnerName, string learnerLanguage, 
     AudioCaptioning learnerCaption, float learnerAudioLevel, float learnerDeliverySpeed)
 {
     m_owner = owner;
     m_activityId = activityId;
     m_rawStaticXml = rawStaticData.SelectSingleNode("/item");
     PackageFormat format;
     if(owner.PackageFormat == PackageFormat.V1p2)
     {
         if(GetResourceType(m_rawStaticXml) == ResourceType.Lrm)
         {
             format = PackageFormat.Lrm;
         }
         else
         {
             format = PackageFormat.V1p2;
         }
     }
     else
     {
         format = owner.PackageFormat;
     }
     m_dataModel = new LearningDataModel(format, m_rawStaticXml, rawSequencingData,
         rawDynamicData, commentsFromLms, wrap, wrapGuid, writeValidationMode, learnerId, learnerName, learnerLanguage, 
         learnerCaption, learnerAudioLevel, learnerDeliverySpeed);
     m_dataModel.DataChange = OnDataModelChanged;
     m_randomPlacement = randomPlacement;
     m_objectivesGlobalToSystem = objectivesGlobalToSystem;
     // only call the following after m_rawStaticXml is set.
     m_dataModel.Tracked = Sequencing.Tracked;
     if (IsLeaf)
     {
         m_dataModel.CompletionSetByContent = Sequencing.CompletionSetByContent;
         m_dataModel.ObjectiveSetByContent = Sequencing.ObjectiveSetByContent;
     }
     m_dataModel.UpdateScore = UpdateScore;
 }