Esempio n. 1
0
        private void next()
        {
            if (current_index == totalCards)
            {
                MessageBox.Show(" End correct = " + correct + " incorrect = " + incorrect);
                quizPlayer.Close();
                this.Close();
            }
            else
            {
                Answer_box.Visible = false;
                label4.Visible     = false;

                if (quizType == Constant.imageDeck)
                {
                    pictureBox1.Visible  = true;
                    pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
                    Bitmap MyImage = new Bitmap(Constant.ePath + question[current_index]);
                    pictureBox1.Image = (Image)MyImage;
                    label3.Text       = "Q " + (current_index + 1).ToString() + ": What is name of the picture?";
                }
                else if (quizType == Constant.soundDeck)
                {
                    button2.Visible = true;
                    quizPlayer.Close();
                    button2.Text = "Play";
                    isplaying    = false;
                    quizPlayer.Open(Constant.ePath + question[current_index]);
                    label3.Text = "Q " + (current_index + 1).ToString() + ": What is the name of this Song?";
                }
                else
                {
                    label3.Visible = false;
                    quizPlayer.Close();
                    isplaying            = false;
                    richTextBox1.Visible = true;
                    richTextBox1.Text    = makeRTBtext(question[current_index]);
                    richTextBox1.Text    = "Q " + (current_index + 1).ToString() + " What is the definition of :" + richTextBox1.Text;
                    //label1.Text=" What is the definitiin?";
                }
                current_index++;
            }
        }
Esempio n. 2
0
        //  PictureBox pictureBox2;

        public VisualViewer()


        {
            InitializeComponent();
            imagelocation = "c:\\1.JPG";
            Play.Visible  = false;
            Stop.Visible  = false;
            label1.Text   = "name = !@!#@#12#!@$@!#%$%#$@%$#@%";
            test.Open("c:\\1.mp3");
            //pictures.add(new PictureBox());


            //pictures[1] = new PictureBox();
            //pictures[1].ImageLocation=imagelocation;
            ///pictures[1].Show();
            //pictures[1].Visible = true;
            //pictures[1].Location = new Point(1, 1);
            //pictureBox2 = new PictureBox();
            // MessageBox.Show(" i am here");

            // pictureBox2.ImageLocation= imagelocation;
            //pictureBox2.Image = System.Drawing.Image.FromFile(imagelocation);
        }
Esempio n. 3
0
        static void newButton_Click(object sender, EventArgs e)
        {
            Player player = ((PlayButton)sender).player;

            if (((PlayButton)sender).isPlaying)
            {
                ((PlayButton)sender).isPlaying = false;
                player.Close(((PlayButton)sender).alias);
                ((PlayButton)sender).Text = "PLAY";
            }
            else
            {
                player.Open(Constant.ePath + ((PlayButton)sender).fileToPlay, ((PlayButton)sender).alias);
                player.Play(true, ((PlayButton)sender).alias);
                ((PlayButton)sender).isPlaying = true;
                ((PlayButton)sender).Text      = "STOP";
            }
        }
