Beispiel #1
0
        /// <summary>
        /// Create a auto result.
        /// </summary>
        public bool CreateAuto(int evalID, string grader, int subID, string result)
        {
            //Check permission
            Submissions subac = new Submissions(m_ident);
            Components.Submission sub = subac.GetInfo(subID);
            Assignment asst = new Assignments(m_ident).GetInfo(sub.AsstID);
            Authorize(asst.CourseID, "createauto", asst.ID, null);

            AutoResult res = new AutoResult();
            res.EvalID = evalID; res.Grader = grader;
            res.SubmissionID = subID; res.XmlResult = result;

            //Clear out all results for this evaluation
            Submission.SubmissionList subs =
                new Principals(m_ident).GetSubmissions(sub.PrincipalID, sub.AsstID);

            //Delete all old results
            foreach (Submission s in subs) {
                Result.ResultList ress = subac.GetResults(s.ID);
                foreach (Result r in ress) {
                    if (r.Type == Result.AUTO_TYPE) {
                        AutoResult ar = r as AutoResult;
                        if (ar.EvalID == evalID)
                            Delete(ar.ID);
                    }
                }
            }

            return m_dp.CreateAutoResult(res);
        }
Beispiel #2
0
        protected string RunDependencies(Zone tzone, ZoneService testsvc, 
            Evaluations.DependencyGraph dg)
        {
            Evaluation.EvaluationList border = dg.GetBuildOrder();
            bool suc;

            //Copy zones first
            foreach (AutoEvaluation eval in border) {
                Zone ezone = testsvc.Synchronize(eval);
                testsvc.CopyZone(tzone, ezone);
            }

            //Run the deps
            foreach (AutoEvaluation eval in border) {

                m_logger.Log("Running Dep: " + eval.Name);
                if (eval.IsBuild)
                    RunBuildTest(tzone, eval, out suc);
                else {
                    string xmlout = RunTest(tzone, eval);
                    if (eval.ResultType == Result.AUTO_TYPE) {
                        AutoResult res = new AutoResult();
                        res.XmlResult = xmlout;

                        suc = (res.Success != AutoResult.CRITICALLYFLAWED);
                    } else
                        suc = true;
                }

                if (!suc)
                    return eval.Name;
            }

            return null;
        }