예제 #1
0
 /// <summary>
 /// Get the queue position of an auto job test
 /// </summary>
 public int GetQueuePosition(AutoJobTest test)
 {
     AutoJobTest.AutoJobTestList tests = GetAllTests();
     int i;
     for (i = 0; i < tests.Count; i++) {
         if (tests[i].JobID == test.JobID &&
             tests[i].SubmissionID == test.SubmissionID &&
             tests[i].EvalID == test.EvalID)
             return i+1;
     }
     return -1;
 }
예제 #2
0
 /// <summary>
 /// Finish a test from a job
 /// Direct Provider layer call
 /// </summary>
 public bool FinishTest(AutoJobTest test)
 {
     return m_dp.DeleteAutoJobTest(test.JobID, test.EvalID, test.SubmissionID);
 }
예제 #3
0
        protected bool PostResult(AutoJobTest job, string xmloutput)
        {
            Results resda = new Results(m_ident);
            if (job.AutoEval.ResultType == Result.AUTO_TYPE) {
                new Activities(m_ident).Create(job.JobCreator, Activity.SUBMISSION, job.SubmissionID,
                    "Result posted for evaluation: " + job.AutoEval.Name);
                if (!job.OnSubmit) {
                    return resda.CreateAuto(
                        job.AutoEval.ID, job.JobCreator, job.SubmissionID, xmloutput);
                }
                else {
                    Components.Submission sub = new Submissions(m_ident).GetInfo(job.SubmissionID);
                    new EmailWizard(m_ident).SendByPrincipal(sub.PrincipalID,
                        "FrontDesk Submission Results: " + job.AutoEval.Name,
                        ConvertXmlToText(xmloutput, job.AutoEval.CourseID, job.AutoEval.AsstID));
                    m_logger.Log("Result emailed to submitter");
                    if (job.AutoEval.Competitive) {
                        m_logger.Log("Competitive pre-test result stored");
                        return resda.CreateAuto(
                            job.AutoEval.ID, job.JobCreator, job.SubmissionID, xmloutput);
                    }
                    else
                        return true;
                }
            } else {
                SubjResult.SubjResultList ress =
                    ParseSubjXmlResults(xmloutput, new Submissions(m_ident).GetInfo(job.SubmissionID));
                Rubric rub = new Evaluations(m_ident).GetRubric(job.AutoEval.ID);
                new Rubrics(m_ident).ClearResults(rub.ID, job.SubmissionID);
                foreach (SubjResult res in ress)
                    resda.CreateSubj(job.SubmissionID, rub.ID, res.Comment,
                        res.FileID, res.Line, res.Points, new ArrayList(), res.SubjType);

                return true;
            }
        }