示例#1
0
        // load form - align elements and set up test
        private void frmStroop_Load(object sender, EventArgs e)
        {
            CogTest.setControlVisibility(this, false);
            if (this.testStatus == CogTest.TEST_DEMO)
            {
                // demo screen - show three different labels
                Point center = new Point(this.ClientSize.Width / 2, this.ClientSize.Height / 2);
                lblDisplay.Text = "55555";
                lblDisplay.Left = (ClientSize.Width - lblDisplay.Width) / 2;
                lblDisplay.Top  = (ClientSize.Height - lblDisplay.Height) / 2 + 100;
                Label lblDemo1 = new Label();
                Label lblDemo2 = new Label();
                this.addLabel(lblDemo1, "3333", new Point(
                                  (center.X - lblDisplay.Width) / 2, center.Y - lblDisplay.Height - 100));
                this.addLabel(lblDemo2, "444", new Point(
                                  (center.X + lblDemo1.Left), center.Y - lblDisplay.Height - 100));
                this.BackColor = CogTest.DEMO_COLOR;
                CogTest.enableDoubleEnterAdvance(this);
                CogTest.setControlVisibility(this, true);
            }
            else
            {
                lblDisplay.Left = (ClientSize.Width - lblDisplay.Width) / 2;
                lblDisplay.Top  = (ClientSize.Height - lblDisplay.Height) / 2;

                // practice test    - 1 block with 16 trials (8 congruent, 8 incongruent)
                // or official test - 4 blocks with 32 trials (16 congruent, 16 incongruent)
                curTest = (this.testStatus == CogTest.TEST_PRACTICE) ? new StroopTest(1, 16) : new StroopTest(4, 32);
                showFixation();
                CogTest.setControlVisibility(this, true);
            }
        }
示例#2
0
        // main splash screen (blue)
        public static void mainSplash(string name, Form owner)
        {
            frmSplash frm = new frmSplash();

            frm.lblName.Text        = name;
            frm.lblInstruct.Visible = false;
            frm.BackColor           = Color.FromArgb(0, 0, 64);
            CogTest.enableDoubleEnterAdvance(frm);
            frm.ShowDialog(owner);
        }
示例#3
0
        // official test splash screen (green)
        public static void testSplash(string name, Form owner)
        {
            frmSplash frm = new frmSplash();

            frm.lblName.Text        = name;
            frm.lblInstruct.Visible = true;
            frm.lblInstruct.Text    = "Official Test";
            frm.BackColor           = Color.FromArgb(0, 64, 0);
            CogTest.enableDoubleEnterAdvance(frm);
            frm.ShowDialog(owner);
        }
示例#4
0
        // final splash screen (yellow)
        public static void finalSplash(Form owner)
        {
            frmSplash frm = new frmSplash();

            frm.lblName.Text        = "The End";
            frm.lblInstruct.Visible = true;
            frm.lblInstruct.Text    = "Thank you!";
            frm.BackColor           = Color.FromArgb(64, 64, 0);
            CogTest.enableDoubleEnterAdvance(frm);
            frm.ShowDialog(owner);
        }
示例#5
0
        private void frmSpeed_Load(object sender, EventArgs e)
        {
            grid[0] = lbl0;
            grid[1] = lbl1;
            grid[2] = lbl2;
            grid[3] = lbl3;
            grid[4] = lbl4;
            grid[5] = lbl5;
            grid[6] = lbl6;
            grid[7] = lbl7;
            grid[8] = lbl8;
            grid[9] = lbl9;

            btns[0] = btnA;
            btns[1] = btnB;
            btns[2] = btnC;
            btns[3] = btnD;

            lblBtns[0] = lblBtnA;
            lblBtns[1] = lblBtnB;
            lblBtns[2] = lblBtnC;
            lblBtns[3] = lblBtnD;

            CogTest.setControlVisibility(this, false);

            alignElements();

            if (testStatus == CogTest.TEST_DEMO)
            {
                // demo screen - use what's in the designer
                this.BackColor = CogTest.DEMO_COLOR;
                CogTest.enableDoubleEnterAdvance(this);
                CogTest.setControlVisibility(this, true);
                lblQuestion.Focus();
            }
            else
            {
                // display the actual test
                newGrid();
                nextTrial();
                formTimer.Interval = STOPWATCH_CHECK_INTVL;
                CogTest.setControlVisibility(this, true);
                lblQuestion.Focus();
                formTimer.Start();
                testStopwatch.Start();
            }
        }
