예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                OpenFileDialog opendialog = new OpenFileDialog();
                opendialog.Filter       = "FCT Exam File Template (*.XML)|*.XML";
                opendialog.DefaultExt   = "XML";
                opendialog.AddExtension = true;

                if (opendialog.ShowDialog() == DialogResult.OK)
                {
                    anExam = SerializationHelper.DeserializeXML <Exam>(File.ReadAllText(opendialog.FileName));

                    foreach (var q in anExam.QuestionsList)
                    {
                        QuizHelper.AddQuestionTortb(ref rtb, q.QuestionNumber, q, true, true);
                    }
                    anExam.EncryptAnswerandExplanation(instructorPassTxtBox.Text);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }