예제 #1
0
        /// <summary>
        /// Create a new job in the queue
        /// </summary>
        public AutoJob Create(string name, int asstID)
        {
            Assignment asst = new Assignments(m_ident).GetInfo(asstID);
            //	Authorize(asst.CourseID, "createjob", asstID, null);

            AutoJob job = new AutoJob();

            job.JobName    = name;
            job.JobCreator = m_ident.Name;
            job.AsstID     = asstID;
            m_dp.CreateAutoJob(job);

            return(job);
        }
예제 #2
0
        private string GetProgress(AutoJob job)
        {
            AutoJobTest.AutoJobTestList tests =
                new AutoJobs(Globals.CurrentIdentity).GetTests(job.ID);
            int done = 0;

            foreach (AutoJobTest test in tests)
            {
                if (test.Status == AutoJobTest.DONE)
                {
                    done++;
                }
            }

            return(String.Format("{0}/{1}", done, tests.Count));
        }
예제 #3
0
        private void lnkRunTest_Click(object sender, EventArgs e)
        {
            AutoJobs ajobda = new AutoJobs(Globals.CurrentIdentity);

            Components.Submission sub =
                new Submissions(Globals.CurrentIdentity).GetInfo(GetSubID());

            Evaluation eval =
                new Evaluations(Globals.CurrentIdentity).GetInfo(Convert.ToInt32(lblEvalID.Text));
            string name = new FileSystem(Globals.CurrentIdentity).GetFile(sub.LocationID).Alias +
                          " (" + eval.Name + ")";

            try {
                AutoJob job =
                    ajobda.Create(name, sub.AsstID);
                ajobda.CreateTest(job.ID, sub.ID, eval.ID, false);
            } catch (DataAccessException er) {
                PageRunError(er.Message);
                return;
            }

            PageRunError("Automatic job created successfully!");
        }
예제 #4
0
        private void cmdSubmit_Click(object sender, EventArgs e)
        {
            ArrayList  prins  = GetPrincipals();
            ArrayList  tests  = GetTests();
            AutoJobs   jobs   = new AutoJobs(Globals.CurrentIdentity);
            Principals aprins = new Principals(Globals.CurrentIdentity);

            //Check for nothing
            if (tests.Count == 0 || prins.Count == 0)
            {
                PageAutoError("Must select at least one user and one test to create an auto job");
                return;
            }

            AutoJob job = jobs.Create(txtName.Text, GetAsstID());

            foreach (int prin in prins)
            {
                foreach (int evalid in tests)
                {
                    try {
                        Components.Submission sub =
                            aprins.GetLatestSubmission(prin, GetAsstID());
                        if (sub != null)
                        {
                            jobs.CreateTest(job.ID, sub.ID, evalid, false);
                        }
                    } catch (DataAccessException er) {
                        PageAutoError(er.Message);
                        return;
                    }
                }
            }

            mpViews.SelectedIndex = 1;
        }
예제 #5
0
        private void QueueSubmitTests(Components.Submission sub)
        {
            int    asstID = sub.AsstID;
            string strlog = "";

            Evaluation.EvaluationList tests = new Assignments(m_ident).GetSubmitAutoEvals(asstID);
            if (tests.Count == 0)
            {
                return;
            }

            //Queue up pretests
            AutoJobs jobda = new AutoJobs(m_ident);
            AutoJob  job   = jobda.Create(m_ident.Name + " submission", asstID);

            foreach (Evaluation eval in tests)
            {
                jobda.CreateTest(job.ID, sub.ID, eval.ID, true);
                strlog += eval.Name + " ";
            }

            //Log queueing
            Log("Pretests queued: " + strlog, sub.ID);
        }