Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        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();
            }
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
0
        public List <List <String> > GetStudyContent()
        {
            _tf.Open();

            loadTable();

            _tf.Close();

            return(_tableContent);
        }
Ejemplo n.º 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();
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 8
0
        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();
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 12
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);
        }
Ejemplo n.º 13
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);
        }
Ejemplo n.º 14
0
        private void nextStep()//页面显示流程
        {
            if (line_num_count < line_num)
            {
                if (mFirstTime)
                {
                    ClearAll();
                    orga       = new OrganizerTrailCubes(this);
                    mFirstTime = false;
                }

                if (wrong_count >= 3)
                {
                    wrongTestOver();
                }
                if (wrong_count < 3 && hide_count >= 2)
                {
                    _isDisplayhide = false;
                }
                if (_isDisplayhide && wrong_count < 3)
                {
                    nextQuestionLabel();
                    mBaseCanvas.Children.Remove(tip_display);
                    tipDisplay();
                    orga.optEnable = true;
                    orga.clearSeSelGraphs();
                    Question_test.Clear();
                    hide_count++;
                    loadTest();

                    orga.CubeLayout();
                    //_flash_Display.Start();
                    //  t_Display.Start();
                }
                else if (!_isDisplayhide && wrong_count < 3)
                {
                    nextQuestionLabel();
                    if (line_num_count == line_num - 2)
                    {
                        nextQuestion.Content = "测试结束";
                        nextQuestion.Width   = 130;
                    }
                    //keyTimeTrigger();//总体计时器
                    mBaseCanvas.Children.Remove(tip_display);
                    tipDisplay();
                    orga.optEnable = true;


                    orga.clearSeSelGraphs();
                    Question_test.Clear();
                    line_num_count++;
                    loadTest();

                    orga.CubeLayout();
                    //_flash_Display.Start();
                    //  t_Display.Start();
                }
            }
            else
            {
                mTimer.Stop();
                //t_Display.Close();
                outPutresult();
                tf.Close();
                ClearAll();
                ClearArrayList();
                laodReport();
            }
        }