private void cmdJUnitUpdate_Click(object sender, System.EventArgs e) { int evalID = Convert.ToInt32(lblEvalID.Text); Evaluations evalda = new Evaluations(Globals.CurrentIdentity); AutoEvaluation eval = (AutoEvaluation) evalda.GetInfo(evalID); try { eval.RunOnSubmit = chkJUnitPreTest.Checked; eval.Competitive = chkJUnitCompete.Checked; evalda.UpdateAuto(eval, new EmptySource()); } catch (CustomException er) { PageJUnitError(er.Message); } UpdateRightSide(); }
private void cmdJUnitUpload_Click(object sender, System.EventArgs e) { //Import tester data AutoEvaluation eval; Evaluations evalda = new Evaluations(Globals.CurrentIdentity); Rubrics rubda = new Rubrics(Globals.CurrentIdentity); IExternalSource esrc; if (fiJUnit.PostedFile.ContentLength == 0) { PageJUnitError("You must specify a tester suite to upload"); return; } else { esrc = CreateSource(fiJUnit.PostedFile); eval = (AutoEvaluation) new Evaluations(Globals.CurrentIdentity).GetInfo( Convert.ToInt32(lblEvalID.Text)); } //Load files try { evalda.UpdateAuto(eval, esrc); } catch (CustomException er) { PageJUnitError(er.Message); return; } //Discover JUnit test double points=0; int time=0, count=0; try { new JUnitTool().Discover(eval, out points, out time, out count); } catch (CustomException er) { PageJUnitError(er.Message); } //Update points and time Rubric rub = rubda.GetInfo(GetCurrentID()); eval.TimeLimit = time; rub.Points = points; try { evalda.UpdateAuto(eval, new EmptySource()); rubda.Update(rub); PageJUnitError("Upload successful!"); } catch (CustomException er) { PageJUnitError(er.Message); } UpdateRightSide(); }
private void cmdCSUpload_Click(object sender, System.EventArgs e) { //Import tester data AutoEvaluation eval; Evaluations evalda = new Evaluations(Globals.CurrentIdentity); IExternalSource esrc; //Get all necessary info if (fuCS.PostedFile.ContentLength == 0) { PageCSError("You must specify a tester suite to upload"); return; } else { esrc = CreateSource(fuCS.PostedFile); eval = (AutoEvaluation) new Evaluations(Globals.CurrentIdentity).GetInfo( Convert.ToInt32(lblEvalID.Text)); } //Load files try { evalda.UpdateAuto(eval, esrc); new CheckStyleTool().CopySupportFiles(eval); PageCSError("Upload successful!"); } catch (CustomException er) { PageCSError(er.Message); } UpdateRightSide(); }