Пример #1
0
 public IList <AssetRecomendation> GetRecommendationForProblemGroup(string skill)
 {
     if (are == null)
     {
         are = dm.ita.CreateAssetRecommendationEngine();
     }
     return(are.GetRecommendationsFor(skill));
 }
Пример #2
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");
        }
Пример #3
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);
        }
Пример #4
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++;
                }
            }
        }