Ejemplo n.º 1
0
        public SybSrhResult(bool ans, long rt, SybSrhItem item)
        {
            Answer = ans;
            RT     = rt;

            for (int i = 0; i < item.Target.Length; i++)
            {
                item.Target[i].BMP = null;
            }

            for (int i = 0; i < item.Selection.Length; i++)
            {
                item.Selection[i].BMP = null;
            }

            Item = item;

            if (ans == SybSrhItemGenerator.hasTrueTarget(item))
            {
                Correctness = true;
            }
            else
            {
                Correctness = false;
            }
        }
Ejemplo n.º 2
0
        public PageSybSrh(MainWindow mw)
        {
            InitializeComponent();
            mMainWindow = mw;
            mImages     = new List <CompImage>();
            mResult     = new List <SybSrhResult>();
            //mSpanResult = new List<SybSrhResult>();
            if (!mbFixedMode)
            {
                mGen = new SybSrhItemGenerator();
            }
            else
            {
                mFixedReader = new SybSrhFixedReader();
                getFixedDataReady();
            }

            mTimer      = new FEITTimer();
            mWasteIPtrs = null;

            if (DEV_MODE)
            {
                MAXTRAILCOUNT = 12;
            }

            m2Minute = new Stopwatch();

            /* if (mMainWindow.mDB != null)
             * {
             *   if (!mMainWindow.mDB.TableExists(Names.SYMBOL_SEARCH_TABLENAME))
             *   {
             *       mMainWindow.mDB.CreateSymbolSearchTable(mItems.Count);
             *   }
             * }*/

            Cursor = Cursors.None;
        }
Ejemplo n.º 3
0
        private void Page_KeyUp(object sender, KeyEventArgs e)
        {
            if (mStatus == STATUS.TITLE ||
                mStatus == STATUS.INSTRUCTION ||
                mStatus == STATUS.INSTRUCTION2 ||
                mStatus == STATUS.INSTRUCTION3 ||
                mStatus == STATUS.INSTRUCTION4)
            {
                if (e.Key == Key.Space)
                {
                    if (mStatus == STATUS.INSTRUCTION)
                    {
                        mStatus = STATUS.ON_PRAC;
                    }
                    if (mStatus == STATUS.TITLE)
                    {
                        mStatus = STATUS.INSTRUCTION;
                    }

                    Next();
                }
            }
            else if ((mStatus == STATUS.TEST) && mDidCount < MAXTRAILCOUNT)
            {
                mTimer.Stop();
                mDidCount++;
                if (e.Key == Key.J)
                {
                    mResult.Add(new SybSrhResult(true, mTimer.GetElapsedTime(), mItems[mCurTillIdx - 1]));
                    Next();
                }
                else if (e.Key == Key.F)
                {
                    mResult.Add(new SybSrhResult(false, mTimer.GetElapsedTime(), mItems[mCurTillIdx - 1]));
                    Next();
                }
            }
            else if (mStatus == STATUS.ON_PRAC && !mPressLock)
            {
                mTimer.Stop();

                //show label
                mExeInfomlabel            = new Label();
                mExeInfomlabel.FontFamily = new System.Windows.Media.FontFamily("KaiTi");
                mExeInfomlabel.FontSize   = 35;
                amCanvas.Children.Add(mExeInfomlabel);
                Canvas.SetTop(mExeInfomlabel, FEITStandard.PAGE_BEG_Y + 500);
                Canvas.SetLeft(mExeInfomlabel, FEITStandard.PAGE_BEG_X + (800 - 70) / 2);


                if (e.Key == Key.J)
                {
                    if (SybSrhItemGenerator.hasTrueTarget(mItems[mPracIndex - 1]))
                    {
                        //say true 500ms
                        exeRightBehavior();
                    }
                    else
                    {
                        //say false 500ms
                        exeWrongBehavior();
                    }
                }
                else if (e.Key == Key.F)
                {
                    if (!SybSrhItemGenerator.hasTrueTarget(mItems[mPracIndex - 1]))
                    {
                        //say true 500ms
                        exeRightBehavior();
                    }
                    else
                    {
                        //say false 500ms
                        exeWrongBehavior();
                    }
                }
            }
        }