Exemplo n.º 1
0
        public void TestCreateRecommendationEngine()
        {
            DefaultITAEngineManager   iem = new DefaultITAEngineManager();
            AssetRecommendationEngine are = iem.CreateAssetRecommendationEngine();

            Assert.IsNotNull(are);
        }
Exemplo n.º 2
0
 public IList <AssetRecomendation> GetRecommendationForProblemGroup(string skill)
 {
     if (are == null)
     {
         are = dm.ita.CreateAssetRecommendationEngine();
     }
     return(are.GetRecommendationsFor(skill));
 }
Exemplo n.º 3
0
        public Assessment GetAssessment()
        {
            actResponse = new ActionResponse();

            are   = null;
            recom = null;

            AssessmentBuilder aBuild = dm.ita.CreateAssessmentBuilder();

            aBuild.AddProblem(problemSetSize, currentAssessmentNum.ToString(), "random");
            assessment = aBuild.Build();
            probList   = new List <string>(assessment.GetProblemSequence());
            return(assessment);
        }
Exemplo n.º 4
0
        public void CloseAssessment()
        {
            CompResp compResp = new CompResp();

            if (assessment != null)
            {
                assessment.Close(compResp);
                assessment = null;
            }
            probList = null;
            if (actResponse.HasFailed)
            {
                are = dm.ita.CreateAssetRecommendationEngine();
            }
            else
            {
                currentAssessmentNum++;
                if (currentAssessmentNum == 6)
                {
                    currentAssessmentNum = 0;
                }
            }
        }
Exemplo n.º 5
0
        private void MarkTutorType(string [] skills)
        {
            Console.Write("\nMarking Tutor Assets: ");
            AssetRecommendationEngine ae = ita.CreateAssetRecommendationEngine();

            foreach (string skill in skills)
            {
                List <AssetRecomendation> arList = new List <AssetRecomendation>(ae.GetRecommendationsFor(skill));
                foreach (string type in currentScript.tutorData.chooseType)
                {
                    foreach (AssetRecomendation ar in arList)
                    {
                        if (type == ar.GetAssetType())
                        {
                            Console.Write(type + "," + ar.GetAssetIdentifier() + " ");
                            ae.MarkAssetStarted(ar.GetAssetIdentifier());
                            ae.MarkAssetCompleted(ar.GetAssetIdentifier());
                        }
                    }
                }
            }
            Console.Write("\n");
        }
Exemplo n.º 6
0
        private bool TutorListOrderVerifyFailed(string[] skills)
        {
            Console.Write("\nVerifying Tutor Asset Order: ");
            AssetRecommendationEngine ae = ita.CreateAssetRecommendationEngine();

            foreach (string skill in skills)
            {
                List <AssetRecomendation> arList = new List <AssetRecomendation>(ae.GetRecommendationsFor(skill));
                foreach (string type in currentScript.tutorData.verifyOrder)
                {
                    Console.Write(type + "," + arList[0].GetAssetIdentifier() + " ");
                    if (type != arList[0].GetAssetType())
                    {
                        Console.WriteLine("\nAsset type doesn't match order. \n" +
                                          "\t Expected type: " + type +
                                          " Actual: " + arList[0].GetAssetType()
                                          + " id: " + arList[0].GetAssetIdentifier());
                        verifyTutorFailed = true;
                        return(verifyTutorFailed);
                    }
                }
            }
            return(verifyTutorFailed);
        }
Exemplo n.º 7
0
        public static void Run()
        {
            Translate trans = new Translate();

            int assessmentCurrent = 1;

            while (keepRunning && assessmentCurrent <= 6)
            {
                Console.WriteLine("--------------------------------------------------");
                Console.WriteLine("   Starting new assessment");
                Console.WriteLine("--------------------------------------------------");

                Console.WriteLine("Create AssessmentBuilder");
                AssessmentBuilder aBuild = DataManager.ita.CreateAssessmentBuilder();
                Console.WriteLine("Create a Problem Sequence of 3 problems for group id: " + assessmentCurrent);
                aBuild.AddProblem(3, "" + assessmentCurrent, "random");
                Console.WriteLine("Build the Assessment");
                Assessment assess = aBuild.Build();

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

                ActionResponse actRes = new ActionResponse();
                foreach (string id in probList)
                {
                    ProblemData.ProblemRec probRec = DataManager.problemData.pd[id];
                    Console.Write("\nTranslate the following to alpha.\nMorse:  ");
                    Console.WriteLine(trans.AlphaToMorse(probRec.statement));
                    string line = Console.ReadLine();
                    if (!line.Equals(probRec.statement))
                    {
                        Console.WriteLine("Mark problem completed with FAIL.");
                        assess.MarkCompleted(id, false, actRes);
                        if (actRes.HasFailed())
                        {
                            Console.WriteLine("Failed Assessment Terminating");
                        }
                        break;
                    }
                    else
                    {
                        Console.WriteLine("Mark problem completed CORRECT.");
                        assess.MarkCompleted(id, true, actRes);
                    }
                }

                assess.Close(new CompletionResponse());
                if (actRes.HasFailed())
                {
                    Console.WriteLine("Create AssetRecommendationEngine");
                    AssetRecommendationEngine are = DataManager.ita.CreateAssetRecommendationEngine();
                    Console.WriteLine("Displaying Assests for Remediation\n");
                    IList <AssetRecomendation> arList = are.GetRecommendationsFor("" + assessmentCurrent);

                    foreach (AssetRecomendation ar in arList)
                    {
                        Console.WriteLine("*Asset********************************************");
                        string    assetId = ar.GetAssetIdentifier();
                        string [] text    = DataManager.assetData.ad[assetId].desc.Split(new string [] { "\n" },
                                                                                         StringSplitOptions.RemoveEmptyEntries);
                        foreach (string line in text)
                        {
                            Console.WriteLine(line);
                        }
                        Console.WriteLine("**************************************************\n");
                    }
                }
                else
                {
                    Console.WriteLine("Finished Asessment Successfully");
                    assessmentCurrent++;
                }
            }
        }