public static AssignmentForm uploadAssignmentForm(int cid)
        {
            AssignmentForm form = new AssignmentForm();

            form.classid                     = cid;
            form.Text                        = "Upload a new assignment";
            form.txtName.Text                = "Enter Name";
            form.dueDatePicker.Value         = DateTime.Now;
            form.groupBoxStudentFile.Visible = false;
            form.btnDownload.Enabled         = false;
            form.btnDownload.Visible         = false;
            form.lblFile.Text                = "No File Chosen";
            form.groupBoxGrades.Enabled      = false;
            form.groupBoxGrades.Visible      = false;
            return(form);
        }
        public static AssignmentForm studentAssignmentForm(Quiz q, int uid)
        {
            AssignmentForm form = new AssignmentForm();

            form.userid                = uid;
            form.quiz                  = q;
            form.Text                  = "Upload student assignment submission";
            form.Text                  = "Editing existing assignment";
            form.txtName.Text          = q.name;
            form.lblFile.Text          = q.path;
            form.dueDatePicker.Value   = q.duedate;
            form.txtName.Enabled       = false;
            form.dueDatePicker.Enabled = false;
            form.btnUpload.Enabled     = false;
            form.btnUpload.Visible     = false;
            form.btnSave.Enabled       = false;
            form.btnSave.Visible       = false;
            form.groupBoxGrades.Text   = "My Grade";
            form.btnGrade.Enabled      = false;
            form.btnGrade.Visible      = false;

            Submission s = Program.Database.getSubmissionForUserAndAssignment(q.quizid, uid);

            if (s != null)
            {
                form.lblSubmission.Text = s.path;
                if (s.score == "")
                {
                    form.lblMyGrade.Text = "This assignment is not yet graded";
                }
                else
                {
                    form.lblMyGrade.Text = s.score;
                }
            }
            else
            {
                form.lblSubmission.Text = "You have not submitted";
                form.lblMyGrade.Text    = "This assignment is not yet graded";
            }
            return(form);
        }
        public static AssignmentForm editAssignmentForm(Quiz q)
        {
            AssignmentForm form = new AssignmentForm();

            form.Text                        = "Editing existing assignment";
            form.quiz                        = q;
            form.txtName.Text                = q.name;
            form.lblFile.Text                = q.path;
            form.dueDatePicker.Value         = q.duedate;
            form.groupBoxStudentFile.Enabled = false;
            form.groupBoxStudentFile.Visible = false;
            form.btnStudentDownload.Enabled  = false;
            form.btnStudentDownload.Visible  = false;
            form.btnStudentUpload.Enabled    = false;
            form.btnStudentUpload.Enabled    = false;
            form.groupBoxGrades.Text         = "Grades";
            form.lblMyGrade.Enabled          = false;
            form.lblMyGrade.Visible          = false;
            return(form);
        }