Пример #1
0
        private void lnkDefunct_Click(object sender, EventArgs e)
        {
            Submissions subda = new Submissions(Globals.CurrentIdentity);

            Components.Submission sub = subda.GetInfo(GetSubID());

            //Change status
            if (sub.Status != Components.Submission.DEFUNCT)
            {
                sub.Status = Components.Submission.DEFUNCT;
            }
            else
            {
                sub.Status = Components.Submission.UNGRADED;
            }

            try {
                subda.Update(sub, new EmptySource());
            } catch (DataAccessException er) {
                PageError(er.Message);
            } catch (FileOperationException er) {
                PageError(er.Message);
            }

            BindData();
            Refresh(this, new RefreshEventArgs("", true, false));
        }
Пример #2
0
        private void PercolateModified(CFile file, DateTime mod)
        {
            if (file != null && file.FullPath != @"c:\")
            {
                file.FileModified = mod;
                m_dp.SyncFile(file);

                //Check special directories
                if (file.SpecType == CFile.SpecialType.SUBMISSION)
                {
                    Submissions           subda = new Submissions(Globals.CurrentIdentity);
                    Components.Submission sub   = subda.GetInfoByDirectoryID(file.ID);
                    if (sub != null)
                    {
                        //Check to see if a staff member modded
                        CourseRole role = new Courses(Globals.CurrentIdentity).GetRole(
                            m_ident.Name, new Assignments(Globals.CurrentIdentity).GetInfo(sub.AsstID).CourseID, null);

                        //Student mods update the submission time, staff mods don't...
                        if (!role.Staff)
                        {
                            sub.Creation = mod;
                            sub.Status   = Components.Submission.UNGRADED;
                            subda.Update(sub, new EmptySource());

                            //Log this in sub log
                            new Activities(m_ident).Create(m_ident.Name, Activity.SUBMISSION, sub.ID,
                                                           "Updated submission time due to student modification of files");
                        }
                    }
                }
                else if (file.SpecType == CFile.SpecialType.TEST)
                {
                    Evaluations    evalda = new Evaluations(Globals.CurrentIdentity);
                    AutoEvaluation eval   = evalda.GetAutoInfoByZone(file.ID);
                    if (eval != null)
                    {
                        eval.ZoneModified = mod;
                        evalda.UpdateAuto(eval, new EmptySource());
                    }
                }

                CFile par = GetFile(file.Path);
                PercolateModified(par, mod);
            }
        }