示例#1
0
        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);
        }
示例#2
0
        public List <List <int> > GetFixedLocationExe()
        {
            //scheme 2, 3
            int[] scheme = { 2, 3 };
            List <List <int> > retval = new List <List <int> >();

            TabFetcher fet = new TabFetcher(mFixedLocationExeADDR, "\\t");

            fet.Open();
            fet.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 = fet.GetLineBy();
                    group.Add(Int32.Parse(line[2]) - 1);
                }
                retval.Add(group);
            }


            fet.Close();
            return(retval);
        }
示例#3
0
        public List <TrailSS_ST> GetFixedSymmExe()
        {
            List <TrailSS_ST> retval = new List <TrailSS_ST>();

            TabFetcher fet = new TabFetcher(mFixedSymmExeADDR, "\\t");

            fet.Open();
            List <String> line = null;

            fet.GetLineBy();//skip header
            //int i = 0;
            while ((line = fet.GetLineBy()).Count != 0)
            {
                //i++;
                TrailSS_ST st = new TrailSS_ST();
                st.FileName = line[1] + ".bmp";
                if (line[2] == "j")
                {
                    st.IsSymm = false;
                }
                else
                {
                    st.IsSymm = true;
                }

                retval.Add(st);
            }
            fet.Close();
            return(retval);
        }
        private void amBtnDel_Click(object sender, RoutedEventArgs e)
        {
            int index = amDataGrid.SelectedIndex;

            if (index != -1)
            {
                //read
                List <List <String> > table = new List <List <string> >();
                TabFetcher            fet   = new TabFetcher(AroraCore.OUT_PATH, "\\t");
                fet.Open();
                List <string> lineBuf = null;
                while ((lineBuf = fet.GetLineBy()).Count != 0)
                {
                    table.Add(lineBuf);
                }
                fet.Close();
                //remove
                table.RemoveAt(index + 1);
                //write
                File.Delete(AroraCore.OUT_PATH);
                TabCharter charter = new TabCharter(AroraCore.OUT_PATH);
                charter.Create(table[0]);
                for (int i = 1; i < table.Count; i++)
                {
                    charter.Append(table[i]);
                }

                amDataGrid.DataContext = readRecBriefList();
            }
        }
示例#5
0
        public List <List <String> > GetStudyContent()
        {
            _tf.Open();

            loadTable();

            _tf.Close();

            return(_tableContent);
        }
示例#6
0
 public void Fetch(int index)
 {
     mFetch.Open();
     if (index != -1)
     {
         mLine = mFetch.GetLineAt(index);
     }
     else
     {
         mLine = mFetch.GetLineAt(mFetch.GetLineCount() - 2);
     }
     mFetch.Close();
 }
示例#7
0
        public List <SybSrhItem> GetContext(String filepath)//   ()
        {
            //  tf = new TabFetcher(fpath, "\\t");
            _test = new List <SybSrhItem>();

            tf = new TabFetcher(filepath, "\\t");

            tf.Open();

            loadTable();

            tf.Close();

            return(_test);
        }
示例#8
0
文件: TestReader.cs 项目: ellil4/PCAT
        public TestReader()
        {
            _testTf = new TabFetcher(_testFilePath, "\\t");

            _tableContent = new List <List <string> >();

            _TestList = new List <List <string> >();

            _ResultList = new List <List <string> >();

            _testTf.Open();

            loadTable();

            _testTf.Close();

            needList();
        }
示例#9
0
        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;
        }
示例#10
0
        public List <TrailsGroupSS> GetFixedItemGroups(int[] scheme)
        {
            List <TrailsGroupSS> retval  = new List <TrailsGroupSS>();
            TabFetcher           fetcher = new TabFetcher(mFixedItemsADDR, "\\t");

            fetcher.Open();

            //jump over exe
            for (int a = 0; a < 5; a++)//5 = 2 + 2  + 1(header)
            {
                fetcher.GetLineBy();
            }

            for (int i = 0; i < scheme.Length; i++)
            {
                TrailsGroupSS ss = new TrailsGroupSS();
                for (int j = 0; j < scheme[i]; j++)
                {
                    List <String> line = fetcher.GetLineBy();

                    TrailSS_ST st = new TrailSS_ST();
                    st.FileName = line[1] + ".bmp";
                    if (line[2] == "j")
                    {
                        st.IsSymm = false;
                    }
                    else
                    {
                        st.IsSymm = true;
                    }
                    st.Position = Int32.Parse(line[3]) - 1;
                    ss.Trails.Add(st);
                }

                retval.Add(ss);
            }

            fetcher.Close();
            return(retval);
        }
示例#11
0
        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();
            }
        }
示例#12
0
        public PageCube(MainWindow _mainWindow)
        {
            InitializeComponent();
            mMainWindow = _mainWindow;
            this.Focus();
            mLayoutInstruction = new LayoutInstruction(ref mBaseCanvas);

            mLines = new List <List <string> >();//存放一套测试结果
            //   mLines.Capacity = line_num;
            resline = new List <string>();

            mTimer = new FEITTimer();
            rtime  = new Stopwatch();
            tf.Open();

            //set record location and file name
            file_Loca   = "Report\\CubeTest_result_file\\" + mMainWindow.mDemography.GenBriefString() + ".txt";
            mTabCharter = new TabCharter(file_Loca);//写入硬盘

            mCountDownUI = new CompCountDown();
            mCountDownUI.FunctionElapsed = goNextQuestion;
        }
示例#13
0
        private List <StTrailGroupOS> readFixedFromFile(string path, int[] scheme, int begFromLine)
        {
            TabFetcher fet = new TabFetcher(path, "\\t");

            fet.Open();

            for (int k = 0; k < begFromLine; k++)
            {
                fet.GetLineBy();//skip lines
            }
            List <StTrailGroupOS> groups = new List <StTrailGroupOS>();

            //practise
            for (int i = 0; i < scheme.Length; i++)
            {
                StTrailGroupOS group = new StTrailGroupOS();
                for (int j = 0; j < scheme[i]; j++)
                {
                    List <String> line = fet.GetLineBy();
                    StTrailOS_ST  st   = new StTrailOS_ST();
                    st.equation = line[1];
                    st.result   = line[2];
                    if (Int32.Parse(line[3]) == 1)
                    {
                        st.correctness = true;
                    }
                    else
                    {
                        st.correctness = false;
                    }
                    st.memTarget     = line[4];
                    st.equationLevel = line[9];
                    group.mTrails.Add(st);
                }
                groups.Add(group);
            }
            fet.Close();
            return(groups);
        }
示例#14
0
        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);
        }
示例#15
0
 public PaperReadFile(PagePaper _PagePaper)
 {
     vPagePaper = _PagePaper;
     tf.Open();
     loadTableHead();
 }