Esempio n. 4
0
        private void next()
        {
            RichTextBox temp = new RichTextBox();

            if (current_index == totalCards)
            {
                if (wrongList.Length == 1)
                {
                    MessageBox.Show("PERFECT");
                }
                else
                {
                    MessageBox.Show(" Quiz End!! correct = " + correct + "\nWords Incorrect:" + wrongList);
                }
                quizPlayer.Close();
                this.Close();
            }
            else
            {
                if (current_index > 0)
                {
                    temp.LoadFile(Constant.ePath + answer[current_index - 1], RichTextBoxStreamType.RichText);
                    correctAnswer = temp.Text;


                    if (wordEqual(textBox1.Text, correctAnswer))
                    {
                        correct++;
                        //MessageBox.Show(word[index] + "==" + textBox1.Text);
                    }
                }

                textBox1.Text = "";
                if (quizType == Constant.imageDeck)
                {
                    pictureBox1.Visible  = true;
                    pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
                    Bitmap MyImage = new Bitmap(Constant.ePath + question[current_index]);
                    pictureBox1.Image = (Image)MyImage;
                    label1.Text       = "Q " + (current_index + 1).ToString() + ": What is name of the picture?";
                }
                else if (quizType == Constant.soundDeck)
                {
                    button1.Visible = true;
                    button1.Text    = "Play";
                    quizPlayer.Close();
                    isplaying = false;
                    quizPlayer.Open(Constant.ePath + question[current_index]);
                    label1.Text = "Q " + (current_index + 1).ToString() + ": What is the name of this Song?";
                }
                else
                {
                    label1.Visible       = false;
                    richTextBox1.Visible = true;
                    richTextBox1.Text    = makeRTBtext(question[current_index]);
                    richTextBox1.Text    = "Q " + (current_index + 1).ToString() + " What word means :  \n" + richTextBox1.Text;
                    //label1.Text=" What is the definition?";
                }
                current_index++;
            }
        }
Esempio n. 5
0
        private void next()
        {
            RichTextBox temp  = new RichTextBox();
            TextBox     temp2 = new TextBox();

            int []  indexRand = generateRandom4(totalCards);
            Boolean done      = false;
            Random  rand      = new Random();

            if (current_index == totalCards)
            {
                if (wrongList.Length == 1)
                {
                    MessageBox.Show("PERFECT  ^_^ all  " + totalCards + " questions correct");
                }
                else
                {
                    MessageBox.Show("End!  you got " + correct.ToString() + "\n\nwords incorrect: " + wrongList);
                }
                quizPlayer.Close();
                this.Close();
            }
            else
            {
                for (int i = 0; i < 4; i++)
                {
                    choice[i] = answer[indexRand[i]];
                    if (indexRand[i] == current_index)
                    {
                        correctposition = i;
                        temp.LoadFile(Constant.ePath + choice[correctposition], RichTextBoxStreamType.RichText);
                        //temp.ToString
                        correctAnswer = temp.Text;
                        // MessageBox.Show(temp.Text);
                        done = true;
                    }
                }

                if (!done)
                {
                    correctposition = rand.Next(100) % 4;
                    //MessageBox.Show("here "+correctposition.ToString());
                    choice[correctposition] = answer[current_index];


                    temp.LoadFile(Constant.ePath + choice[correctposition], RichTextBoxStreamType.RichText);
                    correctAnswer = temp.Text;
                    //MessageBox.Show(temp.Text);
                }
                //////// now the answer is in the correction position and 3 random choice is made//////


                richTextBox1.Text = makeRTBtext(choice[0]);
                richTextBox2.Text = makeRTBtext(choice[1]);
                richTextBox3.Text = makeRTBtext(choice[2]);
                richTextBox4.Text = makeRTBtext(choice[3]);

                ////////////////////// answers is displayed/////////////////////


                if (quizType == Constant.imageDeck)
                {
                    pictureBox1.Visible  = true;
                    pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
                    Bitmap MyImage = new Bitmap(Constant.ePath + question[current_index]);
                    pictureBox1.Image = (Image)MyImage;
                    label1.Text       = "Q " + (current_index + 1).ToString() + ": What is name of the picture?";
                }
                else if (quizType == Constant.soundDeck)
                {
                    button5.Visible = true;
                    quizPlayer.Close();
                    isplaying = false;
                    quizPlayer.Open(Constant.ePath + question[current_index]);
                    label1.Text = "Q " + (current_index + 1).ToString() + ": What is the name of this Song?";
                }
                else
                {
                    label1.Visible       = false;
                    richTextBox5.Visible = true;
                    richTextBox5.Text    = makeRTBtext(question[current_index]);
                    richTextBox5.Text    = "Q " + (current_index + 1).ToString() + " What is the definition of :" + richTextBox5.Text;
                    //label1.Text=" What is the definitiin?";
                }

                current_index++;
            }
        }