Example #1
0
        public Question(int qNumber, string qText, System.Windows.Forms.PictureBox qPic, System.Windows.Forms.Label qLab,
            System.Windows.Forms.PictureBox ansPicA, System.Windows.Forms.PictureBox ansPicB, System.Windows.Forms.PictureBox ansPicC,
            System.Windows.Forms.PictureBox ansPicD, System.Windows.Forms.Label ansLabA, System.Windows.Forms.Label ansLabB,
            System.Windows.Forms.Label ansLabC, System.Windows.Forms.Label ansLabD, string medLoc, Form3 frm3)
        {
            this.qNumber = qNumber;
            this.qPic = qPic;
            this.qLab = qLab;
            string[] textArray = null;
            textArray = qText.Split(';');
            this.qLab.Text = textArray[0];
            bool[] corrArray = { false, false, false, false };
            bool[] markedArray = { false, false, false, false };
            byte[] asciiBytes = Encoding.ASCII.GetBytes(textArray[5] + textArray[6] + textArray[7]);
            corrArray[asciiBytes[0] - 65] = true;
            markedArray[asciiBytes[1] - 65] = true;
            markedArray[asciiBytes[2] - 65] = true;
            qAnswerA = new Answer(textArray[1], 'A', ansPicA, ansLabA, corrArray[0], markedArray[0], this);
            qAnswerB = new Answer(textArray[2], 'B', ansPicB, ansLabB, corrArray[1], markedArray[1], this);
            qAnswerC = new Answer(textArray[3], 'C', ansPicC, ansLabC, corrArray[2], markedArray[2], this);
            qAnswerD = new Answer(textArray[4], 'D', ansPicD, ansLabD, corrArray[3], markedArray[3], this);
            
            qType = textArray[8];
            mediaLocation = medLoc;
            if (qType == "audio") frm3.activateAudioButtons();
            if (qType == "photo") frm3.activatePhotoButton();

            if (qNumber == 1 || qNumber > 5)
                qLD = new Audio(System.Windows.Forms.Application.StartupPath + "//sounds//LD_" + qNumber.ToString() + ".mp3");
            else
                qLD = null;
            if (qNumber == 1)
            {
                qMusic = new Audio(System.Windows.Forms.Application.StartupPath + "//sounds//question_1.mp3");
                Form3.tempMusic = qMusic;
            }
            else if (qNumber > 1 && qNumber <= 5)
                qMusic = Form3.tempMusic;
            else
                qMusic = new Audio(System.Windows.Forms.Application.StartupPath + "//sounds//question_" + qNumber.ToString() + ".mp3");
            qFinal = new Audio(System.Windows.Forms.Application.StartupPath + "//sounds//final_" + qNumber.ToString() + ".mp3");
            qCorrect = new Audio(System.Windows.Forms.Application.StartupPath + "//sounds//correct_" + qNumber.ToString() + ".mp3");
            qWrong = new Audio(System.Windows.Forms.Application.StartupPath + "//sounds//wrong_" + qNumber.ToString() + ".mp3");
        }
Example #2
0
 private void buttonMainGame_Click(object sender, EventArgs e)
 {
     Form3 frm3 = new Form3(amountOfQuestions);
     frm3.ShowDialog();
 }