private void additem() { im_item1 = mImagecontrol.GetImage(82, 74); BitmapImage bitim1 = new BitmapImage(); bitim1.BeginInit(); bitim1.UriSource = new Uri(FEITStandard.GetExePath() + "Paper\\PaperRes\\Example\\im_item1.bmp"); bitim1.EndInit(); im_item1.Stretch = Stretch.Fill; im_item1.Source = bitim1; this.BaseCanvas.Children.Add(im_item1); Canvas.SetTop(im_item1, actual_y + 185); Canvas.SetLeft(im_item1, actual_x + 290); im_item2 = mImagecontrol.GetImage(82, 74); BitmapImage bitim2 = new BitmapImage(); bitim2.BeginInit(); bitim2.UriSource = new Uri(FEITStandard.GetExePath() + "Paper\\PaperRes\\Example\\im_item2.bmp"); bitim2.EndInit(); im_item2.Stretch = Stretch.Fill; im_item2.Source = bitim2; this.BaseCanvas.Children.Add(im_item2); Canvas.SetTop(im_item2, actual_y + 185); Canvas.SetLeft(im_item2, actual_x + 429); }
private void loadMemOrderPractise() { TabFetcher fetcher = null; if (ARCTYPE == SECOND_ARCHI_TYPE.OPSPAN) { fetcher = new TabFetcher(FEITStandard.GetExePath() + "OP\\opspanword.txt", "\\t"); } else if (ARCTYPE == SECOND_ARCHI_TYPE.SYMMSPAN) { fetcher = new TabFetcher(FEITStandard.GetExePath() + "SYMM\\locationExe.txt", "\\t"); } fetcher.Open(); fetcher.GetLineBy();//skip header for (int i = 0; i < mMemPracScheme.Length; i++) { List <string> group = new List <string>(); for (int j = 0; j < mMemPracScheme[i]; j++) { List <string> line = fetcher.GetLineBy(); group.Add(line[2]); } mMemPrac.Add(group); } }
public static List <List <StPair> > GetLearningItems() { List <List <StPair> > retval = new List <List <StPair> >(); String BasePath = FEITStandard.GetExePath() + "PAIREDASSO\\"; int groupLen = PagePairedAsso.mGroupLen; TabFetcher fet = new TabFetcher(BasePath + "Learn.txt", "\\t"); fet.Open(); fet.GetLineBy(); List <String> line = null; for (int j = 0; j < REPEATS; j++) { List <StPair> group = new List <StPair>(); for (int i = 0; i < groupLen; i++) { line = fet.GetLineBy(); StPair pair = new StPair(); pair.First = line[1]; pair.Second = line[2]; group.Add(pair); } retval.Add(group); } fet.Close(); return(retval); }
public PaperInsUserControl() { InitializeComponent(); Canvas.SetLeft(image1, 0); Canvas.SetTop(image1, actual_y + 26); BitmapImage bitim = new BitmapImage(); bitim.BeginInit(); bitim.UriSource = new Uri(FEITStandard.GetExePath() + "Paper\\PaperRes\\Example\\paperins.jpg"); bitim.EndInit(); image1.Stretch = Stretch.Fill; image1.Source = bitim; }
//private int actual_x = FEITStandard.PAGE_BEG_X - 127; //private int actual_y = FEITStandard.PAGE_BEG_Y; public ExerciseTwoPage_Ins() { InitializeComponent(); BitmapImage bi = new BitmapImage(); bi.BeginInit(); bi.UriSource = new Uri(FEITStandard.GetExePath() + "Cube\\CubeRes\\cubinsExer2_ins.bmp"); bi.EndInit(); image1.Source = bi; Canvas.SetLeft(image1, 0); // actual_x + 12 Canvas.SetTop(image1, 0); // actual_y + 26 }
//private int actual_x = FEITStandard.PAGE_BEG_X - 127; //private int actual_y = FEITStandard.PAGE_BEG_Y; public ExerciseOnePage_Ins() { InitializeComponent(); BitmapImage bit = new BitmapImage(); bit.BeginInit(); bit.UriSource = new Uri(FEITStandard.GetExePath() + "Cube\\CubeRes\\cubinsExer1_ins.bmp"); bit.EndInit(); image_ins1.Source = bit; Canvas.SetLeft(image_ins1, 0); Canvas.SetTop(image_ins1, 0); }
private void loadTest() { if (ARCTYPE == SECOND_ARCHI_TYPE.OPSPAN) { mTest = readFixedFromFile( FEITStandard.GetExePath() + "OP\\opspan.txt", mTestScheme, 3); } else if (ARCTYPE == SECOND_ARCHI_TYPE.SYMMSPAN) { mTest = readFixedFromFile( FEITStandard.GetExePath() + "SYMM\\fixedItems.txt", mTestScheme, 3); } }
private void loadComprehPractise() { if (ARCTYPE == SECOND_ARCHI_TYPE.OPSPAN) { mComprehPrac = readFixedFromFile( FEITStandard.GetExePath() + "OP\\opspan.txt", mPracScheme, 1); } else if (ARCTYPE == SECOND_ARCHI_TYPE.SYMMSPAN) { mComprehPrac = readFixedFromFile( FEITStandard.GetExePath() + "SYMM\\fixedItems.txt", mPracScheme, 1); } }
private void mBaseCanvas_Loaded(object sender, RoutedEventArgs e) { PageCommon.InitCommonPageElements(ref mBaseCanvas); ClearAll(); if (!mbFixedItemMode) { //prepare data structures mGroups = GenGroups((new LoaderOpSpan("OPSPAN.csv")).GetTrails(), mGroupArrangement); mGroupsPrac = GenGroups((new LoaderOpSpan("OPSPANPrac.csv")).GetTrails(), mGroupArrangementPrac); } else//fixed mode { readFixedFromFile(FEITStandard.GetExePath() + "OP\\opspan.txt", ref mGroupsPrac, mGroupArrangementPrac, 1); readFixedFromFile(FEITStandard.GetExePath() + "OP\\opspan.txt", ref mGroups, mGroupArrangement, 5); } //replace equations here: mCurrentStatus = PageAttr.title; //systest //mCurrentStatus = PageAttr.test; //build BD int individualUnitCount = 0; for (int i = 0; i < mGroupArrangement.Length; i++) { individualUnitCount += mGroupArrangement[i]; } /*if (!mMainWindow.mDB.TableExists(Names.OPSAPN_EXPRESSION_TABLENAME)) * { * mMainWindow.mDB.CreateOpSpanExpressionTable(individualUnitCount); * } * * if (!mMainWindow.mDB.TableExists(Names.OPSPAN_ORDER_TABLENAME)) * { * mMainWindow.mDB.CreateOPSpanOrderTable(mGroupArrangement.Length); * }*/ nextStep(); }
private void showEndPage() { PARecorder rec = new PARecorder(this); rec.outputReport(FEITStandard.GetExePath() + "Report\\pa\\" + mMainWindow.mDemography.GenBriefString() + ".txt"); clearAll(); CompCentralText ct = new CompCentralText(); ct.PutTextToCentralScreen("本测验结束", "KaiTi", 32, ref amBaseCanvas, 0, Color.FromRgb(255, 255, 255)); //new FEITClickableScreen(ref amBaseCanvas, close); CompBtnNextPage btn = new CompBtnNextPage("结束测验"); btn.Add2Page(amBaseCanvas, FEITStandard.PAGE_BEG_Y + 470); btn.mfOnAction = testForward; }
public OrganizerPractiseChar(PageOpSpan page) : base(page) { int[] scheme = { 2, 3 }; mRealOrder = new List <List <int> >(); mAnswers = new List <List <int> >(); mCorrectness = new List <bool>(); mSW = new Stopwatch(); mRTs = new List <long>(); if (!mPage.mbFixedItemMode) { for (int i = 0; i < scheme.Length; i++) { mRealOrder.Add(getNonRepeatArray(scheme[i])); } } else//fixed mode { TabFetcher fetcher = new TabFetcher(FEITStandard.GetExePath() + "OP\\opspanword.txt", "\\t"); fetcher.Open(); fetcher.GetLineBy();//skip header for (int i = 0; i < scheme.Length; i++) { List <int> group = new List <int>(); for (int j = 0; j < scheme[i]; j++) { List <string> line = fetcher.GetLineBy(); group.Add(UIGroupNumChecksOS.GetIndexByChar(line[2])); } mRealOrder.Add(group); } fetcher.Close(); } mfNext = showInstruction; }
public OrganizerPractiseEquation(PageOpSpan page) : base(page) { mPage = page; mOSEM = new OpSpanEquationMaker(); mRDM = new Random(); mfNext = showInstruction; mRTs = new List <long>(); mWatch = new Stopwatch(); mAnswers = new List <bool>(); if (mPage.mbFixedItemMode) { mEquations = new List <StEquation>(); TabFetcher fetcher = new TabFetcher( FEITStandard.GetExePath() + "OP\\opspanbaseline.txt", "\\t"); fetcher.Open(); fetcher.GetLineBy();//skip header List <String> line; while ((line = fetcher.GetLineBy()).Count != 0) { StEquation equ = new StEquation(); equ.Equation = line[1]; equ.Result = Int32.Parse(line[2]); if (Int32.Parse(line[3]) == 1) { equ.Answer = true; } else { equ.Answer = false; } mEquations.Add(equ); } fetcher.Close(); } }
private void loadEquationPractise() { TabFetcher fetcher = null; if (ARCTYPE == SECOND_ARCHI_TYPE.OPSPAN) { fetcher = new TabFetcher( FEITStandard.GetExePath() + "OP\\opspanbaseline.txt", "\\t"); } else if (ARCTYPE == SECOND_ARCHI_TYPE.SYMMSPAN) { fetcher = new TabFetcher( FEITStandard.GetExePath() + "SYMM\\fixedSymmExeBaseline.txt", "\\t"); } fetcher.Open(); fetcher.GetLineBy();//skip header List <String> line; while ((line = fetcher.GetLineBy()).Count != 0) { StEquation equ = new StEquation(); equ.Equation = line[1]; equ.Result = Int32.Parse(line[2]); if (Int32.Parse(line[3]) == 1) { equ.Answer = true; } else { equ.Answer = false; } mInterPrac.Add(equ); } fetcher.Close(); }
public static List <List <StTest> > GetTestItems() { List <List <StTest> > retval = new List <List <StTest> >(); String BasePath = FEITStandard.GetExePath() + "PAIREDASSO\\"; int groupLen = PagePairedAsso.mGroupLen; TabFetcher fet = new TabFetcher(BasePath + "Test.txt", "\\t"); fet.Open(); fet.GetLineBy(); List <String> line = null; for (int k = 0; k < REPEATS; k++) { List <StTest> group = new List <StTest>(); for (int i = 0; i < groupLen; i++) { line = fet.GetLineBy(); StTest test = new StTest(); test.Pair.First = line[1]; test.Pair.Second = line[2]; for (int j = 0; j < 9; j++) { test.Chars9[j] = line[3 + j]; } test.CellAnswer1 = Int32.Parse(line[12]); test.CellAnswer2 = Int32.Parse(line[13]); group.Add(test); } retval.Add(group); } fet.Close(); return(retval); }
public ExerciseOnePage() { InitializeComponent(); BitmapImage bitim = new BitmapImage(); bitim.BeginInit(); bitim.UriSource = new Uri(FEITStandard.GetExePath() + "Cube\\CubeRes\\cubinsExer-1-0.bmp"); bitim.EndInit(); image1.Stretch = Stretch.Fill; image1.Source = bitim; Canvas.SetLeft(image1, actual_x + 27); Canvas.SetTop(image1, actual_y + 26); Canvas.SetLeft(label1, actual_x + 190); Canvas.SetTop(label1, actual_y + 527); Canvas.SetLeft(border1, actual_x + 59); Canvas.SetTop(border1, actual_y + 306); BitmapImage bitim2 = new BitmapImage(); bitim2.BeginInit(); bitim2.UriSource = new Uri(FEITStandard.GetExePath() + "Cube\\CubeRes\\cubinsExer-1.bmp"); bitim2.EndInit(); image2.Stretch = Stretch.Fill; image2.Source = bitim2; Canvas.SetLeft(image2, actual_x + 76); Canvas.SetTop(image2, actual_y + 356); BitmapImage bitim3 = new BitmapImage(); bitim3.BeginInit(); bitim3.UriSource = new Uri(FEITStandard.GetExePath() + "Cube\\CubeRes\\cubinsExer-2.bmp"); bitim3.EndInit(); image3.Stretch = Stretch.Fill; image3.Source = bitim3; Canvas.SetLeft(image3, actual_x + 210); Canvas.SetTop(image3, actual_y + 356); BitmapImage bitim4 = new BitmapImage(); bitim4.BeginInit(); bitim4.UriSource = new Uri(FEITStandard.GetExePath() + "Cube\\CubeRes\\cubinsExer-3.bmp"); bitim4.EndInit(); image4.Stretch = Stretch.Fill; image4.Source = bitim4; Canvas.SetLeft(image4, actual_x + 349); Canvas.SetTop(image4, actual_y + 356); BitmapImage bitim5 = new BitmapImage(); bitim5.BeginInit(); bitim5.UriSource = new Uri(FEITStandard.GetExePath() + "Cube\\CubeRes\\cubinsExer-3.bmp"); bitim5.EndInit(); image5.Stretch = Stretch.Fill; image5.Source = bitim5; Canvas.SetLeft(image5, actual_x + 487); Canvas.SetTop(image5, actual_y + 356); BitmapImage bitim6 = new BitmapImage(); bitim6.BeginInit(); bitim6.UriSource = new Uri(FEITStandard.GetExePath() + "Cube\\CubeRes\\cubinsExer-3.bmp"); bitim6.EndInit(); image6.Stretch = Stretch.Fill; image6.Source = bitim6; Canvas.SetLeft(image6, actual_x + 626); Canvas.SetTop(image6, actual_y + 356); Canvas.SetLeft(border2, actual_x + 64); Canvas.SetTop(border2, actual_y + 342); Canvas.SetLeft(border3, actual_x + 199); Canvas.SetTop(border3, actual_y + 342); Canvas.SetLeft(border4, actual_x + 336); Canvas.SetTop(border4, actual_y + 342); Canvas.SetLeft(border5, actual_x + 474); Canvas.SetTop(border5, actual_y + 342); Canvas.SetLeft(border6, actual_x + 612); Canvas.SetTop(border6, actual_y + 342); }
public BoardEquation(BasePage bp) { InitializeComponent(); amLabelOvertime.Visibility = System.Windows.Visibility.Hidden; mBasePage = bp; mLimit = new Timer(); mLimit.AutoReset = false; mLimit.Interval = mBasePage.mInterTimeLimit; mLimit.Elapsed += new ElapsedEventHandler(mLimit_Elapsed); if (mBasePage.ARCTYPE == SECOND_ARCHI_TYPE.SYMMSPAN) { amOKBtn.Content = "看好了"; amEquation.Visibility = System.Windows.Visibility.Hidden; amLabelOvertime.Margin = new Thickness(432, 586, 432, 126); amOKBtn.Margin = new Thickness(0, 400, 0, 0); } switch (mBasePage.mStage) { case Stage.InterPrac: //show if (mBasePage.ARCTYPE == SECOND_ARCHI_TYPE.OPSPAN) { amEquation.Content = mBasePage.mInterPrac[mBasePage.mCurInGrpAt].Equation; } else { Bitmap bmp = new Bitmap( FEITStandard.GetExePath() + "SYMM\\" + mBasePage.mInterPrac[mBasePage.mCurInGrpAt].Equation + ".bmp"); amImage.Source = BitmapSourceFactory.GetBitmapSource(bmp, out mpPic); } //rec mBasePage.mRecorder.mathPracEquations.Add(mBasePage.mInterPrac[mBasePage.mCurInGrpAt]); //show break; case Stage.ComprehPrac: //show if (mBasePage.ARCTYPE == SECOND_ARCHI_TYPE.OPSPAN) { amEquation.Content = mBasePage.mComprehPrac[mBasePage.mCurSchemeAt].mTrails[mBasePage.mCurInGrpAt].equation; } else if (mBasePage.ARCTYPE == SECOND_ARCHI_TYPE.SYMMSPAN) { Bitmap bmp = new Bitmap( FEITStandard.GetExePath() + "SYMM\\" + mBasePage.mComprehPrac[mBasePage.mCurSchemeAt].mTrails[mBasePage.mCurInGrpAt].equation + ".bmp"); amImage.Source = BitmapSourceFactory.GetBitmapSource(bmp, out mpPic); } //limit mLimit.Enabled = true; //rec mBasePage.mRecorder.mathExpression.Add( mBasePage.mComprehPrac[mBasePage.mCurSchemeAt].mTrails[mBasePage.mCurInGrpAt].equation); mBasePage.mRecorder.isPractise.Add(true); mBasePage.mRecorder.isExtra.Add(mBasePage.mSecondComprehPrac); mBasePage.mRecorder.displayedAnswer.Add( mBasePage.mComprehPrac[mBasePage.mCurSchemeAt].mTrails[mBasePage.mCurInGrpAt].result); mBasePage.mRecorder.animal.Add( mBasePage.mComprehPrac[mBasePage.mCurSchemeAt].mTrails[mBasePage.mCurInGrpAt].memTarget); mBasePage.mRecorder.correctness.Add( mBasePage.mComprehPrac[mBasePage.mCurSchemeAt].mTrails[mBasePage.mCurInGrpAt].correctness); mBasePage.mRecorder.equaLv.Add( mBasePage.mComprehPrac[mBasePage.mCurSchemeAt].mTrails[mBasePage.mCurInGrpAt].equationLevel); break; case Stage.Formal: //show if (mBasePage.ARCTYPE == SECOND_ARCHI_TYPE.OPSPAN) { amEquation.Content = mBasePage.mTest[mBasePage.mCurSchemeAt].mTrails[mBasePage.mCurInGrpAt].equation; } else if (mBasePage.ARCTYPE == SECOND_ARCHI_TYPE.SYMMSPAN) { Bitmap bmp = new Bitmap( FEITStandard.GetExePath() + "SYMM\\" + mBasePage.mTest[mBasePage.mCurSchemeAt].mTrails[mBasePage.mCurInGrpAt].equation + ".bmp"); amImage.Source = BitmapSourceFactory.GetBitmapSource(bmp, out mpPic); } //limit mLimit.Enabled = true; //rec mBasePage.mRecorder.mathExpression.Add( mBasePage.mTest[mBasePage.mCurSchemeAt].mTrails[mBasePage.mCurInGrpAt].equation); mBasePage.mRecorder.isPractise.Add(false); mBasePage.mRecorder.isExtra.Add(mBasePage.mSecondFormal); mBasePage.mRecorder.displayedAnswer.Add( mBasePage.mTest[mBasePage.mCurSchemeAt].mTrails[mBasePage.mCurInGrpAt].result); mBasePage.mRecorder.animal.Add( mBasePage.mTest[mBasePage.mCurSchemeAt].mTrails[mBasePage.mCurInGrpAt].memTarget); mBasePage.mRecorder.correctness.Add( mBasePage.mTest[mBasePage.mCurSchemeAt].mTrails[mBasePage.mCurInGrpAt].correctness); mBasePage.mRecorder.equaLv.Add( mBasePage.mTest[mBasePage.mCurSchemeAt].mTrails[mBasePage.mCurInGrpAt].equationLevel); break; } amEquation.Content += "?"; }
public ExerciseTwoPage() { InitializeComponent(); mbordercontrol = new bordercontrol(); mBorders = new List <Border>(); mImagecontrol = new Imagecontrol(); mImages = new List <Image>(); //窗口布局 BitmapImage bit = new BitmapImage(); bit.BeginInit(); bit.UriSource = new Uri(FEITStandard.GetExePath() + "Cube\\CubeRes\\cubinsExer-2-0.bmp"); bit.EndInit(); image1.Source = bit; Canvas.SetLeft(image1, actual_x + 27); Canvas.SetTop(image1, actual_y + 26); Canvas.SetLeft(border1, actual_x + 38); Canvas.SetTop(border1, actual_y + 285); Canvas.SetLeft(label1, actual_x + 190); Canvas.SetTop(label1, actual_y + 485); // for (int i = 0; i < 5; i++) { //border b = mbordercontrol.GenBorder(120, 130); mBorders.Add(b); this.canvas1.Children.Add(b); Canvas.SetTop(b, actual_y + bordertop); Canvas.SetLeft(b, actual_x + borderleft); borderleft = borderleft + borderadd; //image string temp = (i + 1).ToString(); im = mImagecontrol.GetImage(93, 100); BitmapImage bitim = new BitmapImage(); bitim.BeginInit(); bitim.UriSource = new Uri(FEITStandard.GetExePath() + "Cube\\CubeRes\\cubinsExer-2-" + temp + ".bmp"); bitim.EndInit(); im.Stretch = Stretch.Fill; im.Source = bitim; mImages.Add(im); this.canvas1.Children.Add(im); Canvas.SetTop(im, actual_y + imagetop); Canvas.SetLeft(im, actual_x + imageleft); imageleft = imageleft + imageadd; //Event im.MouseDown += new MouseButtonEventHandler(im_MouseDown); im.MouseEnter += new MouseEventHandler(im_MouseEnter); im.MouseLeave += new MouseEventHandler(im_MouseLeave); } }