Ejemplo n.º 1
0
        public JsonResult GetSubjectsOfLearning(List <int> subjectIds)
        {
            SubjectBll subjectBll = new SubjectBll();
            var        result     = subjectBll.GetCompleteContentsOfSubject(subjectIds);

            return(Json(new SuccessJsonResponse(result), JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public JsonResult GetSubjectOfLearning(int subjectId)
        {
            SubjectBll subjectBll = new SubjectBll();
            var        result     = subjectBll.GetCompleteContentsOfSubject(new List <int> {
                subjectId
            });

            return(Json(
                       new SuccessJsonResponse(result.FirstOrDefault()),
                       JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 获取题目详情
        /// </summary>
        /// <param name="wrongSubjectId"></param>
        /// <returns></returns>
        public ActionResult SubjectDetail(int wrongSubjectId)
        {
            StudentWrongBookBll wrongBookBll = new StudentWrongBookBll();
            SubjectBll          subjectBll   = new SubjectBll();

            var wrongSubject = wrongBookBll.GetWrongSubject(wrongSubjectId);

            if (CheckWrongSubject(wrongSubject))
            {
                var subjectContent = subjectBll.GetCompleteContentsOfSubject(new List <int> {
                    wrongSubject.Yws_WrongSubjectId
                }).FirstOrDefault();
                return(Json(new SuccessJsonResponse(subjectContent), JsonRequestBehavior.AllowGet));
            }
            return(SimpleResult(false));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 获取关联题目详情
        /// </summary>
        /// <param name="wrongSubjectId"></param>
        /// <returns></returns>
        public ActionResult SubjectRelation(int wrongSubjectId)
        {
            StudentWrongBookBll wrongBookBll = new StudentWrongBookBll();
            SubjectBll          subjectBll   = new SubjectBll();
            var wrongSubject = wrongBookBll.GetWrongSubject(wrongSubjectId);

            if (CheckWrongSubject(wrongSubject))
            {
                var subjectList = subjectBll.GetSubjectForWrongClear(wrongSubject.Yws_WrongSubjectId);
                var contentList = subjectBll.GetCompleteContentsOfSubject(subjectList.Select(s => s.Ysj_Id).ToList());
                contentList.ForEach(s =>
                {
                    s.KnowledgeId = subjectList.Where(sub => sub.Ysj_Id == s.SubjectId).Select(sub => sub.Ysj_MainKnowledgeId).FirstOrDefault();
                });
                //   contentList = contentList.Take(1).ToList();
                return(Json(
                           new AbhsTableJsonResponse(contentList, contentList.Count),
                           JsonRequestBehavior.AllowGet));
            }
            return(SimpleResult(false));
        }