public ActionResult DeleteConfirmed(int id) { Subjective subjective = db.Subjectives.Find(id); db.Subjectives.Remove(subjective); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: Subjectives/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Subjective subjective = db.Subjectives.Find(id); if (subjective == null) { return(HttpNotFound()); } return(View(subjective)); }
public ActionResult Create([Bind(Include = "Code,SubName")] Subjective subjective) { if (ModelState.IsValid) { Person userperson = db.People.SingleOrDefault(p => p.ID == 0); subjective.Creator = userperson; subjective.Created = DateTime.Now; subjective.Modifier = userperson; subjective.Modified = DateTime.Now; db.Subjectives.Add(subjective); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(subjective)); }
private void gradeSection(int sectionCode, Bitmap stretched, Sectionizer testSections, ExamSpecifics exam, double avRadius) { if (sectionCode == 0) { LineScannerSC prelines = new LineScannerSC(testSections.studentCondition, avRadius); StudentCondition section1 = new StudentCondition(prelines.lineX, prelines.lineY, stretched, exam, avRadius); section1.scoreSection(stretched); // should be in a worker thread scannedScores[sectionCode] = (section1); } if (sectionCode == 1) { LineScannerMC prelines = new LineScannerMC(testSections.multipleChoice, avRadius); Multiple_Choice section1 = new Multiple_Choice(prelines.lineX, prelines.lineY, stretched, exam, avRadius); section1.scoreSection(stretched); // should be in a worker thread scannedScores[sectionCode] = (section1); } else if (sectionCode == 2) { LineScannerPairing prelines = new LineScannerPairing(testSections.pairing, avRadius); Pairing section2 = new Pairing(prelines.lineX, prelines.lineY, stretched, exam, avRadius); section2.scoreSection(stretched); // should be in a worker thread scannedScores[sectionCode] = (section2); } else if (sectionCode == 3) { LineScannerTF prelines = new LineScannerTF(testSections.trueFalse, avRadius); True_False section3 = new True_False(prelines.lineX, prelines.lineY, stretched, exam, avRadius); section3.scoreSection(stretched); // should be in a worker thread scannedScores[sectionCode] = (section3); } else if (sectionCode == 4) { LineScannerCompletion prelines = new LineScannerCompletion(testSections.completion, avRadius); Completion section4 = new Completion(prelines.lineX, prelines.lineY, stretched, exam, avRadius); section4.scoreSection(stretched); // should be in a worker thread scannedScores[sectionCode] = (section4); } else if (sectionCode == 5) { LineScannerSubjective prelines = new LineScannerSubjective(testSections.subjective, avRadius); Subjective section4 = new Subjective(prelines.lineX, prelines.lineY, stretched, exam, avRadius); section4.scoreSection(stretched); // should be in a worker thread scannedScores[sectionCode] = (section4); } }
public ActionResult Edit([Bind(Include = "Code,SubName")] Subjective subjective) { if (ModelState.IsValid) { Subjective subInDB = db.Subjectives.Single(s => s.Code == subjective.Code); subInDB.SubName = subjective.SubName; Person userperson = db.People.SingleOrDefault(p => p.ID == 0); subInDB.Modifier = userperson; subInDB.Modified = DateTime.Now; //db.Entry(subjective).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(subjective)); }