Esempio n. 1
0
        /// <summary>
        /// Applies base elements to primary objective.
        /// </summary>
        /// <param name="sequencing">SequencingType value represents object to customize.</param>
        /// <param name="identifier">String value represents identifier.</param>
        /// <returns>Target Objective ID</returns>
        public static string CustomizePrimaryObjectives([NotNull] ref SequencingType sequencing, [NotNull] string identifier)
        {
            //Adding primary objective and mapped global objective with default IDs.
            if (sequencing.objectives == null)
            {
                sequencing.objectives = new ObjectivesType();
            }
            if (sequencing.objectives.primaryObjective == null)
            {
                sequencing.objectives.primaryObjective = new ObjectivesTypePrimaryObjective();
            }
            string primaryObjectiveID = identifier + primaryObjectiveSufix;

            if (sequencing.objectives.primaryObjective.objectiveID == null)
            {
                sequencing.objectives.primaryObjective.objectiveID = primaryObjectiveID;
            }
            string targetObjectiveID = sharedObjectivePrefix + identifier;

            /*ObjectiveTypeMapInfo mapInfo = new ObjectiveTypeMapInfo();
             * mapInfo.targetObjectiveID = targetObjectiveID;
             * mapInfo.readSatisfiedStatus = true;
             * mapInfo.writeSatisfiedStatus = true;
             * sequencing.objectives.primaryObjective.mapInfo.Add(mapInfo);
             */

            return(targetObjectiveID);
        }
Esempio n. 2
0
        /// <summary>
        /// Main entry point for creating Sequencing object.
        /// </summary>
        /// <param name="item"><see cref="ItemType"/> value to customize default sequencing srategy for.</param>
        /// <returns>SequencingType value with default sequencing strategy elements for current item.</returns>
        public static SequencingType CreateNewSequencing([NotNull] ItemType item)
        {
            PageType       pageType = item.PageType;
            SequencingType result   = new SequencingType();

            switch (pageType)
            {
            case PageType.Chapter:
                item.SequencingPatterns.Add(new ChapterDefaultSequencingPattern());
                //CustomizeChapter(ref result);
                break;

            case PageType.ControlChapter:
                item.SequencingPatterns.Add(new ControlChapterDefaultSequencingPattern());
                // CustomizeControlChapter(ref result);
                break;

            case PageType.Question:
                CustomizeQuestionPage(ref result);
                break;

            case PageType.Theory:
                CustomizeTheoryPage(ref result);
                break;

            default:

                break;
            }

            CustomizePrimaryObjectives(ref result, item.Identifier);

            return(result);
        }
Esempio n. 3
0
        public void ClearSequencingTest()
        {
            Assert.IsNotNull(this.chapterItem.Sequencing);

            SequencingType seq = SequencingManager.ClearSequencing(this.chapterItem);

            Assert.IsNotNull(seq);
            Assert.AreEqual(seq, this.chapterItem.Sequencing);
        }
Esempio n. 4
0
 public void CreateNewSequencingTest()
 {
     foreach (ItemType item in this.items)
     {
         Assert.IsNotNull(item.Sequencing);
         SequencingType seq = SequencingManager.CreateNewSequencing(item);
         Assert.IsNotNull(seq);
     }
 }
Esempio n. 5
0
 /// <summary>
 /// Customizes sequencing for theory page.
 /// </summary>
 /// <param name="sequencing">SequencingType value represents object to customize.</param>
 public static void CustomizeTheoryPage(ref SequencingType sequencing)
 {
     if (sequencing.deliveryControls == null)
     {
         sequencing.deliveryControls = new DeliveryControlsType();
     }
     sequencing.deliveryControls.completionSetByContent = false;
     sequencing.deliveryControls.objectiveSetByContent  = false;
 }
Esempio n. 6
0
        private void miAddConstrainedChoiceConsiderations_Click(object sender, EventArgs e)
        {
            SequencingType c = (SequencingType)tvManifest.SelectedNode.Tag;

            Debug.Assert(c.constrainedChoiceConsiderations == null, "Constrained Choice Considerations already exist");

            c.constrainedChoiceConsiderations = new ConstrainedChoiceConsiderationsType();

            Forms.PropertyEditor.Show(c.constrainedChoiceConsiderations);
            tvManifest.SelectedNode.Expand();
        }
Esempio n. 7
0
        private void miAddControlMode_Click(object sender, EventArgs e)
        {
            SequencingType c = (SequencingType)tvManifest.SelectedNode.Tag;

            Debug.Assert(c.controlMode == null, "Control Mode already exists");

            c.controlMode = new ControlModeType();

            Forms.PropertyEditor.Show(c.controlMode);
            tvManifest.SelectedNode.Expand();
        }
