public ActionResult DeleteConfirmed(int id) { EvaluationCategory evaluationCategory = db.EvaluationCategories.Find(id); db.EvaluationCategories.Remove(evaluationCategory); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,InterviewID,EvaluationCode,EvaluationDescription,Deleted")] EvaluationCategory evaluationCategory) { if (ModelState.IsValid) { db.Entry(evaluationCategory).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.InterviewID = new SelectList(db.Interviews, "InterviewID", "SchedulingFinalNote", evaluationCategory.InterviewID); return(View(evaluationCategory)); }
// GET: EvaluationCategories/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EvaluationCategory evaluationCategory = db.EvaluationCategories.Find(id); if (evaluationCategory == null) { return(HttpNotFound()); } return(View(evaluationCategory)); }
// GET: EvaluationCategories/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EvaluationCategory evaluationCategory = db.EvaluationCategories.Find(id); if (evaluationCategory == null) { return(HttpNotFound()); } ViewBag.InterviewID = new SelectList(db.Interviews, "InterviewID", "SchedulingFinalNote", evaluationCategory.InterviewID); return(View(evaluationCategory)); }
/// <summary> /// Evaluates answer of given category. /// </summary> /// <param name="category">Category of evaluated part of dialog.</param> /// <param name="dialog">Dialog which part is evaluated.</param> /// <param name="answer">The evaluated answer.</param> private void evaluateAnswer(EvaluationCategory category, SingleQuestionLog dialog, IEnumerable <string> answer) { if (!dialog.HasAnnotation) { //nothing to evaluate return; } var isAnswerCorrect = Enumerable.SequenceEqual(dialog.LastQuestionTurnAnnotation.OrderBy(t => t), answer.OrderBy(t => t)); var categoryIndex = (int)category; if (isAnswerCorrect) { _correctPoints[categoryIndex] += 1; } else { _wrongPoints[categoryIndex] += 1; } }
/// <summary> /// Evaluates answer of given category. /// </summary> /// <param name="evaluatedTurns">Handler which is process given turns.</param> /// <param name="category">Category of evaluated part of dialog.</param> /// <param name="dialog">Dialog which part is evaluated.</param> /// <param name="answer">The evaluated answer.</param> private bool evaluate(Func <IEnumerable <TurnLog>, QuestionAnswerReceiveResult> handler, EvaluationCategory category, IEnumerable <TurnLog> evaluatedTurns, SingleQuestionLog dialog) { var answer = handler(dialog.QuestionTurns); if (!answer.IsKnown) { return(false); } evaluateAnswer(category, dialog, answer.AnswerEntities); return(true); }