Example #1
0
        /// <summary>
        /// Displays a question to the user.
        /// </summary>
        private static void DisplayQuestion(Engine.Response response)
        {
            // Get data about the next question
            Facts.Fact theFact = response.NextFact;
            Question   theQ    = Templates.GetQ(theFact.Relationship);

            // TODO: Display appropriate question control (using theQ.questionType)

            // White space
            Console.WriteLine();

            // Display progress percentage
            Console.WriteLine("Percent complete: " + response.PercentComplete);

            // Display question text
            string qText = theFact.QuestionText(); // QuestionText(theFact, theQ);

            Console.WriteLine(qText);
            AkkTest.assertedRelationship = AkkTest.AddUnitTestAssertRel(theFact, theQ);

            // Display an explanation (if any)
            if (theQ.explanation != "")
            {
                Console.WriteLine("Note: " + theQ.explanation);
            }
        }
Example #2
0
 public Factoid(Facts.Fact f)
 {
     FactType     = f.GetTvarType();
     Relationship = f.Relationship;
     Arg1         = Util.ArgToString(f.Arg1);
     Arg2         = Util.ArgToString(f.Arg2);
     Arg3         = Util.ArgToString(f.Arg3);
     QuestionText = f.QuestionText();
 }
Example #3
0
        /// <summary>
        /// Displays the engine's results of the interview session.
        /// </summary>
        private static void DisplayResults(Facts.Fact goal)
        {
            Console.WriteLine("\n");

            // Indent and format results
            string tline = "\t" + goal.ValueAsString().Replace("\n", "\n\t");

            // For eternal values, only show value
            if (goal.Value().IsEternal)
            {
                tline = tline.Replace("DawnOfTime   ", "");
            }

            // Concatenate question and answer
            string result = "\t" + goal.QuestionText() + "\n\n" + tline + "\n";

            // Add result to test case
            Tvar testResult = goal.GetFunction().Invoke();

            AkkTest.CloseUnitTest(testResult, goal.Relationship);

            Console.WriteLine(result);
        }