예제 #1
0
        public static Preguntas GetList(PreguntaExamenList lista)
        {
            Preguntas list = new Preguntas();

            foreach (PreguntaExamenInfo item in lista)
            {
                list.AddItem(Pregunta.NewChild(item));
            }

            return(list);
        }
예제 #2
0
        public static PreguntaList GetList(PreguntaExamenList lista)
        {
            PreguntaList list = new PreguntaList();

            foreach (PreguntaExamenInfo item in lista)
            {
                list.AddItem(new PreguntaInfo(item));
            }

            return(list);
        }
        //private static void FormatReport(ExamenTestRpt rpt, List<PreguntaExamenInfo> preguntas)
        //{
        //    ReportDefinition report = (ReportDefinition)rpt.Subreports["RespuestaExamenListSubRpt"].ReportDefinition;

        //}

        //private static void FormatReport(ExamenDesarrolloRpt rpt, string logo)
        //{
        //    string path = Library.Common.ModuleController.LOGOS_EMPRESAS_PATH + logo;

        //    if (File.Exists(path))
        //    {
        //        Image image = Image.FromFile(path);
        //        int width = rpt.Section1.ReportObjects["Logo"].Width;
        //        int height = rpt.Section1.ReportObjects["Logo"].Height;

        //        rpt.Section1.ReportObjects["Logo"].Width = 15 * image.Width;
        //        rpt.Section1.ReportObjects["Logo"].Height = 15 * image.Height;
        //        rpt.Section1.ReportObjects["Logo"].Left += (width - 15 * image.Width) / 2;
        //        rpt.Section1.ReportObjects["Logo"].Top += (height - 15 * image.Height) / 2;
        //    }
        //}

        private static void FormatReport(PlantillaCorrectoraExamenRpt rpt, PreguntaExamenList list)
        {
            List <ReportObject> lista = new List <ReportObject>();

            lista.Add(rpt.Section3.ReportObjects["label1"]);
            lista.Add(rpt.Section3.ReportObjects["label2"]);
            lista.Add(rpt.Section3.ReportObjects["label3"]);
            lista.Add(rpt.Section3.ReportObjects["label4"]);
            lista.Add(rpt.Section3.ReportObjects["label5"]);
            lista.Add(rpt.Section3.ReportObjects["label6"]);
            lista.Add(rpt.Section3.ReportObjects["label7"]);
            lista.Add(rpt.Section3.ReportObjects["label8"]);
            lista.Add(rpt.Section3.ReportObjects["label9"]);
            lista.Add(rpt.Section3.ReportObjects["label10"]);
            lista.Add(rpt.Section3.ReportObjects["label11"]);
            lista.Add(rpt.Section3.ReportObjects["label12"]);
            lista.Add(rpt.Section3.ReportObjects["label13"]);
            lista.Add(rpt.Section3.ReportObjects["label14"]);
            lista.Add(rpt.Section3.ReportObjects["label15"]);
            lista.Add(rpt.Section3.ReportObjects["label16"]);
            lista.Add(rpt.Section3.ReportObjects["label17"]);
            lista.Add(rpt.Section3.ReportObjects["label18"]);
            lista.Add(rpt.Section3.ReportObjects["label19"]);
            lista.Add(rpt.Section3.ReportObjects["label20"]);
            lista.Add(rpt.Section3.ReportObjects["label21"]);
            lista.Add(rpt.Section3.ReportObjects["label22"]);
            lista.Add(rpt.Section3.ReportObjects["label23"]);
            lista.Add(rpt.Section3.ReportObjects["label24"]);
            lista.Add(rpt.Section3.ReportObjects["label25"]);
            lista.Add(rpt.Section3.ReportObjects["label26"]);
            lista.Add(rpt.Section3.ReportObjects["label27"]);
            lista.Add(rpt.Section3.ReportObjects["label28"]);
            lista.Add(rpt.Section3.ReportObjects["label29"]);
            lista.Add(rpt.Section3.ReportObjects["label30"]);
            lista.Add(rpt.Section3.ReportObjects["label31"]);
            lista.Add(rpt.Section3.ReportObjects["label32"]);
            lista.Add(rpt.Section3.ReportObjects["label33"]);
            lista.Add(rpt.Section3.ReportObjects["label34"]);
            lista.Add(rpt.Section3.ReportObjects["label35"]);
            lista.Add(rpt.Section3.ReportObjects["label36"]);
            lista.Add(rpt.Section3.ReportObjects["label37"]);
            lista.Add(rpt.Section3.ReportObjects["label38"]);
            lista.Add(rpt.Section3.ReportObjects["label39"]);
            lista.Add(rpt.Section3.ReportObjects["label40"]);
            lista.Add(rpt.Section3.ReportObjects["label41"]);
            lista.Add(rpt.Section3.ReportObjects["label42"]);
            lista.Add(rpt.Section3.ReportObjects["label43"]);
            lista.Add(rpt.Section3.ReportObjects["label44"]);
            lista.Add(rpt.Section3.ReportObjects["label45"]);
            lista.Add(rpt.Section3.ReportObjects["label46"]);
            lista.Add(rpt.Section3.ReportObjects["label47"]);
            lista.Add(rpt.Section3.ReportObjects["label48"]);
            lista.Add(rpt.Section3.ReportObjects["label49"]);
            lista.Add(rpt.Section3.ReportObjects["label50"]);
            lista.Add(rpt.Section3.ReportObjects["label51"]);
            lista.Add(rpt.Section3.ReportObjects["label52"]);
            lista.Add(rpt.Section3.ReportObjects["label53"]);
            lista.Add(rpt.Section3.ReportObjects["label54"]);
            lista.Add(rpt.Section3.ReportObjects["label55"]);
            lista.Add(rpt.Section3.ReportObjects["label56"]);
            lista.Add(rpt.Section3.ReportObjects["label57"]);
            lista.Add(rpt.Section3.ReportObjects["label58"]);
            lista.Add(rpt.Section3.ReportObjects["label59"]);
            lista.Add(rpt.Section3.ReportObjects["label60"]);
            lista.Add(rpt.Section3.ReportObjects["label61"]);
            lista.Add(rpt.Section3.ReportObjects["label62"]);
            lista.Add(rpt.Section3.ReportObjects["label63"]);
            lista.Add(rpt.Section3.ReportObjects["label64"]);
            lista.Add(rpt.Section3.ReportObjects["label65"]);
            lista.Add(rpt.Section3.ReportObjects["label66"]);
            lista.Add(rpt.Section3.ReportObjects["label67"]);
            lista.Add(rpt.Section3.ReportObjects["label68"]);
            lista.Add(rpt.Section3.ReportObjects["label69"]);
            lista.Add(rpt.Section3.ReportObjects["label70"]);
            lista.Add(rpt.Section3.ReportObjects["label71"]);
            lista.Add(rpt.Section3.ReportObjects["label72"]);
            lista.Add(rpt.Section3.ReportObjects["label73"]);
            lista.Add(rpt.Section3.ReportObjects["label74"]);
            lista.Add(rpt.Section3.ReportObjects["label75"]);
            lista.Add(rpt.Section3.ReportObjects["label76"]);
            lista.Add(rpt.Section3.ReportObjects["label77"]);
            lista.Add(rpt.Section3.ReportObjects["label78"]);
            lista.Add(rpt.Section3.ReportObjects["label79"]);
            lista.Add(rpt.Section3.ReportObjects["label80"]);
            lista.Add(rpt.Section3.ReportObjects["label81"]);
            lista.Add(rpt.Section3.ReportObjects["label82"]);
            lista.Add(rpt.Section3.ReportObjects["label83"]);
            lista.Add(rpt.Section3.ReportObjects["label84"]);
            lista.Add(rpt.Section3.ReportObjects["label85"]);
            lista.Add(rpt.Section3.ReportObjects["label86"]);
            lista.Add(rpt.Section3.ReportObjects["label87"]);
            lista.Add(rpt.Section3.ReportObjects["label88"]);
            lista.Add(rpt.Section3.ReportObjects["label89"]);
            lista.Add(rpt.Section3.ReportObjects["label90"]);
            lista.Add(rpt.Section3.ReportObjects["label91"]);
            lista.Add(rpt.Section3.ReportObjects["label92"]);
            lista.Add(rpt.Section3.ReportObjects["label93"]);
            lista.Add(rpt.Section3.ReportObjects["label94"]);
            lista.Add(rpt.Section3.ReportObjects["label95"]);
            lista.Add(rpt.Section3.ReportObjects["label96"]);
            lista.Add(rpt.Section3.ReportObjects["label97"]);
            lista.Add(rpt.Section3.ReportObjects["label98"]);
            lista.Add(rpt.Section3.ReportObjects["label99"]);
            lista.Add(rpt.Section3.ReportObjects["label100"]);
            lista.Add(rpt.Section3.ReportObjects["label101"]);
            lista.Add(rpt.Section3.ReportObjects["label102"]);
            lista.Add(rpt.Section3.ReportObjects["label103"]);
            lista.Add(rpt.Section3.ReportObjects["label104"]);
            lista.Add(rpt.Section3.ReportObjects["label105"]);
            lista.Add(rpt.Section3.ReportObjects["label106"]);
            lista.Add(rpt.Section3.ReportObjects["label107"]);
            lista.Add(rpt.Section3.ReportObjects["label108"]);
            lista.Add(rpt.Section3.ReportObjects["label109"]);
            lista.Add(rpt.Section3.ReportObjects["label110"]);
            lista.Add(rpt.Section3.ReportObjects["label111"]);
            lista.Add(rpt.Section3.ReportObjects["label112"]);
            lista.Add(rpt.Section3.ReportObjects["label113"]);
            lista.Add(rpt.Section3.ReportObjects["label114"]);
            lista.Add(rpt.Section3.ReportObjects["label115"]);
            lista.Add(rpt.Section3.ReportObjects["label116"]);
            lista.Add(rpt.Section3.ReportObjects["label117"]);
            lista.Add(rpt.Section3.ReportObjects["label118"]);
            lista.Add(rpt.Section3.ReportObjects["label119"]);
            lista.Add(rpt.Section3.ReportObjects["label120"]);
            lista.Add(rpt.Section3.ReportObjects["label121"]);
            lista.Add(rpt.Section3.ReportObjects["label122"]);
            lista.Add(rpt.Section3.ReportObjects["label123"]);
            lista.Add(rpt.Section3.ReportObjects["label124"]);
            lista.Add(rpt.Section3.ReportObjects["label125"]);
            lista.Add(rpt.Section3.ReportObjects["label126"]);
            lista.Add(rpt.Section3.ReportObjects["label127"]);
            lista.Add(rpt.Section3.ReportObjects["label128"]);
            lista.Add(rpt.Section3.ReportObjects["label129"]);
            lista.Add(rpt.Section3.ReportObjects["label130"]);
            lista.Add(rpt.Section3.ReportObjects["label131"]);
            lista.Add(rpt.Section3.ReportObjects["label132"]);
            lista.Add(rpt.Section3.ReportObjects["label133"]);
            lista.Add(rpt.Section3.ReportObjects["label134"]);
            lista.Add(rpt.Section3.ReportObjects["label135"]);
            lista.Add(rpt.Section3.ReportObjects["label136"]);
            lista.Add(rpt.Section3.ReportObjects["label137"]);
            lista.Add(rpt.Section3.ReportObjects["label138"]);
            lista.Add(rpt.Section3.ReportObjects["label139"]);
            lista.Add(rpt.Section3.ReportObjects["label140"]);

            int offset_c = 2160;
            int offset_r = 360;
            int top      = 660;
            int lA       = 780;
            int lB       = lA + 360;
            int lC       = lA + 720;

            foreach (PreguntaExamenInfo info in list)
            {
                if (info.Orden > 140)
                {
                    continue;
                }
                int col = (int)(info.Orden - 1) / 28;
                int row = (int)(info.Orden - 1) % 28;
                foreach (RespuestaExamenInfo r_info in info.RespuestaExamenes)
                {
                    lista[(int)info.Orden - 1].Top = top + (offset_r * row);
                    ((BoxObject)lista[(int)info.Orden - 1]).Bottom = top + (offset_r * row) + 240;

                    if (r_info.Correcta)
                    {
                        lista[(int)info.Orden - 1].ObjectFormat.EnableSuppress = false;
                        switch (r_info.Opcion)
                        {
                        case "A":
                        {
                            lista[(int)info.Orden - 1].Left = lA + (offset_c * col);
                        }
                        break;

                        case "B":
                        {
                            lista[(int)info.Orden - 1].Left = lB + (offset_c * col);
                        }
                        break;

                        case "C":
                        {
                            lista[(int)info.Orden - 1].Left = lC + (offset_c * col);
                        }
                        break;
                        }
                        ((BoxObject)lista[(int)info.Orden - 1]).Right = lista[(int)info.Orden - 1].Left + 240;
                    }
                }
            }
        }