public JsonResult GetLessonReport(int SubjectID)
        {
            ReportModel ReportDetails = new ReportModel();

            LessionWiseReportModel _StudentReportDetails = new LessionWiseReportModel();

            string  _GetLessonReportString = StudentWeb.GetLessionWiseReport(Convert.ToInt32(Session["UserId"].ToString()), SubjectID);
            JObject Studentparsing         = JObject.Parse(_GetLessonReportString);

            int _lessionReportCount = (Int32)Studentparsing["Table"].Count();

            List <LessionWiseReportModel> _lessionWiseReportModelList = new List <LessionWiseReportModel>();

            for (int i = 0; i < _lessionReportCount; i++)
            {
                LessionWiseReportModel _lessionWiseReportModel = new LessionWiseReportModel();
                _lessionWiseReportModel.StudentId      = (Int32)Studentparsing["Table"][i]["StudentId"];
                _lessionWiseReportModel.SubjectId      = (Int32)Studentparsing["Table"][i]["SubjectId"];
                _lessionWiseReportModel.LessionName    = (String)Studentparsing["Table"][i]["LessionName"];
                _lessionWiseReportModel.Percentage     = (Int32)Studentparsing["Table"][i]["Percentage"];
                _lessionWiseReportModel.QuestionsAsked = (Int32)Studentparsing["Table"][i]["QuestionsAsked"];
                _lessionWiseReportModel.CorrectAnswers = (Int32)Studentparsing["Table"][i]["CorrectAnswers"];
                _lessionWiseReportModelList.Add(_lessionWiseReportModel);
            }
            ReportDetails.LessonWiseReportList = _lessionWiseReportModelList;
            return(Json(ReportDetails, JsonRequestBehavior.AllowGet));
        }
