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; } }
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(); } } } }