Exemplo n.º 1
0
        public void TestOperationalAnswersCount()
        {
            //Testlet -- Collection
            var testletCollection = new Dictionary <int, Question>();

            testletCollection = LoadQuestions.QuestionInformation();

            /*
             * Question -Id
             *          Question
             *          Order
             *          AnswerList
             *                      Id
             *                      Answer
             *                      AnswerType - Enum Type {Pretest , Operational}
             * var dictionary = new Dictionary<int, Question>
             * {
             *       { question1.Id, question1 },
             *       { question2.Id, question2 }
             * }
             */
            // Return the Question with ID 1
            var   question             = testletCollection[1];
            Int32 operationalTypeCount = question.Answers.Where(x => x.Answertype == AnswerType.Operational).ToList().Count;

            Assert.AreEqual(operationalTypeCount, 6);
        }
Exemplo n.º 2
0
        public void TestRandomOperationalCount()
        {
            //Testlet -- Collection
            var testletCollection = new Dictionary <int, Question>();

            testletCollection = LoadQuestions.QuestionInformation();

            /*
             * Question -Id
             *          Question
             *          Order
             *          AnswerList
             *                      Id
             *                      Answer
             *                      AnswerType - Enum Type {Pretest , Operational}
             * var dictionary = new Dictionary<int, Question>
             * {
             *       { question1.Id, question1 },
             *       { question2.Id, question2 }
             * }
             */
            // Return the Question with ID 1
            var   question           = testletCollection[1];
            Int32 answerPretestCount = question.Answers.Skip(2)                                            // Start at appropriate index
                                       .Take(8)                                                            // Only consider the next three values
                                       .Where(x => x.Answertype == AnswerType.Operational).ToList().Count; // Filter appropriately

            Assert.AreEqual(answerPretestCount, 6);
        }
Exemplo n.º 3
0
        public void TestSecondAnswerType()
        {
            //Testlet -- Collection
            var testletCollection = new Dictionary <int, Question>();

            testletCollection = LoadQuestions.QuestionInformation();

            /*
             * Question -Id
             *          Question
             *          Order
             *          AnswerList
             *                      Id
             *                      Answer
             *                      AnswerType - Enum Type {Pretest , Operational}
             * var dictionary = new Dictionary<int, Question>
             * {
             *       { question1.Id, question1 },
             *       { question2.Id, question2 }
             * }
             */
            // Return the Question with ID 1
            var        question    = testletCollection[1];
            AnswerType pretestType = question.Answers[1].Answertype;

            Assert.AreEqual(pretestType, AnswerType.Pretest);
        }
    private void Start()
    {
        finalAnswerPrompt = GameObject.FindGameObjectWithTag("FinalAnswerStuff");

        if (finalAnswerPrompt != null)
        {
            finalAnswerPrompt.SetActive(false);
        }

        loadQuestion     = gameObject.AddComponent(typeof(LoadQuestions)) as LoadQuestions;
        scoreboardScript = gameObject.AddComponent(typeof(ScoreboardScript)) as ScoreboardScript;

        if (keywords != null)
        {
            if (recognizer == null)
            {
                recognizer = new KeywordRecognizer(keywords, confidence);
            }
            recognizer.OnPhraseRecognized += Recognizer_OnPhraseRecognized;
            recognizer.Start();
        }
        foreach (var device in Microphone.devices)
        {
            Debug.Log(device);
        }
    }
Exemplo n.º 5
0
        public QuestionsViewModel(IApplicationViewModel application = null, ISearchViewModel search = null, INetworkApi networkApi = null)
            : base(application)
        {
            NetworkApi    = networkApi ?? Api <INetworkApi>();
            Search        = Service(search);
            LoadQuestions = ReactiveCommand.CreateFromTask(LoadQuestionsImpl);
            Clear         = ReactiveCommand.Create(() =>
            {
                Questions.Clear();
            });
            Refresh = ReactiveCommand.CreateFromTask(async() =>
            {
                await Clear.Execute();
                await LoadQuestions.Execute();
            }, canExecute: Clear.CanExecute.CombineLatest(LoadQuestions.CanExecute, (canClearExecute, canLoadExecute) => canClearExecute && canLoadExecute));
            DisplayQuestion = ReactiveCommand.CreateFromTask(async(QuestionItemViewModel question) =>
            {
                await Application.Navigate.Handle(new NavigationParams(typeof(QuestionPage), question.Question));
            });

            this.WhenActivated(d =>
            {
                SelectedQuestion = null;

                d(Search.WhenAnyValue(s => s.SelectedSite)
                  .Skip(1)
                  .Select(svm => Unit.Default)
                  .InvokeCommand(this, vm => vm.Refresh));

                d(this.WhenAnyValue(s => s.SelectedQuestion)
                  .Skip(1)
                  .Where(question => question != null)
                  .InvokeCommand(this, vm => vm.DisplayQuestion));
            });
        }
    // Start is called before the first frame update
    void Start()
    {
        loadQuestionsClass = gameObject.AddComponent(typeof(LoadQuestions)) as LoadQuestions;

        // Image variables
        aBoxImage = GameObject.Find("A").GetComponent <Image>();
        bBoxImage = GameObject.Find("B").GetComponent <Image>();
        cBoxImage = GameObject.Find("C").GetComponent <Image>();
        dBoxImage = GameObject.Find("D").GetComponent <Image>();
    }