/// <summary> /// View selected & non-selected question for provided course & exam /// </summary> public ActionResult ManageQuestions(int examId, int courseId) { int userId = Utilities.GetInstance().GetCurrentUserId(); //ExamQuestion examQuestion = db.ExamQuestions.Where(e => e.ExamId == examId & e.Exam.UserId == userId).FirstOrDefault(); int[] _examQuestions = Utilities.GetInstance().GetExamQuestion(examId); ViewBag.ExamQuestions = _examQuestions; // new SelectList(_examQuestions, "Id", "QuestionText"); ViewBag.ExamId = examId; ViewBag.ExamTitle = db.Exam.Where(p => p.Id == examId).FirstOrDefault().Title; var cls = db.CourseClass.FirstOrDefault(p => p.Id == courseId); ViewBag.CourseTitle = cls.Title; ViewBag.Questions = new SelectList(QuestionRepo.GetInstance().GetQuestionByCourse(cls.CourseId), "Id", "QuestionText"); return(View()); }