Exemplo n.º 1
0
        public void ShowNext()
        {
            var res = this.Condition.GetNextTest();

            if (res == null)
            {
                this.preClose();
                return;
            }
            if (this.Condition.IdxCurrentTest == 0)
            {
                this.IsMdiContainer = true;
                TestForm first = new TestForm(this.Condition.CurrentTest, this, this.Width, this.Height, 4, time);
                InitChildForm(first);
                first.Show();
            }
            if (this.Condition.IdxCurrentTest == 1)
            {
                TestForm2 second = new TestForm2(this.Condition.CurrentTest, this.Condition.Callback, this);
                InitChildForm(second);
                second.Show();
            }
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            //var attempts = new FileParser().IMages((int)this.getTestID());
            this.Hide();
            var test_case = new List <SimplyTest>()
            {
                new SimplyTest()
                {
                    TestType = "OneWrong",
                    Question = new RenderObject()
                    {
                        StringValue = "Отметь \"лишний\" предмет", // вот тут текст вопросa
                        ImageValue  = null                         // картинка вопроса
                    },
                    Variables = new List <RenderObject>()
                    {
                        new RenderObject()
                        {
                            StringValue = "1",                                                      // вот тут текст который будет в варианте ответа
                            //ImageValue = Image.FromFile(@"C:\Users\Дарья\Documents\Visual Studio 2015\Projects\oksanas_kids\oksana_kids\bin\Debug\testsources\1\1\1.png") // ккатринка ответа
                            ImageValue = Image.FromFile(Path.GetFullPath(@"testsources\1\1\1.png")) // ккатринка ответа
                        },
                        new RenderObject()
                        {
                            StringValue = "2",
                            ImageValue  = Image.FromFile(Path.GetFullPath(@"testsources\1\1\2.jpg"))
                        },
                        new RenderObject()
                        {
                            StringValue = "3",
                            ImageValue  = Image.FromFile(Path.GetFullPath(@"testsources\1\1\3.png"))
                        },
                        new RenderObject()
                        {
                            StringValue = "4",
                            ImageValue  = Image.FromFile(Path.GetFullPath(@"testsources\1\1\4.jpg"))
                        }
                    },
                    RightIdx = 3 // индекс правильного ответа
                },
                new SimplyTest()
                {
                    TestType = "OneWrong",
                    Question = new RenderObject()
                    {
                        StringValue = "Отметь \"лишний\" предмет",
                        ImageValue  = null
                    },
                    Variables = new List <RenderObject>()
                    {
                        new RenderObject()
                        {
                            StringValue = "1",
                            ImageValue  = Image.FromFile(Path.GetFullPath(@"testsources\1\2\1.jpg"))
                        },
                        new RenderObject()
                        {
                            StringValue = "2",
                            ImageValue  = Image.FromFile(Path.GetFullPath(@"testsources\1\2\2.jpg"))
                        },
                        new RenderObject()
                        {
                            StringValue = "3",
                            ImageValue  = Image.FromFile(Path.GetFullPath(@"testsources\1\2\3.png"))
                        },
                        new RenderObject()
                        {
                            StringValue = "4",
                            ImageValue  = Image.FromFile(Path.GetFullPath(@"testsources\1\2\4.png"))
                        }
                    },
                    RightIdx = 2
                },
                new SimplyTest()
                {
                    TestType = "OneWrong",
                    Question = new RenderObject()
                    {
                        StringValue = "Отметь \"лишний\" предмет",
                        ImageValue  = null
                    },
                    Variables = new List <RenderObject>()
                    {
                        new RenderObject()
                        {
                            StringValue = "1",
                            ImageValue  = Image.FromFile(Path.GetFullPath(@"testsources\1\5\1.png"))
                        },
                        new RenderObject()
                        {
                            StringValue = "2",
                            ImageValue  = Image.FromFile(Path.GetFullPath(@"testsources\1\5\2.png"))
                        },
                        new RenderObject()
                        {
                            StringValue = "3",
                            ImageValue  = Image.FromFile(Path.GetFullPath(@"testsources\1\5\3.png"))
                        },
                        new RenderObject()
                        {
                            StringValue = "4",
                            ImageValue  = Image.FromFile(Path.GetFullPath(@"testsources\1\5\4.png"))
                        }
                    },
                    RightIdx = 3
                },
                new SimplyTest()
                {
                    TestType = "OneWrong",
                    Question = new RenderObject()
                    {
                        StringValue = "Какого цвета эти предметы?",
                        ImageValue  = Image.FromFile(Path.GetFullPath(@"testsources\1\4\4.jpg"))
                    },
                    Variables = new List <RenderObject>()
                    {
                        new RenderObject()
                        {
                            StringValue = "оранжевого"
                        },
                        new RenderObject()
                        {
                            StringValue = "красного"
                        },
                        new RenderObject()
                        {
                            StringValue = "желтого"
                        },
                        new RenderObject()
                        {
                            StringValue = "голубого"
                        }
                    },
                    RightIdx = 2
                }
            };

            Test.TestForm a = new Test.TestForm(test_case, this);
            a.Show();

            var simplyQuestion = new List <SimplyTest>()
            {
                new SimplyTest()
                {
                    TestType = "Juxtaposition",
                    Question = new RenderObject()
                    {
                        StringValue = "Разложи фрукты и ягоды по баночкам"
                    },
                    Questions = new List <RenderObject>()
                    {
                        new RenderObject()
                        {
                            ImageValue = Image.FromFile(@"testsources\1\3\1.jpg")
                        },
                        new RenderObject()
                        {
                            ImageValue = Image.FromFile(@"testsources\1\3\2.jpg")
                        }
                    },
                    Variables = new List <RenderObject>()
                    {
                        new RenderObject()
                        {
                            ImageValue = Image.FromFile(@"testsources\1\3\1-1.jpg")
                        },
                        new RenderObject()
                        {
                            ImageValue = Image.FromFile(@"testsources\1\3\1-2.jpg")
                        },
                        new RenderObject()
                        {
                            ImageValue = Image.FromFile(@"testsources\1\3\1-3.png")
                        },
                        new RenderObject()
                        {
                            ImageValue = Image.FromFile(@"testsources\1\3\1-4.jpg")
                        },
                        new RenderObject()
                        {
                            ImageValue = Image.FromFile(@"testsources\1\3\2-1.jpg")
                        },
                        new RenderObject()
                        {
                            ImageValue = Image.FromFile(@"testsources\1\3\2-2.jpg")
                        },
                        new RenderObject()
                        {
                            ImageValue = Image.FromFile(@"testsources\1\3\2-3.jpg")
                        },
                        new RenderObject()
                        {
                            ImageValue = Image.FromFile(@"testsources\1\3\2-4.jpg")
                        }
                    },
                    RightIdx = 30
                }
            };

            var imageSwapper = new TestForm2(simplyQuestion, this);

            imageSwapper.Show();
        }