示例#1
0
        private void executeButton_Click(object sender, EventArgs e)
        {
            if (Global.GlobalFormMain.contentPanel.Controls.Count > 0)
            {
                checkSave();
            }
            if (this.ValidateChildren(ValidationConstraints.Enabled))
            {
                if (executingTypeLabel.Text.Equals(LocRM.GetString("stroopTest", currentCulture)))
                {
                    ExpositionController.BeginStroopTest(executingNameLabel.Text, participantComboBox.Text, markTextBox.Text[0], this);
                }

                else if (executingTypeLabel.Text.Equals(LocRM.GetString("reactionTest", currentCulture)))
                {
                    ExpositionController.BeginReactionTest(executingNameLabel.Text, participantComboBox.Text, markTextBox.Text[0], this);
                }
                else if (executingTypeLabel.Text.Equals(LocRM.GetString("experiment", currentCulture)))
                {
                    ExpositionController.BeginExperimentTest(executingNameLabel.Text, participantComboBox.Text, markTextBox.Text[0], this);
                }
                else if (executingTypeLabel.Text.Equals(LocRM.GetString("matchingTest", currentCulture)))
                {
                    ExpositionController.BeginMatchingTest(executingNameLabel.Text, participantComboBox.Text, markTextBox.Text[0], this);
                }
                else
                {
                    /* do nothing*/
                }
            }
        }
示例#2
0
        private async Task startTesting()
        {
            if (executingTest.ProgramInUse.IsOrderRandom && !executingTest.ProgramInUse.TrainingProgram)
            {
                executingTest.ProgramInUse.Shuffle();
            }
            else if (executingTest.ProgramInUse.IsOrderRandom && executingTest.ProgramInUse.TrainingProgram)
            {
                executingTest.ProgramInUse.ShuffleWithTrainingProgram();
            }
            int index = 0;

            foreach (Program program in executingTest.ProgramInUse.ProgramList)
            {
                index++;
                await Task.Delay(executingTest.ProgramInUse.IntervalTime);

                executingTest.ExpositionTime = DateTime.Now;

                if (program.GetType() == typeof(StroopProgram))
                {
                    ExpositionController.BeginStroopTest(program.ProgramName, executingTest.ParticipantName, executingTest.Mark, this);
                }
                else if (program.GetType() == typeof(ReactionProgram))
                {
                    ExpositionController.BeginReactionTest(program.ProgramName, executingTest.ParticipantName, executingTest.Mark, this);
                }
                else if (program.GetType() == typeof(MatchingProgram))
                {
                    ExpositionController.BeginMatchingTest(program.ProgramName, executingTest.ParticipantName, executingTest.Mark, this);
                }
                executingTest.writeLineOutput(index, program);
            }
            Program.writeOutputFile(outputFile, string.Join("\n", executingTest.Output.ToArray()));
            Close();
        }