public ActionResult <List <Examination> > GetExaminationListByTeacherCode(int id, [FromQuery(Name = "len")] int len) { var dao = new ExaminationsDao(); return(dao.GetExaminationListByTeacher(id, len)); }
public ActionResult <AnswerSheet> UploadStudentAnswerSheet(int eid, [FromBody] AnswerSheet sheet) { Directory.CreateDirectory(STUDENT_ANS_SHEET_UPLOAD_PATH); if (sheet?.FileData.Length > 0) { var filePath = Path.Combine(STUDENT_ANS_SHEET_UPLOAD_PATH, sheet.FileName); var bytes = Convert.FromBase64String(sheet.FileData); System.IO.File.WriteAllBytes(filePath, bytes); var dao = new ExaminationsDao(); string path = dao.AddStudentAnswerSheet(eid, $"/api/examinations/student-ans-sheet/get/{sheet.FileName}"); sheet.FileData = ""; sheet.FilePath = path; return(sheet); } return(new AnswerSheet()); }
public ActionResult <List <Examination> > GetPendingExaminationListByTeacherCode(int id) { var dao = new ExaminationsDao(); return(dao.GetPendingExaminationListByTeacher(id)); }