Пример #1
0
        /// <summary>
        /// All normal enum values are valid.
        /// </summary>
        /// <param name="value">The value to validate.</param>
        public override void ValidateAudioCaptioning(AudioCaptioning value)
        {
            switch (value)
            {
            case AudioCaptioning.NoChange:
            case AudioCaptioning.Off:
            case AudioCaptioning.On:
                break;

            default:
                throw new ArgumentOutOfRangeException("value");
            }
        }
Пример #2
0
        public static string GetRteAudioCaptioning(AudioCaptioning caption)
        {
            switch (caption)
            {
            case AudioCaptioning.Off:
                return("-1");

            case AudioCaptioning.On:
                return("1");

            default:
                return("0");
            }
        }
Пример #3
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;
        }
Пример #4
0
 /// <summary>
 /// All normal enum values are valid.
 /// </summary>
 /// <param name="value">The value to validate.</param>
 public override void ValidateAudioCaptioning(AudioCaptioning value)
 {
     switch(value)
     {
     case AudioCaptioning.NoChange:
     case AudioCaptioning.Off:
     case AudioCaptioning.On:
         break;
     default:
         throw new ArgumentOutOfRangeException("value");
     }
 }
Пример #5
0
 public abstract void ValidateAudioCaptioning(AudioCaptioning value);