Esempio n. 8
0
        private void miAddObjectives_Click(object sender, EventArgs e)
        {
            SequencingType c = (SequencingType)tvManifest.SelectedNode.Tag;

            Debug.Assert(c.objectives == null, "Objectives already exists");

            c.objectives = new ObjectivesType();

            Forms.PropertyEditor.Show(c.objectives);
            tvManifest.SelectedNode.Expand();
        }
Esempio n. 9
0
        private void miAddRandomizationControl_Click(object sender, EventArgs e)
        {
            SequencingType c = (SequencingType)tvManifest.SelectedNode.Tag;

            Debug.Assert(c.randomizationControls == null, "Randomization Controls already exists");

            c.randomizationControls = new RandomizationType();

            Forms.PropertyEditor.Show(c.randomizationControls);
            tvManifest.SelectedNode.Expand();
        }
Esempio n. 10
0
        private void miAddAuxiliaryResource_Click(object sender, EventArgs e)
        {
            SequencingType c = (SequencingType)tvManifest.SelectedNode.Tag;

            AuxiliaryResourceType a = new AuxiliaryResourceType();

            c.auxiliaryResources.Add(a);

            Forms.PropertyEditor.Show(a);
            tvManifest.SelectedNode.Expand();
        }
Esempio n. 11
0
        public void SettingUp()
        {
            this.chapterItem        = ItemType.CreateNewItem("chapter item", "ci", null, PageType.Chapter);
            this.controlChapterItem = ItemType.CreateNewItem("controlChapter item", "cci", "ewrt", PageType.ControlChapter);
            this.theoryItem         = ItemType.CreateNewItem("theory item", "ti", "dsfg", PageType.Theory);
            // this.questionItem = ItemType.CreateNewItem("question item", "qi", "rtwret", PageType.Question);
            this.summaryItem = ItemType.CreateNewItem("summary item", "si", "ywwdfg", PageType.Summary);
            this.unknownItem = ItemType.CreateNewItem("unknown item", "ui", "wettw", PageType.Unknown);

            this.items = new List <ItemType>();
            this.items.Add(chapterItem);
            this.items.Add(controlChapterItem);
            this.items.Add(theoryItem);
            // this.items.Add(questionItem);
            this.items.Add(summaryItem);
            this.items.Add(unknownItem);

            this.sequencing = new SequencingType();

            this.organization = new OrganizationType();
        }
Esempio n. 12
0
        /* /// <summary>
         * /// Customizes sequencing for simple chapter.
         * /// </summary>
         * /// <param name="sequencing">SequencingType value represents object to customize.</param>
         * public static void CustomizeChapter(ref SequencingType sequencing)
         * {
         *   if (sequencing.controlMode == null)
         *   {
         *       sequencing.controlMode = new ControlModeType();
         *   }
         *   sequencing.controlMode.flow = true;
         *   sequencing.controlMode.choice = true;
         * }
         *
         * /// <summary>
         * /// Customizes sequencing for control chapter.
         * /// </summary>
         * /// <param name="sequencing">SequencingType value represents object to customize.</param>
         * public static void CustomizeControlChapter(ref SequencingType sequencing)
         * {
         *   if (sequencing.controlMode == null)
         *   {
         *       sequencing.controlMode = new ControlModeType();
         *   }
         *   sequencing.controlMode.flow = true;
         *   sequencing.controlMode.forwardOnly = true;
         *   sequencing.controlMode.choice = false;
         *   sequencing.controlMode.choiceExit = false;
         *
         *   if (sequencing.limitConditions == null)
         *   {
         *       sequencing.limitConditions = new LimitConditionsType();
         *   }
         *   sequencing.limitConditions.attemptLimit = "1";
         * }
         */
        /// <summary>
        /// Customizes sequencing for question page.
        /// </summary>
        /// <param name="sequencing">SequencingType value represents object to customize.</param>
        public static void CustomizeQuestionPage(ref SequencingType sequencing)
        {
            if (sequencing.deliveryControls == null)
            {
                sequencing.deliveryControls = new DeliveryControlsType();
            }
            sequencing.deliveryControls.completionSetByContent = true;
            sequencing.deliveryControls.objectiveSetByContent  = true;
            sequencing.deliveryControls.tracked = true;

            if (sequencing.limitConditions == null)
            {
                sequencing.limitConditions = new LimitConditionsType();
                sequencing.limitConditions.attemptLimit = "1";
            }

            if (sequencing.rollupRules == null)
            {
                sequencing.rollupRules = new RollupRulesType();
            }
            sequencing.rollupRules.objectiveMeasureWeight = 1;
        }