Example #1
0
        public DescriptivePaperDTO getDescriptivePaper(string code)
        {
            var paper    = DescriptivePaperRepo.GetByPaperCode(code);
            var paperdto = Mapper.Map <DescriptivePaper, DescriptivePaperDTO>(paper);

            paperdto.PaperPdfUrl = paperdto.PaperPdfUrl.Replace(Fire.Ampersand, "&");
            return(paperdto);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
        public (DescriptivePaperDTO, List <DescriptiveAnswerSheetDTO>) GetDescriptiveAnswerSheetsBycode(string papercode)
        {
            var answersheets = DescriptiveAnswerSheetRepo.GetAllResponseByCode(papercode).ToList();
            var paper        = DescriptivePaperRepo.GetByPaperCode(papercode);

            var ans = (
                paper : Mapper.Map <DescriptivePaper, DescriptivePaperDTO>(paper),
                answersheets : Mapper.Map <IEnumerable <DescriptiveAnswerSheet>, List <DescriptiveAnswerSheetDTO> >(answersheets)
                );

            for (int i = 0; i < ans.Item2.Count; i++)
            {
                ans.answersheets[i].AnswerLink = ans.answersheets[i].AnswerLink.Replace("__AMP__", "&");
            }
            return(ans);
        }