Пример #6
0
        /// <summary>
        /// Creates a new <Typ>ExecuteNavigator</Typ> object in memory and its representation in the database.
        /// </summary>
        /// <param name="store">A <Typ>LearningStore</Typ> object that references the database to use.</param>
        /// <param name="rootActivityId">The database identifier for the root activity (i.e. organization) of the activity tree to attempt.</param>
        /// <param name="learnerId">The database identifier for the learner information.</param>
        /// <param name="learnerAssignmentId">The database identifier for the learner assignment information. Only used in SLK.</param>
        /// <param name="loggingFlags">Flags specifying which actions to log.</param>
        /// <returns>A new <Typ>ExecuteNavigator</Typ> object.</returns>
        /// <exception cref="LearningStoreItemNotFoundException">Thrown if the learner ID or root activity ID is invalid, or if the package information cannot be found.</exception>
        static public ExecuteNavigator CreateExecuteNavigator(LearningStore store, long rootActivityId, long learnerId, long learnerAssignmentId, LoggingOptions loggingFlags)
        {
            ExecuteNavigator eNav = new ExecuteNavigator();

            LearningStoreJob job = store.CreateJob();

            // first add security
            Dictionary <string, object> securityParameters = new Dictionary <string, object>();

            securityParameters[Schema.CreateAttemptRight.RootActivityId] =
                new LearningStoreItemIdentifier(Schema.ActivityPackageItem.ItemTypeName, rootActivityId);
            securityParameters[Schema.CreateAttemptRight.LearnerId] =
                new LearningStoreItemIdentifier(Schema.UserItem.ItemTypeName, learnerId);
            job.DemandRight(Schema.CreateAttemptRight.RightName, securityParameters);
            job.DisableFollowingSecurityChecks();

            // first query for all information about the learner
            LearningStoreQuery query = store.CreateQuery(Schema.UserItem.ItemTypeName);

            query.AddColumn(Schema.UserItem.Id);
            query.AddColumn(Schema.UserItem.Name);
            query.AddColumn(Schema.UserItem.Language);
            query.AddColumn(Schema.UserItem.AudioCaptioning);
            query.AddColumn(Schema.UserItem.AudioLevel);
            query.AddColumn(Schema.UserItem.DeliverySpeed);
            query.AddCondition(Schema.UserItem.Id, LearningStoreConditionOperator.Equal,
                               new LearningStoreItemIdentifier(Schema.UserItem.ItemTypeName, learnerId));
            job.PerformQuery(query);

            // then query the package information
            query = store.CreateQuery(Schema.SeqNavActivityPackageView.ViewName);
            LearningStoreItemIdentifier rootId = new LearningStoreItemIdentifier(Schema.ActivityPackageItem.ItemTypeName, rootActivityId);

            query.AddColumn(Schema.SeqNavActivityPackageView.PackageId);
            query.AddColumn(Schema.SeqNavActivityPackageView.PackageFormat);
            query.AddColumn(Schema.SeqNavActivityPackageView.PackagePath);
            query.AddCondition(Schema.SeqNavActivityPackageView.Id, LearningStoreConditionOperator.Equal, rootId);
            job.PerformQuery(query);

            // then query for the activity tree
            query = store.CreateQuery(Schema.SeqNavActivityTreeView.ViewName);
            query.AddColumn(Schema.SeqNavActivityTreeView.DataModelCache);
            query.AddColumn(Schema.SeqNavActivityTreeView.ParentActivityId);
            query.AddColumn(Schema.SeqNavActivityTreeView.Id);
            query.AddColumn(Schema.SeqNavActivityTreeView.ObjectivesGlobalToSystem);
            query.AddCondition(Schema.SeqNavActivityTreeView.RootActivityId, LearningStoreConditionOperator.Equal, new LearningStoreItemIdentifier(Schema.ActivityPackageItem.ItemTypeName, rootActivityId));
            job.PerformQuery(query);

            DataTable d;  // used to store results of query
            ReadOnlyCollection <object> ids;

            // for this transaction we need to read from the activitypackageitem table and write new records to
            // the activityattemptitem and attemptitem tables
            TransactionOptions options = new TransactionOptions();

            options.IsolationLevel = System.Transactions.IsolationLevel.RepeatableRead;
            using (LearningStoreTransactionScope scope = new LearningStoreTransactionScope(options))
            {
                // execute the query
                ReadOnlyCollection <object> c = job.Execute();
                Utilities.Assert(c.Count == 3);

                if (((DataTable)c[0]).Rows.Count < 1)
                {
                    throw new LearningStoreItemNotFoundException(Resources.InvalidLearnerId);
                }
                if (((DataTable)c[1]).Rows.Count < 1)
                {
                    throw new LearningStoreItemNotFoundException(Resources.InvalidRootActivityId);
                }
                if (((DataTable)c[2]).Rows.Count < 1)
                {
                    throw new LearningStoreItemNotFoundException(Resources.InvalidRootActivityId);
                }

                d = (DataTable)c[0];  // save learner information

                string          learnerName          = (string)d.Rows[0][Schema.UserItem.Name];
                AudioCaptioning learnerCaption       = (AudioCaptioning)d.Rows[0][Schema.UserItem.AudioCaptioning];
                float           learnerAudioLevel    = (float)d.Rows[0][Schema.UserItem.AudioLevel];
                float           learnerDeliverySpeed = (float)d.Rows[0][Schema.UserItem.DeliverySpeed];
                string          learnerLanguage      = (string)d.Rows[0][Schema.UserItem.Language];

                d = (DataTable)c[1];  // save package information

                // we need to create the activity tree within the transaction because it may affect the data written
                // by means of the selection and randomization processes.

                eNav.m_packageFormat   = (PackageFormat)d.Rows[0][Schema.SeqNavActivityPackageView.PackageFormat];
                eNav.m_packageId       = ((LearningStoreItemIdentifier)d.Rows[0][Schema.SeqNavActivityPackageView.PackageId]).GetKey();
                eNav.m_packageLocation = (string)d.Rows[0][Schema.SeqNavActivityPackageView.PackagePath];
                eNav.m_store           = store;
                eNav.m_learnerId       = learnerId;
                eNav.m_loggingFlags    = loggingFlags;

                // we must set this here so that the Activity  constructor doesn't try and load missing info
                eNav.m_attemptItemInformationIsValid = true;

                d = (DataTable)c[2];  // save data to create activity tree later, when we are done with sql processing

                eNav.AddActivities(d, rootActivityId, learnerName, learnerLanguage, learnerCaption, learnerAudioLevel, learnerDeliverySpeed);

                /*
                 * // create activity objects and store them in a big dictionary
                 * foreach(DataRow row in d.Rows)
                 * {
                 *  Activity act = new Activity(eNav, ((LearningStoreItemIdentifier)row[Schema.SeqNavActivityTreeView.Id]).GetKey(),
                 *      ConvertLearningStoreXmlToXPathNavigator(row[Schema.SeqNavActivityTreeView.DataModelCache] as LearningStoreXml, true),
                 *      null, null, null, eNav.WrapAttachment, eNav.WrapAttachmentGuid, -1,
                 *      (bool)row[Schema.SeqNavActivityTreeView.ObjectivesGlobalToSystem], eNav.m_learnerId.ToString(System.Globalization.CultureInfo.InvariantCulture),
                 *      learnerName, learnerLanguage, learnerCaption, learnerAudioLevel, learnerDeliverySpeed);
                 *  eNav.m_activities[act.ActivityId] = act;
                 *  if(act.ActivityId == rootActivityId)
                 *  {
                 *      eNav.RootActivity = act;
                 *      if(!(row[Schema.SeqNavActivityTreeView.ParentActivityId] is DBNull))
                 *      {
                 *          throw new LearningStoreItemNotFoundException(Resources.InvalidRootActivityId);
                 *      }
                 *  }
                 * }
                 *
                 * // now that we have all the activities in a big dictionary, find all the parents to build the tree
                 * // in theory this could be done in the first loop if I sort the query by parentid, but that's making a lot
                 * // of assumptions about the structure of the database that I don't think are safe to make
                 * foreach(DataRow row in d.Rows)
                 * {
                 *  LearningStoreItemIdentifier parentId = row[Schema.SeqNavActivityTreeView.ParentActivityId] as LearningStoreItemIdentifier;
                 *  if (parentId != null)
                 *  {
                 *      long id = ((LearningStoreItemIdentifier)row[Schema.SeqNavActivityTreeView.Id]).GetKey();
                 *      eNav.m_activities[id].Parent = eNav.m_activities[parentId.GetKey()];
                 *      eNav.m_activities[parentId.GetKey()].AddChild(eNav.m_activities[id]);
                 *  }
                 * }
                 *
                 * // make sure children of each parent are in the right order, and set Previous and Next pointer correctly.
                 * eNav.SortActivityTree();
                 *
                 * // step through the activity tree searching for selection and randomization instructions
                 * // this must be done before the ActivityAttemptItems are saved because they may reorder
                 * // and potentially even remove children.
                 * Random rand = new Random();
                 * foreach(Activity a in eNav.Traverse)
                 * {
                 *  if(!a.IsLeaf)
                 *  {
                 *      // if there's a valid selection instruction, remove excess
                 *      // child activities randomly
                 *      if(a.Sequencing.SelectionTiming == RandomizationTiming.Once &&
                 *          a.Sequencing.RandomizationSelectCount > 0 &&
                 *          a.Sequencing.RandomizationSelectCount < a.Children.Count)
                 *      {
                 *          int selCount = a.Sequencing.RandomizationSelectCount;
                 *          for(int i = 0 ; i < a.Children.Count ; ++i)
                 *          {
                 *              if(rand.Next(a.Children.Count) < selCount)
                 *              {
                 *                  --selCount;
                 *              }
                 *              else
                 *              {
                 *                  a.RemoveChild(i);
                 *              }
                 *          }
                 *          a.SortChildren();
                 *      }
                 *
                 *      // if there's a valid randomization instruction, randomize order of the children
                 *      // of this activity
                 *      if((a.Sequencing.RandomizationTiming == RandomizationTiming.Once ||
                 *          a.Sequencing.RandomizationTiming == RandomizationTiming.OnEachNewAttempt) &&
                 *          a.Sequencing.ReorderChildren)
                 *      {
                 *          List<Activity> randlist = new List<Activity>();
                 *          while(a.Children.Count > 0)
                 *          {
                 *              int i = rand.Next(a.Children.Count);
                 *              randlist.Add((Activity)a.Children[i]);
                 *              a.RemoveChild(i);
                 *          }
                 *          for(int i = 0 ; i < randlist.Count ; ++i)
                 *          {
                 *              randlist[i].RandomPlacement = i;
                 *              a.AddChild(randlist[i]);
                 *          }
                 *          a.SortChildren();
                 *      }
                 *  }
                 * }
                 * */

                // create the attemptitem
                // fill in fields with no defaults
                job = store.CreateJob();
                job.DisableFollowingSecurityChecks();
                Dictionary <string, object> attempt = new Dictionary <string, object>();
                attempt[Schema.AttemptItem.RootActivityId] = new LearningStoreItemIdentifier(Schema.ActivityPackageItem.ItemTypeName, rootActivityId);
                attempt[Schema.AttemptItem.LearnerId]      = new LearningStoreItemIdentifier(Schema.UserItem.ItemTypeName, learnerId);
                if (learnerAssignmentId != 0)
                {
                    attempt[Schema.AttemptItem.LearnerAssignmentId] = new LearningStoreItemIdentifier("LearnerAssignmentItem", learnerAssignmentId);
                }
                attempt[Schema.AttemptItem.PackageId] = new LearningStoreItemIdentifier(Schema.PackageItem.ItemTypeName, eNav.m_packageId);
                eNav.m_attemptStartTime = DateTime.UtcNow;
                attempt[Schema.AttemptItem.StartedTimestamp]    = eNav.m_attemptStartTime;
                attempt[Schema.AttemptItem.LogDetailSequencing] = ((loggingFlags & LoggingOptions.LogDetailSequencing) == LoggingOptions.LogDetailSequencing);
                attempt[Schema.AttemptItem.LogFinalSequencing]  = ((loggingFlags & LoggingOptions.LogFinalSequencing) == LoggingOptions.LogFinalSequencing);
                attempt[Schema.AttemptItem.LogRollup]           = ((loggingFlags & LoggingOptions.LogRollup) == LoggingOptions.LogRollup);
                LearningStoreItemIdentifier attemptId = job.AddItem(Schema.AttemptItem.ItemTypeName, attempt, true);

                // create activityattemptitems for each activity in the tree
                foreach (Activity a in eNav.Traverse)
                {
                    Dictionary <string, object> activity = new Dictionary <string, object>();

                    // fill in everything that has no default
                    activity[Schema.ActivityAttemptItem.AttemptId]         = attemptId;
                    activity[Schema.ActivityAttemptItem.ActivityPackageId] = new LearningStoreItemIdentifier(Schema.ActivityPackageItem.ItemTypeName, a.ActivityId);
                    if (a.RandomPlacement >= 0)
                    {
                        activity[Schema.ActivityAttemptItem.RandomPlacement] = a.RandomPlacement;
                        // sibling activities are ordered by RandomPlacement first,
                        // then by OriginalPlacment; RandomPlacement is -1 for all siblings if not randomization occurs
                    }
                    job.AddItem(Schema.ActivityAttemptItem.ItemTypeName, activity, true);
                }
                ids = job.Execute();
                scope.Complete();
            }

            // fill in some vital data for the navigator
            eNav.m_attemptId = ((LearningStoreItemIdentifier)ids[0]).GetKey();
            int index = 1;

            foreach (Activity a in eNav.Traverse)
            {
                a.InternalActivityId = ((LearningStoreItemIdentifier)ids[index++]).GetKey();
            }

            return(eNav);
        }