Example #2
0
        public ActionResult Rerport()
        {
            StudentGeneralDetails objStudentLoginDetails = new StudentGeneralDetails();

            objStudentLoginDetails.BoardName    = GlobalStudentClass.BoardName;
            objStudentLoginDetails.CityName     = GlobalStudentClass.CityName;
            objStudentLoginDetails.ClassName    = GlobalStudentClass.ClassName;
            objStudentLoginDetails.DistrictName = GlobalStudentClass.DistrictName;
            objStudentLoginDetails.EmailAddress = GlobalStudentClass.EmailAddress;
            objStudentLoginDetails.Name         = GlobalStudentClass.Name;
            objStudentLoginDetails.PhoneNumber  = GlobalStudentClass.PhoneNumber;
            objStudentLoginDetails.StateName    = GlobalStudentClass.StateName;
            objStudentLoginDetails.StudentId    = GlobalStudentClass.StudentId;

            objStudentLoginDetails.InstitutionName = GlobalStudentClass.InstitutionName;
            ReportModel ReportDetails = new ReportModel();

            LessionWiseReportModel _StudentReportDetails = new LessionWiseReportModel();


            ReportDetails.StudentGeneralDetails = objStudentLoginDetails;

            string _GetStudentDashboardDetails = StudentWeb.GetLessionWiseReport(GlobalStudentClass.StudentId, GlobalStudentSubjects.SubjectList[0].SubjectID);

            JObject Studentparsing = JObject.Parse(_GetStudentDashboardDetails);


            int _lessionReportCount = (Int32)Studentparsing["Table"].Count();

            List <LessionWiseReportModel> _lessionWiseReportModelList = new List <LessionWiseReportModel>();

            for (int i = 0; i < _lessionReportCount; i++)
            {
                LessionWiseReportModel _lessionWiseReportModel = new LessionWiseReportModel();
                _lessionWiseReportModel.StudentId      = (Int32)Studentparsing["Table"][i]["StudentId"];
                _lessionWiseReportModel.SubjectId      = (Int32)Studentparsing["Table"][i]["SubjectId"];
                _lessionWiseReportModel.LessionName    = (String)Studentparsing["Table"][i]["LessionName"];
                _lessionWiseReportModel.Percentage     = (Int32)Studentparsing["Table"][i]["Percentage"];
                _lessionWiseReportModel.QuestionsAsked = (Int32)Studentparsing["Table"][i]["QuestionsAsked"];
                _lessionWiseReportModel.CorrectAnswers = (Int32)Studentparsing["Table"][i]["CorrectAnswers"];
                _lessionWiseReportModelList.Add(_lessionWiseReportModel);
            }
            ReportDetails.LessonWiseReportList  = _lessionWiseReportModelList;
            ReportDetails.StudentSubjectList    = GlobalStudentSubjects.SubjectList;
            ReportDetails.StudentGeneralDetails = objStudentLoginDetails;
            return(View(ReportDetails));
        }
        public ActionResult Report()
        {
            {
                string  dashboardOutput          = StudentWeb.GetStudentDetails(Convert.ToInt32(Session["UserId"].ToString()));
                JObject _StudentDashboardParsing = JObject.Parse(dashboardOutput);

                StudentGeneralDetails _studentDetails = new StudentGeneralDetails();
                _studentDetails.BoardName       = (String)_StudentDashboardParsing["Table"][0]["BoardName"];
                _studentDetails.CityName        = (String)_StudentDashboardParsing["Table"][0]["CityName"];
                _studentDetails.ClassName       = (String)_StudentDashboardParsing["Table"][0]["ClassName"];
                _studentDetails.DistrictName    = (String)_StudentDashboardParsing["Table"][0]["DistrictName"];
                _studentDetails.EmailAddress    = (String)_StudentDashboardParsing["Table"][0]["EmailAddress"];
                _studentDetails.Name            = (String)_StudentDashboardParsing["Table"][0]["FirstName"];
                _studentDetails.PhoneNumber     = (String)_StudentDashboardParsing["Table"][0]["PhoneNumber"];
                _studentDetails.StateName       = (String)_StudentDashboardParsing["Table"][0]["StateName"];
                _studentDetails.StudentId       = (Int32)_StudentDashboardParsing["Table"][0]["StudentId"];
                _studentDetails.InstitutionName = (String)_StudentDashboardParsing["Table"][0]["InstitutionName"];

                ReportModel ReportDetails = new ReportModel();

                LessionWiseReportModel _StudentReportDetails = new LessionWiseReportModel();

                string  studentDashboard       = StudentWeb.StudentDashboardDetails(Convert.ToInt32(Session["UserId"].ToString()));
                JObject _studentDashboardParse = JObject.Parse(studentDashboard);

                int _SubjectCount = (Int32)_studentDashboardParse["Table4"].Count();
                List <SubjectDetails> _SubjectDetailsList = new List <SubjectDetails>();
                for (int i = 0; i < _SubjectCount; i++)
                {
                    SubjectDetails _SubjectDetails = new SubjectDetails();
                    _SubjectDetails.SubjectName = (String)_studentDashboardParse["Table4"][i]["SubjectName"];
                    _SubjectDetails.SubjectID   = (Int32)_studentDashboardParse["Table4"][i]["SubjectId"];

                    _SubjectDetailsList.Add(_SubjectDetails);
                }


                ReportDetails.StudentGeneralDetails = _studentDetails;

                string _GetStudentDashboardDetails = StudentWeb.GetLessionWiseReport(_studentDetails.StudentId, _SubjectDetailsList[0].SubjectID);

                JObject Studentparsing = JObject.Parse(_GetStudentDashboardDetails);


                int _lessionReportCount = (Int32)Studentparsing["Table"].Count();

                List <LessionWiseReportModel> _lessionWiseReportModelList = new List <LessionWiseReportModel>();

                for (int i = 0; i < _lessionReportCount; i++)
                {
                    LessionWiseReportModel _lessionWiseReportModel = new LessionWiseReportModel();
                    _lessionWiseReportModel.StudentId      = (Int32)Studentparsing["Table"][i]["StudentId"];
                    _lessionWiseReportModel.SubjectId      = (Int32)Studentparsing["Table"][i]["SubjectId"];
                    _lessionWiseReportModel.LessionName    = (String)Studentparsing["Table"][i]["LessionName"];
                    _lessionWiseReportModel.Percentage     = (Int32)Studentparsing["Table"][i]["Percentage"];
                    _lessionWiseReportModel.QuestionsAsked = (Int32)Studentparsing["Table"][i]["QuestionsAsked"];
                    _lessionWiseReportModel.CorrectAnswers = (Int32)Studentparsing["Table"][i]["CorrectAnswers"];
                    _lessionWiseReportModelList.Add(_lessionWiseReportModel);
                }



                //Completed TEst Details
                string  _GetTestCompletedDetails            = StudentWeb.GetWritenTestDetails(_studentDetails.StudentId);
                JObject WrittenTestparsing                  = JObject.Parse(_GetTestCompletedDetails);
                int     _WrittenTestCount                   = (Int32)WrittenTestparsing["Table"].Count();
                List <CompletedTestList> _CompletedTestList = new List <CompletedTestList>();
                for (int i = 0; i < _WrittenTestCount; i++)
                {
                    CompletedTestList _CompletedTestListReportModel = new CompletedTestList();
                    _CompletedTestListReportModel.Description = (String)WrittenTestparsing["Table"][i]["Description"];
                    _CompletedTestListReportModel.MarksScored = (Int32)WrittenTestparsing["Table"][i]["MarksScored"];
                    _CompletedTestListReportModel.SubjectId   = (Int32)WrittenTestparsing["Table"][i]["SubjectId"];
                    if (_CompletedTestListReportModel.SubjectId == 1)
                    {
                        _CompletedTestListReportModel.SubjectName = "Maths";
                    }
                    else if (_CompletedTestListReportModel.SubjectId == 2)
                    {
                        _CompletedTestListReportModel.SubjectName = "Science";
                    }
                    else if (_CompletedTestListReportModel.SubjectId == 3)
                    {
                        _CompletedTestListReportModel.SubjectName = "Social";
                    }
                    else if (_CompletedTestListReportModel.SubjectId == 4)
                    {
                        _CompletedTestListReportModel.SubjectName = "Maths";
                    }
                    else if (_CompletedTestListReportModel.SubjectId == 5)
                    {
                        _CompletedTestListReportModel.SubjectName = "Chemistry";
                    }
                    else if (_CompletedTestListReportModel.SubjectId == 6)
                    {
                        _CompletedTestListReportModel.SubjectName = "Physics";
                    }
                    else if (_CompletedTestListReportModel.SubjectId == 7)
                    {
                        _CompletedTestListReportModel.SubjectName = "Computer";
                    }
                    else if (_CompletedTestListReportModel.SubjectId == 8)
                    {
                        _CompletedTestListReportModel.SubjectName = "Biology";
                    }
                    _CompletedTestListReportModel.TestId = (Int32)WrittenTestparsing["Table"][i]["TestId"];


                    _CompletedTestList.Add(_CompletedTestListReportModel);
                }
                //--Completed TEst Details--//



                ReportDetails.LessonWiseReportList  = _lessionWiseReportModelList;
                ReportDetails.StudentSubjectList    = _SubjectDetailsList;
                ReportDetails.StudentGeneralDetails = _studentDetails;
                ReportDetails.CompletedTestList     = _CompletedTestList;
                return(View(ReportDetails));
            }
        }