예제 #1
0
        private static void GradeExamQuestion(ref RichTextBox rtb, bool addLogs, string studentPass, string instructorPassword, Exam anExam)
        {
            var id   = AESGCM.SimpleDecryptWithPassword(anExam.RequiredStudentDetails.StudentID, studentPass);
            var name = AESGCM.SimpleDecryptWithPassword(anExam.RequiredStudentDetails.StudentName, studentPass);

            rtb.AppendText($"{anExam.ExamDescription}\n", new System.Drawing.Font("Courier New", 16, System.Drawing.FontStyle.Bold));
            rtb.AppendText($"Student Name: {name}\n", new System.Drawing.Font("Courier New", 16, System.Drawing.FontStyle.Bold));
            rtb.AppendText($"Student ID: {id}\n", new System.Drawing.Font("Courier New", 16, System.Drawing.FontStyle.Bold));
            rtb.AppendText($"Grade: {anExam.GetExamGrade(instructorPassword)}\n", new System.Drawing.Font("Courier New", 18, System.Drawing.FontStyle.Underline));
            // rtb.AppendText($"Exam Sent to Student Date and Comment:{list[i].weSentHimExamDateAndDetails}", new System.Drawing.Font("Courier New", 12, System.Drawing.FontStyle.Italic));
            // rtb.AppendText($"Student Exam Submission Date And Comment:{list[i].weSentHimExamDateAndDetails}", new System.Drawing.Font("Courier New", 12, System.Drawing.FontStyle.Italic));

            foreach (var q in anExam.QuestionsList)
            {
                QuizHelper.AddGradedQuestionToRtb(ref rtb, q.QuestionNumber, q, instructorPassword, true, true);
            }

            if (addLogs)
            {
                rtb.AppendText(System.Environment.NewLine);
                rtb.AppendText($"***** Student Exam Logs *****\n", new System.Drawing.Font("Courier New", 18, System.Drawing.FontStyle.Italic));

                foreach (var s in anExam?.ExamLog)
                {
                    rtb.AppendText($"{s}\n", new System.Drawing.Font("Courier New", 8, System.Drawing.FontStyle.Regular));
                }
            }
            rtb.AppendText($"***** END OF STUDENT {name} EXAM *****\n", new System.Drawing.Font("Courier New", 18, System.Drawing.FontStyle.Italic));
            rtb.AddNewPage();
        }