Пример #7
0
        /// <summary>
        /// Adds all the activities to the navigator, and performs initial setup.
        /// </summary>
        /// <param name="d">DataTable containing the activities to add.</param>
        /// <param name="rootActivityId">Root activity identifier.</param>
        /// <param name="learnerName">Name of the learner.</param>
        /// <param name="learnerLanguage">Preferred language used by the learner.</param>
        /// <param name="learnerCaption">Preferred captioning setting used by the learner.</param>
        /// <param name="learnerAudioLevel">Preferred audio level setting for the learner.</param>
        /// <param name="learnerDeliverySpeed">Preferred delivery speed for the learner.</param>
        /// <remarks>
        /// This is only called by ExecuteNavigator().  Removed from the middle of that function to get
        /// FxCop to shut up.
        /// </remarks>
        private void AddActivities(DataTable d, long rootActivityId, string learnerName, string learnerLanguage,
                                   AudioCaptioning learnerCaption, float learnerAudioLevel, float learnerDeliverySpeed)
        {
            // create activity objects and store them in a big dictionary
            foreach (DataRow row in d.Rows)
            {
                Activity act = new Activity(this, ((LearningStoreItemIdentifier)row[Schema.SeqNavActivityTreeView.Id]).GetKey(),
                                            ConvertLearningStoreXmlToXPathNavigator(row[Schema.SeqNavActivityTreeView.DataModelCache] as LearningStoreXml, true),
                                            null, null, null, WrapAttachment, WrapAttachmentGuid, -1,
                                            (bool)row[Schema.SeqNavActivityTreeView.ObjectivesGlobalToSystem],
                                            DataModelWriteValidationMode.AllowWriteOnlyIfActive,
                                            m_learnerId.ToString(System.Globalization.CultureInfo.InvariantCulture),
                                            learnerName, learnerLanguage, learnerCaption, learnerAudioLevel, learnerDeliverySpeed);
                m_activities[act.ActivityId] = act;
                if (act.ActivityId == rootActivityId)
                {
                    RootActivity = act;
                    if (!(row[Schema.SeqNavActivityTreeView.ParentActivityId] is DBNull))
                    {
                        throw new LearningStoreItemNotFoundException(Resources.InvalidRootActivityId);
                    }
                }
            }

            // now that we have all the activities in a big dictionary, find all the parents to build the tree
            // in theory this could be done in the first loop if I sort the query by parentid, but that's making a lot
            // of assumptions about the structure of the database that I don't think are safe to make
            foreach (DataRow row in d.Rows)
            {
                LearningStoreItemIdentifier parentId = row[Schema.SeqNavActivityTreeView.ParentActivityId] as LearningStoreItemIdentifier;
                if (parentId != null)
                {
                    long id = ((LearningStoreItemIdentifier)row[Schema.SeqNavActivityTreeView.Id]).GetKey();
                    m_activities[id].Parent = m_activities[parentId.GetKey()];
                    m_activities[parentId.GetKey()].AddChild(m_activities[id]);
                }
            }

            // make sure children of each parent are in the right order, and set Previous and Next pointer correctly.
            SortActivityTree();

            // step through the activity tree searching for selection and randomization instructions
            // this must be done before the ActivityAttemptItems are saved because they may reorder
            // and potentially even remove children.
#if DEBUG
            Random rand;
            if (NavigatorData.Random != null)
            {
                rand = NavigatorData.Random;
            }
            else
            {
                rand = new Random();
            }
#else
            Random rand = new Random();
#endif
            foreach (Activity a in Traverse)
            {
                if (!a.IsLeaf)
                {
                    // if there's a valid selection instruction, remove excess
                    // child activities randomly
                    if (a.Sequencing.SelectionTiming == RandomizationTiming.Once &&
                        a.Sequencing.RandomizationSelectCount > 0 &&
                        a.Sequencing.RandomizationSelectCount < a.Children.Count)
                    {
                        int selCount = a.Sequencing.RandomizationSelectCount;
                        while (a.Children.Count > selCount)
                        {
                            a.RemoveChild(rand.Next(a.Children.Count));
                        }
                        a.SortChildren();
                    }

                    // if there's a valid randomization instruction, randomize order of the children
                    // of this activity
                    if ((a.Sequencing.RandomizationTiming == RandomizationTiming.Once ||
                         a.Sequencing.RandomizationTiming == RandomizationTiming.OnEachNewAttempt) &&
                        a.Sequencing.ReorderChildren)
                    {
                        List <Activity> randlist = new List <Activity>();
                        while (a.Children.Count > 0)
                        {
                            int i = rand.Next(a.Children.Count);
                            randlist.Add((Activity)a.Children[i]);
                            a.RemoveChild(i);
                        }
                        for (int i = 0; i < randlist.Count; ++i)
                        {
                            randlist[i].RandomPlacement = i;
                            a.AddChild(randlist[i]);
                        }
                        a.SortChildren();
                    }
                }
            }
        }
Пример #8
0
 public static string GetRteAudioCaptioning(AudioCaptioning caption)
 {
     switch (caption)
     {
         case AudioCaptioning.Off:
             return "-1";
         case AudioCaptioning.On:
             return "1";
         default:
             return "0";
     }
 }
Пример #9
0
 public abstract void ValidateAudioCaptioning(AudioCaptioning value);
Пример #10
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;
 }