public RealExam[] GetAllPastStudentExams(RealExamProxy realExamProxy, int studentId) { List <StudentExam> allExams = studentExamController.GetAllStudentExams(studentId); List <RealExam> allRealExams = new List <RealExam>(); foreach (StudentExam exam in allExams) { allRealExams.Add(realExamProxy.GetStudentExam(exam.Id)); } return(allRealExams.ToArray()); }
public ActionResult Get(int id) { var result = studentExamProxy.GetStudentExam(id); if (result == null) { StudentExamController.currentExam = null; return(NotFound()); } RealExamProxy.UpdateStudentExam(result.Id); StudentExamController.currentExam = result; return(Ok(result)); }