public DescriptiveAnswerSheetDTO GetDescriptiveAnswerSheetForExam(string papercode) { var paper = Mapper.Map <DescriptivePaper, DescriptivePaperDTO>(DescriptivePaperRepo.GetByPaperCode(papercode)); paper.PaperPdfUrl = paper.PaperPdfUrl.Replace(Fire.Ampersand, "&"); var ansSheet = new DescriptiveAnswerSheetDTO() { Paper = paper }; return(ansSheet); }
public async Task SetDescriptiveAnswerSheet(DescriptiveAnswerSheetDTO desanswersheetdto, string studentEmailId) { var answersheet = new DescriptiveAnswerSheet(); answersheet.StudentEmailId = studentEmailId; answersheet.SubmittedTime = DateTime.Now; answersheet.DescriptivePaperId = DescriptivePaperRepo.GetByPaperCode(desanswersheetdto.Paper.PaperCode).PaperId; string linkwith = await Fire.Upload(desanswersheetdto.AnswerSheet.OpenReadStream(), studentEmailId, desanswersheetdto.Paper.PaperCode); answersheet.AnswerLink = linkwith.Replace("&", Fire.Ampersand); DescriptiveAnswerSheetRepo.SetDescriptiveAnswerSheet(answersheet); }
public async Task <IActionResult> SubmitDescriptivePaper(DescriptiveAnswerSheetDTO answerSheet1) { await StudentService.SetDescriptiveAnswerSheet(answerSheet1, User.Identity.Name); return(RedirectToAction(nameof(HomeController.Index))); }