Beispiel #1
0
        private void BindAuto(Rubric rub)
        {
            Rubrics rubda = new Rubrics(Globals.CurrentIdentity);

            Result.ResultList ress = rubda.GetResults(rub.ID, GetSubID());

            lblEvalID.Text = rub.EvalID.ToString();
            if (ress.Count == 0)
            {
                if (!IsStudent())
                {
                    mpViews.SelectedIndex = 2;
                }
                else
                {
                    mpViews.SelectedIndex = 5;
                }
            }
            else
            {
                AutoResult res = ress[0] as AutoResult;

                XmlWizard xmlwiz = new XmlWizard();
                xmlwiz.DisplayDivXslt(res.XmlResult, Path.Combine(Globals.WWWDirectory, "Xml/reshtml.xslt"), divAuto);

                mpViews.SelectedIndex = 3;
            }
        }
Beispiel #2
0
        private void BindJUnitView(AutoEvaluation eval)
        {
            string xmltests = null;
            double points = 0;
            int    time = 0, count = 0;

            //Attempt to load suite info
            try {
                xmltests = new JUnitTool().ReDiscover(eval, out points, out time, out count);
            } catch (JUnitToolException) {
                points = 0; time = 0; count = 0; xmltests = null;
            } catch (CustomException er) {
                PageJUnitError(er.Message);
            }

            //Display test info
            XmlWizard xmlwiz = new XmlWizard();

            lblJUnitTime.Text  = "Total Time Limit: <b>" + time + "s</b>";
            lblJUnitCount.Text = "Total Test Count: <b>" + count + "</b>";
            if (xmltests != null)
            {
                xmlwiz.DisplayDivXslt(xmltests,
                                      Path.Combine(Globals.WWWDirectory, "Xml/testhtml.xslt"), divJUnitTest);
            }
            else
            {
                divJUnitTest.InnerHtml = "<br><i>No JUnit Test Suite Present</i>";
            }

            ucJUnitDeps.BindData(eval);
            ucJUnitDeps.ShowUpdate = true;
            ucJUnitDeps.EvalID     = eval.ID;

            AddBrowserAttr(lnkJUnitView, eval);
            lblEvalID.Text          = eval.ID.ToString();
            chkJUnitPreTest.Checked = eval.RunOnSubmit;
            chkJUnitCompete.Checked = eval.Competitive;
        }