Beispiel #1
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);
        }
Beispiel #2
0
        public bool  DoAssessment(AssessmentBuilder assessBuild)
        {
            Console.WriteLine("---------------------------------------------------");
            Console.WriteLine("Beginning Assessment");
            assessBuild.AddProblem(currentScript.problemCount, currentScript.groupId, "random");
            Assessment assess = assessBuild.Build();

            MarkProblems(assess);
            bool skillsVerifyFailed = VerifySkillListFailed(assess);

            if (actResp.HasFailed && !currentScript.expectSuccess)
            {
                success = true;
            }
            else if (!actResp.HasFailed && currentScript.expectSuccess)
            {
                success = true;
            }

            if (hasDuplicateProblems || skillsVerifyFailed || verifyTutorFailed)
            {
                success = false;
            }

            CompResp compResp = new CompResp();

            assess.Close(compResp);

            Console.WriteLine("Total Score: " + compResp.TotalScore);
            foreach (SkillScoreStructure skillScore in compResp.listSSS)
            {
                Console.WriteLine("\tSkill id: " + skillScore.GetSkillId() + " score: " + skillScore.GetScore());
            }

            Console.WriteLine("Assessment Completed");

            return(success);
        }
Beispiel #3
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++;
                }
            }
        }