Пример #1
0
        public void ProcesScannedImagesOneByOne(int pPage)
        {
            /*
             *this method one surveys
             */
            #region Read one

            txtResult.Clear();
            applicants.Clear();

            //kevinRemote
            label4.Text = "Test Numero : " + (pPage + 1).ToString();
            ProcesseFramesToFindSquares(images[pPage]);
            pictureBox1.Image = new System.Drawing.Bitmap(imagesNames[pPage]);
            label3.Text = imagesNames[pPage];
            ProcesseFrameToFindCircles(images[pPage], 0);

            // Add the applicant to the list of applicants
            Applicant applicant = new Applicant();
            applicant.fillApplicant(codeNumber, "  -  NOMBRE  TEST de prueba", questions);
            applicants.Add(applicant);

            // print applicant resutls
            //txtResult.AppendText(Environment.NewLine);
            //txtResult.AppendText("=============  APPLICANT N°  : " + codeNumber.ToString() + "  ==============");

            //each applicants result
            string[] row = new string[176 + 7];

            row[0] = txtCode.Text;
            if (opcion_01 == -1) row[1] = empty; else row[1] = (opcion_01 + 1).ToString();
            if (opcion_02 == -1) row[2] = empty; else row[2] = (opcion_02 + 1).ToString();
            if (codigo_sede == -1) row[3] = empty; else row[3] = (codigo_sede + 1).ToString();
            if (num_01 == -1) row[4] = empty; else row[4] = num_01.ToString();
            if (num_02 == -1) row[5] = empty; else row[5] = num_02.ToString();
            if (codigo_turno == -1) row[6] = empty; else row[6] = (codigo_semestre + 1).ToString();
            if (codigo_turno == -1) row[7] = empty; else row[7] = (codigo_turno + 1).ToString();
            for (int j = 0; j < applicants[0].getExam().Count(); j++)
            {
                //txtResult.AppendText(Environment.NewLine);
                //txtResult.AppendText("Pregunta ID: " + applicants[0].getExam()[j].getIdQuestion().ToString() + " - Answer :  " + applicants[0].getExam()[j].getAnswer());

                //To gridView

                row[j + 8] = applicants[0].getExam()[j].getAnswer();

            }
            addColumToGridView(row);

            //TODO : Comment to calibrate
            //BeginProcess = false;

            //clear resources used for each applicant
            questions.Clear();
            CleanAllList();
            #endregion
        }
Пример #2
0
        public void ProcesScannedImages()
        {
            /*
             *this method suports miltiple surveys at once image charge
             */
            #region Read all at once

            txtResult.Clear();
            applicants.Clear();

            for (int k = 0; k < TOTAL_APPLICANTS; k++)
            {
                int oneSurveyPages = TOTAL_SCANNED_PAPERS / TOTAL_APPLICANTS;

                // Survey for one person
                for (int i = k * oneSurveyPages; i < (k + 1) * oneSurveyPages; i++)
                {
                    ProcesseFramesToFindSquares(images[i]);

                    ProcesseFrameToFindCircles(images[i], 0);
                }

                // Add the applicant to the list of applicants
                Applicant applicant = new Applicant();
                applicant.fillApplicant(k + 1, "NOMBRE " + (k + 1).ToString(), questions);
                applicants.Add(applicant);

                // print applicant resutls
                //txtResult.AppendText(Environment.NewLine);
                //txtResult.AppendText("=============  APPLICANT N°  : " + (k + 1).ToString() + "  ==============");

                //each applicants result
                string[] row = new string[176 + 7];
                row[0] = txtCode.Text;
                if (opcion_01 == -1) row[1] = empty; else row[1] = (opcion_01 + 1).ToString();
                if (opcion_02 == -1) row[2] = empty; else row[2] = (opcion_02 + 1).ToString();
                if (codigo_sede == -1) row[3] = empty; else row[3] = (codigo_sede + 1).ToString();
                if (num_01 == -1) row[4] = empty; else row[4] = num_01.ToString();
                if (num_02 == -1) row[5] = empty; else row[5] = num_02.ToString();
                if (codigo_turno == -1) row[6] = empty; else row[6] = (codigo_semestre + 1).ToString();
                if (codigo_turno == -1) row[7] = empty; else row[7] = (codigo_turno + 1).ToString();

                for (int j = 0; j < applicants[0].getExam().Count(); j++)
                {
                    //txtResult.AppendText(Environment.NewLine);
                    //txtResult.AppendText("Pregunta ID: " + (1 + j).ToString() + " - Answer :  " + applicants[0].getExam()[j].getAnswer());

                    //To gridView
                    row[j + 8] = applicants[0].getExam()[j].getAnswer();
                }
                addColumToGridView(row);

                if (k == TOTAL_APPLICANTS - 1)
                //if (k == TOTAL_APPLICANTS )
                {
                    //TODO : Comment to calibrate
                    //BeginProcess = false;
                }

                //clear resources used for each applicant
                questions.Clear();
                ID_SEQUENCE = 0;

                CleanAllList();

            }

            #endregion
        }