Пример #1
0
        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());
            }
        }
Пример #2
0
        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();
        }
Пример #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                var ext = new List <string> {
                    "fctans"
                };

                using (var fbd = new FolderBrowserDialog())
                {
                    DialogResult result = fbd.ShowDialog();

                    if (result == DialogResult.OK && !string.IsNullOrWhiteSpace(fbd.SelectedPath))
                    {
                        var myFiles = Directory.GetFiles(fbd.SelectedPath, "*.fctans", SearchOption.AllDirectories).ToList();

                        // var myFiles = Directory.GetFiles(fbd.SelectedPath, "*.*", SearchOption.AllDirectories)
                        //            .Where(s => ext.Contains(Path.GetExtension(s))).ToList();
                        int cnt = 0;
                        foreach (var file in myFiles)
                        {
                            try {
                                ExamsToGrade.Add(ExamHelper.GetExamFromFile(file, studentPassTxtBox.Text, "", Security.FilterationSecurityLevel.Moderate));
                                aLogger.LogMessage($" Added Exam File from [{file}]", LogMsgType.Verbose);
                                cnt++;
                            }
                            catch (Exception ex)
                            {
                                aLogger.LogMessage($"Failed to get file name [{file}], possibly its an invalid exam file (Execption msg: {ex.Message})", LogMsgType.Error);
                            }
                        }

                        aLogger.LogMessage($" TOTAL OF {cnt} exams are loaded correctly, click on Grade files to get the report", LogMsgType.Verbose);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Пример #4
0
        private void openExamBtn_Click(object sender, EventArgs e)
        {
            try
            {
                OpenFileDialog opendialog = new OpenFileDialog();
                opendialog.Filter       = "FCT Exam File (*.FCTANS)|*.FCTANS";
                opendialog.DefaultExt   = "FCTANS";
                opendialog.AddExtension = true;

                if (opendialog.ShowDialog() == DialogResult.OK)
                {
                    //  var examStringEncrypted = ExamHelper.GetExamFileAsBytes(opendialog.FileName);
                    ExamsToGrade.Add(ExamHelper.GetExamFromFile(opendialog.FileName, studentPassTxtBox.Text, "", Security.FilterationSecurityLevel.Moderate));
                    aLogger.LogMessage($" Added Exam File from [{opendialog.FileName}]", LogMsgType.Verbose);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }