예제 #1
0
        public void TestRandomize(int problemSetSize, int totalProblems, bool isCorrect)
        {
            string s1  = "s1";
            string g1  = "g1";
            string sgp = s1 + g1 + "-";

            SkillsDataManager sdm = new SkillsDataManager();

            sdm.AddSkill(s1, false);

            ProblemDataManager pdm = new ProblemDataManager();

            for (int i = 0; i < totalProblems; i++)
            {
                pdm.AddProblem(s1, g1, sgp + i.ToString(), 0, 0, 0);
            }

            //Hold the completed problems for later comparison
            IList <string> completedList = new List <string>();

            for (int i = 0; i < totalProblems / problemSetSize; i++)
            {
                DefaultAssessmentBuilder dab = new DefaultAssessmentBuilder(pdm, sdm);
                dab.AddProblem(problemSetSize, g1, "randgrp321");
                Assessment     assess = dab.Build();
                IList <string> probs  = assess.GetProblemSequence();
                foreach (string prob in probs)
                {
                    pdm.MarkCompleted(prob, isCorrect);
                    Assert.IsFalse(completedList.Contains(prob), prob + ": Already in List");
                    completedList.Add(prob);
                }
            }
        }
예제 #2
0
        public void TestAddSkill()
        {
            SkillsDataManager dataManager = new SkillsDataManager();

            dataManager.AddSkill("Skill1", false);
            dataManager.AddSkill("Skill2", false);
            Assert.AreEqual(2, dataManager.GetSkillCount());
        }
예제 #3
0
        public void TestCase()
        {
            ProblemDataManager pdm = new ProblemDataManager();
            SkillsDataManager  sdm = new SkillsDataManager();

            DefaultAssessmentBuilder dab = new DefaultAssessmentBuilder(pdm, sdm);

            Assert.IsNotNull(dab);
        }
예제 #4
0
        public void BasicTest()
        {
            AssetsDataManager                adm  = new AssetsDataManager();
            ProblemDataManager               pdm  = new ProblemDataManager();
            SkillsDataManager                sdm  = new SkillsDataManager();
            GroupLinkageManager              glm  = new GroupLinkageManager(adm, pdm);
            ProblemLinkageManager            plm  = new ProblemLinkageManager(adm);
            DefaultAssetRecommendationEngine dare = new DefaultAssetRecommendationEngine(adm, sdm, glm, plm);

            Assert.IsNotNull(dare);
        }
예제 #5
0
        public void TestStoreData()
        {
            SkillsDataManager dataManager = new SkillsDataManager();

            dataManager.AddSkill("Skill1", false);
            dataManager.AddSkill("Skill2", false);

            SkillsMockDataStorageDelegate storage = new SkillsMockDataStorageDelegate();

            dataManager.StoreData(storage);
            Assert.AreEqual(2, storage.callCount);
        }
예제 #6
0
        public void TestSetSkillComplete()
        {
            SkillsDataManager dataManager = new SkillsDataManager();

            dataManager.AddSkill("Skill1", false);
            dataManager.AddSkill("Skill2", false);
            Assert.IsFalse(dataManager.IsSkillComplete("Skill1"));
            Assert.IsFalse(dataManager.IsSkillComplete("Skill2"));
            dataManager.SetSkillComplete("Skill1", true);
            Assert.IsTrue(dataManager.IsSkillComplete("Skill1"));
            Assert.IsFalse(dataManager.IsSkillComplete("Skill2"));
        }
예제 #7
0
        public void TestVisit()
        {
            SkillsDataManager dataManager = new SkillsDataManager();

            dataManager.AddSkill("Skill1", false);
            dataManager.AddSkill("Skill2", false);

            int callCount = 0;

            dataManager.Visit(delegate(string skill, bool complete){
                callCount += 1;
            });

            Assert.AreEqual(2, callCount);
        }
예제 #8
0
        private void createAssetsSkills(int skillCount, int assetTypesCount, int assetCount, out AssetsDataManager adm, out SkillsDataManager sdm)
        {
            adm = new AssetsDataManager();
            pdm = new ProblemDataManager();
            sdm = new SkillsDataManager();
            glm = new GroupLinkageManager(adm, pdm);
            plm = new ProblemLinkageManager(adm);

            for (int skillId = 0; skillId < skillCount; skillId++)
            {
                sdm.AddSkill(skillIdPrefix + skillId.ToString(), false);
                for (int assetTypeId = 0; assetTypeId < assetTypesCount; assetTypeId++)
                {
                    for (int assetId = 0; assetId < assetCount; assetId++)
                    {
                        adm.AddAsset(skillIdPrefix + skillId, assetTypePrefix + assetTypeId, assetIdPrefix + assetId, 0, 0, 0);
                    }
                }
            }
        }
예제 #9
0
        public void TestBasicAssessment()
        {
            SkillsDataManager sdm = new SkillsDataManager();

            sdm.AddSkill("s1", false);

            ProblemDataManager pdm = new ProblemDataManager();

            pdm.AddProblem("s1", "grp1", "s1g1-1", 0, 0, 0);

            DefaultAssessmentBuilder dab = new DefaultAssessmentBuilder(pdm, sdm);

            dab.AddProblem(1, "grp1", "randomGrp");

            Assessment assess = dab.Build();

            Assert.IsNotNull(assess);

            IList <string> probIds = assess.GetProblemSequence();

            Assert.AreEqual(probIds.Count, 1);
            Assert.AreEqual(probIds[0], "s1g1-1");
        }
예제 #10
0
 public SkillsBusinessManager(TSPEntities dbconn)
 {
     skillDataManager = new SkillsDataManager(dbconn);
 }