示例#6
0
        private void frmCorsi_Load(object sender, EventArgs e)
        {
            boxes[0] = btn0;
            boxes[1] = btn1;
            boxes[2] = btn2;
            boxes[3] = btn3;
            boxes[4] = btn4;
            boxes[5] = btn5;
            boxes[6] = btn6;
            boxes[7] = btn7;
            boxes[8] = btn8;

            CogTest.setControlVisibility(this, false);
            setupForm();
            if (testStatus == CogTest.TEST_DEMO)
            {
                // show demo screen
                this.BackColor = CogTest.DEMO_COLOR;
                CogTest.enableDoubleEnterAdvance(this);
                CogTest.setControlVisibility(this, true);
                btnSubmit.Visible = false;
                panel.Focus();
            }
            else
            {
                // practice test has 3 trials, official test has 15
                corsi = (this.testStatus == CogTest.TEST_PRACTICE) ?
                        new CorsiTest(3, true, ref answerSeq) : new CorsiTest(15, false, ref answerSeq);

                CogTest.setControlVisibility(this, true);
                foreach (Button btn in boxes)
                {
                    btn.Visible = true;
                }
                setEnabledStatus(false);

                System.Threading.Thread.Sleep(1500);     // wait about 1.5 seconds before showing the first trial
                showNextTrial();
            }
        }
示例#7
0
        private void frmRaven_Load(object sender, EventArgs e)
        {
            CogTest.setControlVisibility(this, false);
            rand = new Random();

            btns    = new Button[8];
            btns[0] = btn0;
            btns[1] = btn1;
            btns[2] = btn2;
            btns[3] = btn3;
            btns[4] = btn4;
            btns[5] = btn5;
            btns[6] = btn6;
            btns[7] = btn7;

            lbls    = new Label[8];
            lbls[0] = lbl0;
            lbls[1] = lbl1;
            lbls[2] = lbl2;
            lbls[3] = lbl3;
            lbls[4] = lbl4;
            lbls[5] = lbl5;
            lbls[6] = lbl6;
            lbls[7] = lbl7;

            // align main picture box
            picBox.Width  = 550;
            picBox.Height = Math.Min((int)(this.ClientSize.Height / 2.5), 440);
            picBox.Left   = (ClientSize.Width - picBox.Width) / 2;
            picBox.Top    = 20;//-20;

            // test summary data
            numCorrect = 0;

            switch (this.testStatus)
            {
            case CogTest.TEST_DEMO:
                // show what is currently on form for demo mode
                this.BackColor = CogTest.DEMO_COLOR;
                CogTest.enableDoubleEnterAdvance(this);
                alignButtons(8);
                CogTest.setControlVisibility(this, true);
                break;

            case CogTest.TEST_PRACTICE:
                questions = new ArrayList(2);
                questions.Add(-1);
                questions.Add(-2);
                numUnfinished = 2;
                CogTest.setControlVisibility(this, true);
                showNextQuestion();
                break;

            case CogTest.TEST_OFFICIAL:
                questions     = CogTest.createRandomList(1, 10, 10, ref rand);
                numUnfinished = 10;

                // set visibility before loading the question because the question may only need 6 butons
                CogTest.setControlVisibility(this, true);
                showNextQuestion();

                testTimer.Start();
                stopwatch.Start();
                break;
            }

            picBox.Focus();
        }