private void openExamBtn_Click(object sender, EventArgs e) { try { OpenFileDialog opendialog = new OpenFileDialog(); opendialog.Filter = "FCT Exam File (*.FCTEX)|*.FCTEX"; opendialog.DefaultExt = "FCTEX"; opendialog.AddExtension = true; if (opendialog.ShowDialog() == DialogResult.OK) { examStringEncrypted = ExamHelper.GetExamFileAsBytes(opendialog.FileName); anExam = ExamHelper.GetExamFromFile(opendialog.FileName, studentPassTxtBox.Text, "", FilterationSecurityLevel.Moderate); foreach (var q in anExam.QuestionsList) { QuizHelper.AddQuestionTortb(ref rtb, q.QuestionNumber, q, true, true); } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void openExamBtn_Click(object sender, EventArgs e) { try { Random r = new Random(); OpenFileDialog opendialog = new OpenFileDialog(); opendialog.Filter = "FCT Exam File (*.FCTEX)|*.FCTEX"; opendialog.DefaultExt = "FCTEX"; opendialog.AddExtension = true; requiredDetails = new RequiredDetails(studentNameTxtBox.Text, studentIDTxtBox.Text, studentPassTxtBox.Text, "TODO"); if (opendialog.ShowDialog() == DialogResult.OK) { var examStringEncrypted = ExamHelper.GetExamFileAsBytes(opendialog.FileName); anExam = ExamHelper.GetExamFromFile(opendialog.FileName, studentPassTxtBox.Text, "", Security.FilterationSecurityLevel.Moderate); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } if (anExam == null) { MessageBox.Show("Invalid Exam"); return; } PrepareExamEnvironment(); }