public async Task <IActionResult> SendSolutionOnTask(StatusTaskViewModel model) { // check task id Student student = await _authentication.GetCurrentStudentAsync(); Models.Task task = _databaseWorker.GetTaskById(model.TaskId); // create answer await _taskService.SendSolutionOnTask(student, task, model.UploadedFile); return(RedirectToAction("IndexStudent", "Subject", new { subjectId = model.SubjectId })); }
public async Task <IActionResult> IndexStudent(int taskId, int subjectId) { Student student = await _authentication.GetCurrentStudentAsync(); Models.Task task = _databaseWorker.GetTaskById(taskId); // check taskId N_To_N_TaskStudent taskStudent = _taskService.GetTaskStudent(task, student); StatusTaskViewModel model = new StatusTaskViewModel { Task = task, TaskStudent = taskStudent, PresentTime = DateTime.Now, SubjectId = subjectId }; return(View(model)); }