private void butDelete_Click(object sender, EventArgs e) { if (_evalCur.IsNew || MsgBox.Show(this, MsgBoxButtons.YesNo, "This will delete the evaluation. Continue?")) { Evaluations.Delete(_evalCur.EvaluationNum); DialogResult = DialogResult.Cancel; } }
public object EvaluatedResultIndexed(int i) => i < MaxCount? Evaluations.First().GetEvalResultAsObject() : Evaluations.First().EvalResult.IsWarewolfAtomListresult ? new object[] { null } : null;
object CreateArrayOfObjectsFromRecordSet(int i) { var jsonMappingEvaluated = Evaluations.First(); return(new JProperty( jsonMappingEvaluated.Simple.DestinationName, GetEvalResult(jsonMappingEvaluated.EvalResult, i))); }
public EvaluationsPatientViewModel() { source = new List <EvaluationPatientModel>(); CreatePatientsCollection(); selectedProfilePatient = Evaluations.Skip(3).FirstOrDefault(); PatientsSelectionChanged(); }
/// <summary> /// Zakończenie zadanej ewaluacji /// </summary> /// <param name="evalName"></param> public void CloseEvaluation(string evalName) { Graph eval = Evaluations.Find(e => e.Name == evalName); eval.IsFinished = true; eval.EstimateAuthorities(); IsEvaluationInProgress = false; }
public ActionResult GetWhatIfGrade(CourseWhatIfInputViewModel whatIfModel) { var course = (CourseDomainModel)Courses.GetCourse(Guid.Parse(whatIfModel.CourseId)); var evalsFromCourse = Evaluations.GetEvaluationsForCourse(Guid.Parse(whatIfModel.CourseId)); var castedModels = new List <EvaluationDomainModel>(); foreach (var eval in evalsFromCourse) { if (eval.GetType() == typeof(EvaluationDomainModel)) { castedModels.Add((EvaluationDomainModel)eval); } } var whatIfDomainModels = new List <EvaluationDomainModel>(); foreach (var eval in whatIfModel.Evaluations) { whatIfDomainModels.Add(new EvaluationDomainModel { Id = Guid.Parse(eval.EvaluationId), PointsEarned = eval.PointsEarned, TotalPointsPossible = eval.PointsPossible }); } var domainModelsWithWhatIfScores = from storedEval in castedModels join whatIfEval in whatIfDomainModels on storedEval.Id equals whatIfEval.Id select new EvaluationDomainModel { Id = storedEval.Id, Name = storedEval.Name, PointsEarned = whatIfEval.PointsEarned, TotalPointsPossible = whatIfEval.TotalPointsPossible, Weight = storedEval.Weight }; // send the results of the query TO the Courses.CalcWhatIfGrade() var whatIfGradeDomainModel = Courses.CalcWhatIfGrade(domainModelsWithWhatIfScores); var whatIfGradeViewModel = new CourseWhatIfResultViewModel { CourseId = course.Id, CourseName = course.Name, WhatIfGrade = whatIfGradeDomainModel.WhatIfGrade, Evaluations = whatIfGradeDomainModel.WhatIfEvaluations.Select(eval => new EvaluationWhatIfResultViewModel { EvaluationId = eval.EvaluationId, EvaluationName = eval.EvaluationName, WhatIfGrade = eval.WhatIfGrade }).ToList() }; // return it to the new view (I guess, and also need to do that) return(PartialView("_whatIfResultPartial", whatIfGradeViewModel)); }
public static void DeleteEvaluation(long id) { var evaluation = Evaluations.FirstOrDefault(e => e.Id == id); if (evaluation == null) { return; } DataContext.Evaluations.Remove(evaluation); DataContext.SaveChanges(); }
private void lnkUpdate_Click(object sender, EventArgs e) { Evaluation eval = new Evaluations(Globals.CurrentIdentity).GetInfo(EvalID); try { Update(eval.ID, eval.AsstID); } catch (DataAccessException er) { PageError(er.Message); } BindData((AutoEvaluation)eval); }
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 RemoveResults(AutoEvaluation eval) { Rubric rub = new Evaluations(Globals.CurrentIdentity).GetRubric(eval.ID); Result.ResultList ress = new Rubrics(Globals.CurrentIdentity).GetResults(rub.ID); Results resda = new Results(Globals.CurrentIdentity); foreach (Result res in ress) { resda.Delete(res.ID); } }
public ActionResult EditEvaluation(Guid evaluationid) { var domainModel = Evaluations.GetEvaluation(evaluationid); if (domainModel.GetType() == typeof(ErrorDomainModel)) { return(GradeTrackerError(domainModel, null)); } var viewModel = new EvaluationViewModel((EvaluationDomainModel)domainModel); return(View("UpdateEvaluation", viewModel)); }
/// <summary> /// Returns a <see cref="System.String" /> that represents this instance. /// </summary> /// <returns> A <see cref="System.String" /> that represents this instance. </returns> public override string ToString() { var failed = Evaluations.OfType <FailedEvaluation>() .Select(e => " " + e.ToString()) .Where(msg => !string.IsNullOrWhiteSpace(msg)); var passed = Evaluations.OfType <SuccessfulEvaluation>() .Select(e => " " + e.ToString()) .Where(msg => !string.IsNullOrWhiteSpace(msg)); return ($"{Failures.Count()} failed (out of {Evaluations.Count()} evaluations)\n Failed:\n{string.Join(Environment.NewLine, failed)}\n Passed:\n{string.Join(Environment.NewLine, passed)}"); }
public string DeleteEvaluation(int id) { using (var context = new BookDbContext()) { Evaluations eval = context.Evaluation.Where(x => x.Id == id).Single <Evaluations>(); var books = context.Book.ToList(); var users = context.User.ToList(); context.Evaluation.Remove(eval); context.SaveChanges(); return("Evaluation has successfully Deleted !"); } }
public ActionResult Edit([Bind(Include = "Id,Classroom_Id,User_Id,Period_Id,Date,TotalPoint")] Evaluations evaluations) { if (ModelState.IsValid) { evaluationsRepository.SetEntryState(evaluations, EntityState.Modified); evaluationsRepository.Save(); return(RedirectToAction("Index")); } ViewBag.Classroom_Id = new SelectList(evaluationsRepository.GetAcademy().Classrooms, "Id", "Title", evaluations.Classroom_Id); ViewBag.Period_Id = new SelectList(evaluationsRepository.GetAcademy().Periods, "Id", "Begin", evaluations.Period_Id); ViewBag.User_Id = new SelectList(evaluationsRepository.GetAcademy().Users, "Id", "UserName", evaluations.User_Id); return(View(evaluations)); }
private static List <Evaluations> GetRandomEvaluationsSet(uint Evaluation) { List <Evaluations> evs = new List <Evaluations>(); IEnumerable <int> seq; do { seq = GetSequence(11); }while ((double)seq.Sum() / (double)ReviewFields.EvaluationsCount < 0.5); switch (Evaluation) { case 3: foreach (var e in seq) { Evaluations ev = new Evaluations(); ev.Low = Convert.ToBoolean(e); ev.Medium = ev.Low == false?Convert.ToBoolean(_random.Next(0, 100) % 2) : false; ev.High = !(ev.Low | ev.Medium); evs.Add(ev); } break; case 4: foreach (var e in seq) { Evaluations ev = new Evaluations(); ev.Medium = Convert.ToBoolean(e); ev.High = ev.Medium == false?Convert.ToBoolean(_random.Next(0, 1)) : false; ev.Low = !(ev.High | ev.Medium); evs.Add(ev); } break; case 5: default: foreach (var e in seq) { Evaluations ev = new Evaluations(); ev.High = Convert.ToBoolean(e); ev.Medium = ev.High == false?Convert.ToBoolean(_random.Next(0, 1)) : false; ev.Low = !(ev.High | ev.Medium); evs.Add(ev); } break; } return(evs); }
public ActionResult Details(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Evaluations evaluations = evaluationsRepository.GetById(id); if (evaluations == null) { return(HttpNotFound()); } return(View(evaluations)); }
// GET: Evaluations/Delete/5 public ActionResult Delete(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } // Evaluations evaluations = db.Evaluations.Find(id); Evaluations evaluations = _evaluationRepository.GetEvaluationsByID(id); if (evaluations == null) { return(HttpNotFound()); } return(View(evaluations)); }
private void BindData() { if (ddlCompete.Items.Count == 0) { return; } m_subs = new Hashtable(); //Get results Result.ResultList ress = new Evaluations(Globals.CurrentIdentity).GetCompetitionResults(Convert.ToInt32(ddlCompete.SelectedValue), out m_subs); dgCompete.DataSource = ress; dgCompete.DataBind(); }
public ActionResult Edit([Bind(Include = "Id,Classroom_Id,User_Id,Period_Id,Date,TotalPoint")] Evaluations evaluations) { if (ModelState.IsValid) { _evaluationRepository.UpdateEvaluation(evaluations); _evaluationRepository.Save(); //db.Entry(evaluations).State = EntityState.Modified; //db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Classroom_Id = new SelectList(_evaluationRepository.GetClassrooms(), "Id", "Title", evaluations.Classroom_Id); ViewBag.Period_Id = new SelectList(_evaluationRepository.GetPeriods(), "Id", "Id", evaluations.Period_Id); ViewBag.User_Id = new SelectList(_evaluationRepository.GetUsers(), "Id", "UserName", evaluations.User_Id); return(View(evaluations)); }
public ActionResult Create([Bind(Include = "Id,Classroom_Id,User_Id,Period_Id,Date,TotalPoint")] Evaluations evaluations) { if (ModelState.IsValid) { evaluations.Id = Guid.NewGuid(); _evaluationRepository.InsertEvaluation(evaluations); _evaluationRepository.Save(); return(RedirectToAction("Index")); } ViewBag.Classroom_Id = new SelectList(_evaluationRepository.GetClassrooms(), "Id", "Title"); ViewBag.Period_Id = new SelectList(_evaluationRepository.GetPeriods(), "Id", "Id"); ViewBag.User_Id = new SelectList(_evaluationRepository.GetUsers(), "Id", "UserName"); return(View(evaluations)); }
public async Task CreateAsync(CreateEvaluationViewModel model) { var eval = new Evaluations { Value = model.Value, Notes = model.Notes, CreatedOn = DateTime.UtcNow, EvaluationYear = model.Year, IsDeleted = false, UserId = model.EmployeeId }; await this.evaluationRepository.AddAsync(eval); await this.evaluationRepository.SaveChangesAsync(); }
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(); }
public ActionResult ViewEvaluation(Guid evaluationId) { var evaluationDomainModel = Evaluations.GetEvaluation(evaluationId); if (evaluationDomainModel.GetType() == typeof(ErrorDomainModel)) { return(GradeTrackerError(evaluationDomainModel, null)); } var evaluationViewModel = new EvaluationViewModel((EvaluationDomainModel)evaluationDomainModel) { Scores = GetScoresForEvaluation(evaluationId) }; return(View(evaluationViewModel)); }
public object ComplexEvaluatedResultIndexed(int i) { var a = new JObject(); if (Evaluations.Any(x => x.EvalResult.IsWarewolfAtomListresult)) { return(CreateArrayOfResults()); } if (Evaluations.Any(x => x.EvalResult.IsWarewolfRecordSetResult)) { return(CreateArrayOfObjectsFromRecordSet(i)); } CreateScalarObject(a); return(a); }
private void FillGrid() { long course = (comboCourse.SelectedIndex == 0) ? 0:_listSchoolCourses[comboCourse.SelectedIndex - 1].SchoolCourseNum; long instructor = (comboInstructor.SelectedIndex == 0) ? 0:_listInstructor[comboInstructor.SelectedIndex - 1].ProvNum; DataTable table = Evaluations.GetFilteredList(DateTime.Parse(textDateStart.Text), DateTime.Parse(textDateEnd.Text), textLastName.Text, textFirstName.Text, PIn.Long(textProvNum.Text), course, instructor); gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g("TableEvaluations", "Date"), 70, HorizontalAlignment.Center); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableEvaluations", "Title"), 90); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableEvaluations", "Instructor"), 90); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableEvaluations", "ProvNum"), 60); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableEvaluations", "Last Name"), 90); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableEvaluations", "First Name"), 80); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableEvaluations", "Course"), 90); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableEvaluations", "Grade"), 60); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableEvaluations", "Grading Scale"), 90); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; for (int i = 0; i < table.Rows.Count; i++) { row = new ODGridRow(); row.Cells.Add(DateTime.Parse(table.Rows[i]["DateEval"].ToString()).ToShortDateString()); row.Cells.Add(table.Rows[i]["EvalTitle"].ToString()); row.Cells.Add(table.Rows[i]["InstructNum"].ToString()); row.Cells.Add(table.Rows[i]["StudentNum"].ToString()); row.Cells.Add(table.Rows[i]["LName"].ToString()); row.Cells.Add(table.Rows[i]["FName"].ToString()); row.Cells.Add(table.Rows[i]["CourseID"].ToString()); row.Cells.Add(table.Rows[i]["OverallgradeShowing"].ToString()); row.Cells.Add(table.Rows[i]["Description"].ToString()); row.Tag = table.Rows[i]["EvaluationNum"].ToString(); //To keep the correct reference to the Evaluation even when filtering the list. gridMain.Rows.Add(row); } gridMain.EndUpdate(); }
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); } }
public static Population BreedPopulation(Population p, Evaluations e, getRandomGeneFunct getRandGene, double mutate_probability = MUTATION_RATE) { Population children = new Population(); DNAMateResult breed; // Apply mate_at_random until enough children have been // bred to match the size of the original population while (children.Count != p.Count) { breed = Mate(p); children.AddRange(breed); } return children; }
private void PercolateModified(CFile file, DateTime mod) { if (file != null && file.FullPath != @"c:\") { file.FileModified = mod; m_dp.SyncFile(file); //Check special directories if (file.SpecType == CFile.SpecialType.SUBMISSION) { Submissions subda = new Submissions(Globals.CurrentIdentity); Components.Submission sub = subda.GetInfoByDirectoryID(file.ID); if (sub != null) { //Check to see if a staff member modded CourseRole role = new Courses(Globals.CurrentIdentity).GetRole( m_ident.Name, new Assignments(Globals.CurrentIdentity).GetInfo(sub.AsstID).CourseID, null); //Student mods update the submission time, staff mods don't... if (!role.Staff) { sub.Creation = mod; sub.Status = Components.Submission.UNGRADED; subda.Update(sub, new EmptySource()); //Log this in sub log new Activities(m_ident).Create(m_ident.Name, Activity.SUBMISSION, sub.ID, "Updated submission time due to student modification of files"); } } } else if (file.SpecType == CFile.SpecialType.TEST) { Evaluations evalda = new Evaluations(Globals.CurrentIdentity); AutoEvaluation eval = evalda.GetAutoInfoByZone(file.ID); if (eval != null) { eval.ZoneModified = mod; evalda.UpdateAuto(eval, new EmptySource()); } } CFile par = GetFile(file.Path); PercolateModified(par, mod); } }
public ActionResult Edit(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Evaluations evaluations = evaluationsRepository.GetById(id); if (evaluations == null) { return(HttpNotFound()); } ViewBag.Classroom_Id = new SelectList(evaluationsRepository.GetAcademy().Classrooms, "Id", "Title", evaluations.Classroom_Id); ViewBag.Period_Id = new SelectList(evaluationsRepository.GetAcademy().Periods, "Id", "Begin", evaluations.Period_Id); ViewBag.User_Id = new SelectList(evaluationsRepository.GetAcademy().Users, "Id", "UserName", evaluations.User_Id); return(View(evaluations)); }
private void butOK_Click(object sender, EventArgs e) { if (textDate.errorProvider1.GetError(textDate) != "") { MsgBox.Show(this, "Please fix data entry errors first."); return; } if (textDate.Text == "") { MsgBox.Show(this, "Please enter a date."); return; } if (_provStudent == null) { MsgBox.Show(this, "Please attach a student to this evaluation."); return; } if (!String.IsNullOrWhiteSpace(textGradeNumberOverride.Text)) { //Overrides are not saved to the database. They are found by comparing calculated grades to grades found in the database. //If they are identical or blank then they have not been overwritten. //This will need to be taken into account when reporting since it is possible to override one grade column but not the other. i.e. A->B but number stays at 4. float parsed = 0; if (!float.TryParse(textGradeNumberOverride.Text, out parsed)) { MsgBox.Show(this, "The override for Overall Grade Number is not a valid number. Please input a valid number to save the evaluation."); return; } _evalCur.OverallGradeNumber = parsed; } for (int i = 0; i < _listEvalCrits.Count; i++) { _listEvalCrits[i].Notes = gridCriterion.ListGridRows[i].Cells[4].Text; //Cell 4 is the notes column EvaluationCriterions.Update(_listEvalCrits[i]); } _evalCur.DateEval = DateTime.Parse(textDate.Text); _evalCur.StudentNum = _provStudent.ProvNum; _evalCur.OverallGradeShowing = textGradeShowing.Text; _evalCur.OverallGradeNumber = PIn.Float(textGradeNumber.Text); if (!String.IsNullOrWhiteSpace(textGradeShowingOverride.Text)) { _evalCur.OverallGradeShowing = textGradeShowingOverride.Text; } Evaluations.Update(_evalCur); DialogResult = DialogResult.OK; }
private void UpdateRightSide() { int rubID = GetCurrentID(); Rubric rub = new Rubrics(Globals.CurrentIdentity).GetInfo(rubID); txtDescription.Text = rub.Description; txtName.Text = rub.Name; txtPoints.Enabled = true; chkAllowNeg.Checked = rub.AllowNegativePoints; if (!IsHeading(rub)) { txtPoints.Visible = true; txtPoints.Text = rub.Points.ToString(); if (rub.EvalID >= 0) { Evaluation eval = new Evaluations(Globals.CurrentIdentity).GetInfo(rub.EvalID); if (eval.Manager == Evaluation.JUNIT_MANAGER) { BindJUnitView((AutoEvaluation)eval); // txtPoints.Enabled = false; mpViews.SelectedIndex = JUNITVIEW; } else if (eval.Manager == Evaluation.CHECKSTYLE_MANAGER) { BindCSView((AutoEvaluation)eval); mpViews.SelectedIndex = CHECKSTYLEVIEW; } else { BindAutoView((AutoEvaluation)eval); mpViews.SelectedIndex = AUTOVIEW; } } else { BindCannedResponses(rubID); mpViews.SelectedIndex = SUBJVIEW; } } else { txtPoints.Visible = false; mpViews.SelectedIndex = NOVIEW; } }
public void UpdateEvaluation(Evaluations.Evaluation evaluation) { this.EvaluationJSON = (evaluation == null) ? null : evaluation.ToString(); }