Ejemplo n.º 1
0
        public IActionResult SetGrade(string subjectName, int examId, [FromQuery] string studentId, int?sendFileId)
        {
            var gradeModel = new GradeSetInputModel
            {
                StudentId   = studentId,
                ExamId      = examId,
                SendFileId  = sendFileId,
                SubjectName = subjectName,
            };

            return(this.View(gradeModel));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> SetGrade(string subjectName, int examId, string studentId, int?sendFileId, GradeSetInputModel input)
        {
            if (!this.ModelState.IsValid)
            {
                return(this.View(input));
            }

            await this.examsService.SetGradeAsync(input.Mark, input.Description, examId, studentId, sendFileId);

            if (sendFileId != null)
            {
                return(this.RedirectToAction("SendedSolutions", "Exams", new { subjectName, examId }));
            }
            else
            {
                return(this.RedirectToAction("AllStudents", "Exams", new { subjectName, examId }));
            }
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> SetGrade(string subjectName, int homeworkId, string studentId, int sendFileId, GradeSetInputModel input)
        {
            if (!this.ModelState.IsValid)
            {
                return(this.View(input));
            }

            await this.homeworksService.SetGradeAsync(input.Mark, input.Description, homeworkId, studentId, sendFileId);

            return(this.RedirectToAction("Sended", "Homeworks", new { subjectName, homeworkId }));
        }