예제 #1
0
        public void LoadStatsClassHW_TQ_Target()//测量目标
        {
            string temp    = "<a href='/teacher/HomeworkPreviewT.aspx?ResourceToResourceFolder_Id={0}#{1}' class='btn-link' target=\"_blank\">第{2}题</a>";
            string StrTemp = string.Empty;
            List <Model_StatsClassHW_TQ> StatsClassHW_TQ_list = new List <Model_StatsClassHW_TQ>();
            BLL_StatsClassHW_TQ          bll_StatsClassHW_TQ  = new BLL_StatsClassHW_TQ();

            StatsClassHW_TQ_list = bll_StatsClassHW_TQ.GetModelList("HomeWork_ID='" + HomeWork_Id + "' and ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "' and TargetText<>'' order by TestQuestions_Num,TestQuestions_OrderNum");
            foreach (var item in StatsClassHW_TQ_list)
            {
                DataRow[] drTQ_S    = dtTQ_S.Select("TestQuestions_Score_ID='" + item.TestQuestions_Score_ID + "'");
                string    testIndex = string.Empty;
                if (drTQ_S.Length > 0 && (drTQ_S[0]["TestType"].ToString() == "clozeTest" || drTQ_S[0]["TestType"].ToString() == "fill"))
                {
                    testIndex = string.IsNullOrEmpty(drTQ_S[0]["testIndex"].ToString()) ? "" : "-" + drTQ_S[0]["testIndex"].ToString();
                }
                StrTemp += string.Format(TempHW_TQ_Target
                                         , item.TargetText == "" ? "-" : item.TargetText
                                         , string.Format(temp, ResourceToResourceFolder_Id, item.TestQuestions_Num, item.topicNumber.TrimEnd('.') + testIndex)
                                         , item.TQ_Score.ToString().clearLastZero()
                                         , GetTQScore(item.TestQuestions_Score_ID)
                                         , item.ScoreAvg.ToString().clearLastZero()
                                         , item.ScoreAvgRate.ToString().clearLastZero());
            }
            this.ltlHW_TQ_Target.Text = StrTemp;
        }
예제 #2
0
        public static string GetStatsClassHW_TQ(string Class, string ResourceToResourceFolder_Id, string UserId)
        {
            try
            {
                Class = Class.Filter();
                ResourceToResourceFolder_Id = ResourceToResourceFolder_Id.Filter();
                UserId = UserId.Filter();
                string    TempDate = string.Empty;
                string    StrWhere = string.Empty;
                string    Temp     = "<tr><td>{0}</td><td>{1}</td><td class='text-left'>{2}</td><td class='text-left'>{3}</td><td>{4}</td><td>{5}</td><td>{6}</td><td>{7}</td><td>{8}</td><td>{9}%</td><td><a style='cursor:pointer;' onclick=\"javascript:PicPreview('../student/questionAttr.aspx?resourceid={10}&questionid={11}&attrType=AnalyzeHtml','解析');\">解析</a></td></tr>";
                DataTable dtTQ_S   = new BLL_TestQuestions_Score().GetList("ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "' order by TestQuestions_Num,TestQuestions_OrderNum ").Tables[0];

                if (Class == "-1")
                {
                    HttpContext.Current.Session["StatsClassClassId"] = "-1";
                    BLL_StatsTeacherHW_TQ          bllStatsTeacherHW_TQ  = new BLL_StatsTeacherHW_TQ();
                    List <Model_StatsTeacherHW_TQ> StatsTeacherHW_TQList = new List <Model_StatsTeacherHW_TQ>();

                    StatsTeacherHW_TQList = bllStatsTeacherHW_TQ.GetModelList("TQ_Score!=-1 and TeacherID='" + UserId + "' and ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "'" + StrWhere + " order by TestQuestions_Num,TestQuestions_OrderNum");
                    foreach (var item in StatsTeacherHW_TQList)
                    {
                        List <Model_StatsTeacherHW_TQ> listSub = StatsTeacherHW_TQList.Where(m => m.TestQuestions_Num == item.TestQuestions_Num).ToList();
                        DataRow[] drTQ_S    = dtTQ_S.Select("TestQuestions_Score_ID='" + item.TestQuestions_Score_ID + "'");
                        string    testIndex = string.Empty;
                        if (drTQ_S.Length > 0 && (drTQ_S[0]["TestType"].ToString() == "clozeTest" || drTQ_S[0]["TestType"].ToString() == "fill"))
                        {
                            testIndex = string.IsNullOrEmpty(drTQ_S[0]["testIndex"].ToString()) ? "" : "-" + drTQ_S[0]["testIndex"].ToString();
                        }
                        TempDate += string.Format(Temp
                                                  , item.topicNumber.TrimEnd('.') + testIndex
                                                  , item.TestQuestions_Type, item.TargetText, item.ContentText
                                                  , item.complexityText, item.TQ_Score.ToString().clearLastZero()
                                                  , item.ScoreAvg.ToString().clearLastZero() == null ? "0.00" : item.ScoreAvg.ToString().clearLastZero()
                                                  , item.StandardDeviation.ToString().clearLastZero() == null ? "0.00" : item.StandardDeviation.ToString().clearLastZero()
                                                  , item.Discrimination.ToString().clearLastZero() == null ? "0.00" : item.Discrimination.ToString().clearLastZero()
                                                  , item.ErrorRate.ToString().clearLastZero() == null ? "0.00" : item.ErrorRate.ToString().clearLastZero()
                                                  , item.ResourceToResourceFolder_Id, item.TestQuestions_Score_ID);
                    }
                    return(TempDate);
                }
                else
                {
                    HttpContext.Current.Session["StatsClassClassId"] = Class;
                    BLL_StatsClassHW_TQ          bllStatsClassHW_TQ = new BLL_StatsClassHW_TQ();
                    List <Model_StatsClassHW_TQ> ClassHW_TQList     = new List <Model_StatsClassHW_TQ>();
                    ClassHW_TQList = bllStatsClassHW_TQ.GetModelList("TQ_Score!=-1 and ClassID='" + Class + "' and ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "' " + StrWhere + " order by TestQuestions_Num,TestQuestions_OrderNum ");
                    foreach (var item in ClassHW_TQList)
                    {
                        List <Model_StatsClassHW_TQ> listSub = ClassHW_TQList.Where(m => m.TestQuestions_Num == item.TestQuestions_Num).ToList();
                        DataRow[] drTQ_S    = dtTQ_S.Select("TestQuestions_Score_ID='" + item.TestQuestions_Score_ID + "'");
                        string    testIndex = string.Empty;
                        if (drTQ_S.Length > 0 && (drTQ_S[0]["TestType"].ToString() == "clozeTest" || drTQ_S[0]["TestType"].ToString() == "fill"))
                        {
                            testIndex = string.IsNullOrEmpty(drTQ_S[0]["testIndex"].ToString()) ? "" : "-" + drTQ_S[0]["testIndex"].ToString();
                        }
                        TempDate += string.Format(Temp
                                                  , item.topicNumber.TrimEnd('.') + testIndex
                                                  , item.TestQuestions_Type, item.TargetText, item.ContentText
                                                  , item.complexityText, item.TQ_Score.ToString().clearLastZero()
                                                  , item.ScoreAvg.ToString().clearLastZero() == null ? "0.00" : item.ScoreAvg.ToString().clearLastZero()
                                                  , item.StandardDeviation.ToString().clearLastZero() == null ? "0.00" : item.StandardDeviation.ToString().clearLastZero()
                                                  , item.Discrimination.ToString().clearLastZero() == null ? "0.00" : item.Discrimination.ToString().clearLastZero()
                                                  , item.ErrorRate.ToString().clearLastZero() == null ? "0.00" : item.ErrorRate.ToString().clearLastZero()
                                                  , item.ResourceToResourceFolder_Id, item.TestQuestions_Score_ID);
                    }
                    return(TempDate);
                }
            }
            catch (Exception)
            {
                return("");
            }
        }
예제 #3
0
        public static string StatsClassHW_TQ(string ResourceToResourceFolder_Id, string UserId, string ClassID)
        {
            try
            {
                string StrWhere = "ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id.Filter() + "' and TeacherID='" + UserId.Filter() + "'";
                //if (!string.IsNullOrEmpty(ClassID.Filter()))
                //{
                //    StrWhere += " and ClassID='" + ClassID.Filter() + "'";
                //}
                StringBuilder                StrTBody            = new StringBuilder();
                StringBuilder                StrTHead            = new StringBuilder();
                string                       StrClassname        = string.Empty;
                string                       DateSour            = string.Empty;
                string                       StrScoreTemp        = string.Empty;
                string                       StrTQNum            = string.Empty;
                BLL_StatsClassHW_TQ          bllStatsClassHW_TQ  = new BLL_StatsClassHW_TQ();
                List <Model_StatsClassHW_TQ> StatsClassHW_TQList = new List <Model_StatsClassHW_TQ>();
                List <Model_StatsClassHW_TQ> listAll             = new List <Model_StatsClassHW_TQ>();                                                                               //所有数据
                listAll = bllStatsClassHW_TQ.GetModelList(StrWhere + " order by TestQuestions_Num,TestQuestions_OrderNum ");
                List <Model_StatsClassHW_TQ> listDistictClass = listAll.Where((x, i) => listAll.FindIndex(z => z.ClassID == x.ClassID) == i).ToList();                               //去重后数据
                List <Model_StatsClassHW_TQ> listDistictTQ    = listAll.Where((x, i) => listAll.FindIndex(z => z.TestQuestions_Score_ID == x.TestQuestions_Score_ID) == i).ToList(); //去重后数据
                StrTHead.Append("<tr><td>题号</td><td>小题分数</td>");

                foreach (var item in listDistictClass)
                {
                    StrTHead.AppendFormat("<td>{0}平均得分率</td>", item.ClassName);
                    List <Model_StatsClassHW_TQ> listAllbyClass = listAll.Where(x => x.ClassID == item.ClassID).ToList();
                    foreach (var itemtq in listAllbyClass)
                    {
                        StrScoreTemp += itemtq.ScoreAvgRate.ToString().clearLastZero() + ",";
                    }

                    DateSour    += "{\"name\":\"" + item.ClassName + "\",\"data\":[" + StrScoreTemp.TrimEnd(',') + "]},";
                    StrScoreTemp = "";
                }
                StrTHead.Append("</tr>");

                DataTable dtTQ_S = new BLL_TestQuestions_Score().GetList("ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "' order by TestQuestions_Num,TestQuestions_OrderNum ").Tables[0];

                foreach (var item in listDistictTQ)
                {
                    DataRow[] drTQ_S    = dtTQ_S.Select("TestQuestions_Score_ID='" + item.TestQuestions_Score_ID + "'");
                    string    testIndex = string.Empty;
                    if (drTQ_S.Length > 0 && (drTQ_S[0]["TestType"].ToString() == "clozeTest" || drTQ_S[0]["TestType"].ToString() == "fill"))
                    {
                        testIndex = string.IsNullOrEmpty(drTQ_S[0]["testIndex"].ToString()) ? "" : "-" + drTQ_S[0]["testIndex"].ToString();
                    }
                    List <Model_StatsClassHW_TQ> listSub = listDistictTQ.Where(m => m.TestQuestions_Num == item.TestQuestions_Num).ToList();
                    StrTBody.AppendFormat("<tr><td>{0}</td><td>{1}</td>"
                                          , item.topicNumber.TrimEnd('.') + testIndex
                                          , item.TQ_Score.ToString().clearLastZero());
                    foreach (var itemClass in listDistictClass)
                    {
                        List <Model_StatsClassHW_TQ> listDistictBody = listAll.Where(x => x.ClassID == itemClass.ClassID && x.TestQuestions_Score_ID == item.TestQuestions_Score_ID).ToList();
                        foreach (var itemBody in listDistictBody)
                        {
                            StrTBody.AppendFormat("<td>{0}%</td>", itemBody.ScoreAvgRate.ToString().clearLastZero());
                        }
                        if (listDistictBody.Count == 0)
                        {
                            StrTBody.Append("<td>-</td>");
                        }
                    }
                    StrTQNum += item.topicNumber.TrimEnd('.') + "题,";
                    StrTBody.Append("</tr>");
                }
                string oo = DateSour;
                return(Newtonsoft.Json.JsonConvert.SerializeObject(new
                {
                    thead = StrTHead.ToString(),
                    tbody = StrTBody.ToString(),
                    DateSour = "[" + DateSour.TrimEnd(',') + "]",
                    StrTQNum = StrTQNum.TrimEnd(',')
                }));
            }

            catch (Exception)
            {
                return("");
            }
        }
예제 #4
0
        public static string GetStatsGradeHW_TQ(string ResourceToResourceFolder_Id, string GradeId)
        {
            try
            {
                StringBuilder StrTBody           = new StringBuilder();
                StringBuilder StrTHead           = new StringBuilder();
                string        StrClassname       = string.Empty;
                string        DateSour           = string.Empty;
                string        KPScoreAvgRateTemp = string.Empty;
                string        StrKPNum           = string.Empty;
                //班级
                BLL_StatsClassHW_TQ          bllStatsClassHW_TQ  = new BLL_StatsClassHW_TQ();
                List <Model_StatsClassHW_TQ> StatsClassHW_TQList = new List <Model_StatsClassHW_TQ>();
                List <Model_StatsClassHW_TQ> listAll             = new List <Model_StatsClassHW_TQ>();                                                                               //所有数据
                listAll = bllStatsClassHW_TQ.GetModelList("ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "' and Gradeid='" + GradeId + "' order by TestQuestions_Num ");
                List <Model_StatsClassHW_TQ> listDistictClass = listAll.Where((x, i) => listAll.FindIndex(z => z.ClassID == x.ClassID) == i).ToList();                               //去重后数据
                List <Model_StatsClassHW_TQ> listDistictKP    = listAll.Where((x, i) => listAll.FindIndex(z => z.TestQuestions_Score_ID == x.TestQuestions_Score_ID) == i).ToList(); //去重后数据

                foreach (var item in listDistictClass)
                {
                    StrTHead.AppendFormat("<li title='{0}得分率'>{0}得分率</li>", item.ClassName);
                }

                //年级
                DataTable                    dtTQ_S                 = new BLL_TestQuestions_Score().GetList("ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "' order by TestQuestions_Num,TestQuestions_OrderNum ").Tables[0];
                BLL_StatsGradeHW_TQ          bllStatsGradeHW_TQ     = new BLL_StatsGradeHW_TQ();
                List <Model_StatsGradeHW_TQ> StatsGradeHW_TQlistAll = new List <Model_StatsGradeHW_TQ>();                                                                                                             //所有数据
                StatsGradeHW_TQlistAll = bllStatsGradeHW_TQ.GetModelList("TQ_Score!=-1 and ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "' and Gradeid='" + GradeId + "' order by TestQuestions_Num,TestQuestions_OrderNum ");
                List <Model_StatsGradeHW_TQ> listStatsGradeHW_TQ = StatsGradeHW_TQlistAll.Where((x, i) => StatsGradeHW_TQlistAll.FindIndex(z => z.TestQuestions_Score_ID == x.TestQuestions_Score_ID) == i).ToList(); //去重后数据
                string GradeBody = string.Empty;
                GradeBody = "<ul class=\"clearfix\"><li class=\"perform_left\"><ul class=\"clearfix\"><li class=\"l_1\">{0}</li><li class=\"l_2\">{1}</li><li class=\"l_3\">{2}%</li></ul></li>";
                foreach (var item in listStatsGradeHW_TQ)
                {
                    List <Model_StatsGradeHW_TQ> listSub = StatsGradeHW_TQlistAll.Where(m => m.TestQuestions_Num == item.TestQuestions_Num).ToList();
                    DataRow[] drTQ_S    = dtTQ_S.Select("TestQuestions_Score_ID='" + item.TestQuestions_Score_ID + "'");
                    string    testIndex = string.Empty;
                    if (drTQ_S.Length > 0 && (drTQ_S[0]["TestType"].ToString() == "clozeTest" || drTQ_S[0]["TestType"].ToString() == "fill"))
                    {
                        testIndex = string.IsNullOrEmpty(drTQ_S[0]["testIndex"].ToString()) ? "" : "-" + drTQ_S[0]["testIndex"].ToString();
                    }
                    StrTBody.AppendFormat(GradeBody
                                          , item.topicNumber.TrimEnd('.') + testIndex
                                          , item.TQ_Score.ToString().clearLastZero()
                                          , item.ScoreAvgRate.ToString().clearLastZero());
                    StrTBody.Append("<li class=\"perform_center\"><div class=\"perform_div\" data-name=\"perform_div\"><ul class=\"clearfix\">");
                    foreach (var itemClass in listDistictClass)
                    {
                        List <Model_StatsClassHW_TQ> listDistictBody = listAll.Where(x => x.ClassID == itemClass.ClassID && x.TestQuestions_Score_ID == item.TestQuestions_Score_ID).ToList();
                        foreach (var itemBody in listDistictBody)
                        {
                            StrTBody.AppendFormat("<li>{0}%</li>", itemBody.ScoreAvgRate.ToString().clearLastZero());
                        }
                        if (listDistictBody.Count == 0)
                        {
                            StrTBody.Append("<li>-</li>");
                        }
                    }
                    StrTBody.Append("</ul></div></li></ul>");
                }
                string oo = StrTBody.ToString();
                return(Newtonsoft.Json.JsonConvert.SerializeObject(new
                {
                    err = "",
                    thead = StrTHead.ToString(),
                    tbody = StrTBody.ToString()
                }));
            }

            catch (Exception)
            {
                return("");
            }
        }