Ejemplo n.º 1
0
        //得分概况
        public void LoadDateHw_score()
        {
            string strClassCount = "0";
            string StrTemp       = string.Empty;
            List <Model_StatsClassHW_Score> StatsClassHW_Score_list = new List <Model_StatsClassHW_Score>();

            StatsClassHW_Score_list = bll_StatsClassHW_Score.GetModelList("HomeWork_ID='" + HomeWork_Id + "' and ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "'");
            foreach (var item in StatsClassHW_Score_list)//
            {
                StrTemp       = string.Format(TempHw_Score, item.AVGScore.ToString().clearLastZero(), item.LowestScore.ToString().clearLastZero(), item.HighestScore.ToString().clearLastZero());
                strClassCount = item.ClassAllCount.ToString().clearLastZero();
            }
            BLL_StatsClassStudentHW_Score          bll_StatsClassStudentHW_Score  = new BLL_StatsClassStudentHW_Score();
            List <Model_StatsClassStudentHW_Score> StatsClassStudentHW_Score_list = new List <Model_StatsClassStudentHW_Score>();

            StatsClassStudentHW_Score_list = bll_StatsClassStudentHW_Score.GetModelList("HomeWork_ID='" + HomeWork_Id + "' and ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "' and  StudentID='" + StudentId + "'");
            foreach (var item in StatsClassStudentHW_Score_list)
            {
                StrTemp += string.Format(Temp_HwStudent_Score
                                         , item.StudentScore.ToString().clearLastZero()
                                         , Convert.ToInt32(item.StudentScoreOrder).ToString()
                                         , item.Hierarchy.ToString().clearLastZero()
                                         , item.HWScoreLevelName
                                         , strClassCount);
            }
            this.ltlHw_Score.Text = StrTemp;
        }
Ejemplo n.º 2
0
 public static string getData(string Student_ID, string SubjectID)
 {
     try
     {
         string strScore      = string.Empty;
         string strScoreOrder = string.Empty;
         string strHWName     = string.Empty;
         BLL_StatsClassStudentHW_Score          bll_StatsClassStudentHW_Score = new BLL_StatsClassStudentHW_Score();
         List <Model_StatsClassStudentHW_Score> list = new List <Model_StatsClassStudentHW_Score>();
         list = bll_StatsClassStudentHW_Score.GetModelList("StudentID = '" + Student_ID + "' and SubjectID='" + SubjectID + "' ORDER BY HomeWorkCreateTime");
         foreach (var item in list)
         {
             strScore      += item.StudentScore.ToString() + ",";
             strScoreOrder += item.StudentScoreOrder.ToString() + ",";
             strHWName     += ((!string.IsNullOrEmpty(item.Resource_Name.ToString())) ? item.Resource_Name.ToString().ReplaceForFilter() : "-") + ",";
         }
         return(Newtonsoft.Json.JsonConvert.SerializeObject(new
         {
             Score = strScore.TrimEnd(','),
             ScoreOrder = strScoreOrder.TrimEnd(','),
             HWName = strHWName.TrimEnd(',')
         }));
     }
     catch (Exception)
     {
         return("err");
     }
 }
Ejemplo n.º 3
0
        protected void LoadData()
        {
            dtTQ_S = new BLL_TestQuestions_Score().GetList("ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "' order by TestQuestions_Num,TestQuestions_OrderNum ").Tables[0];

            DataTable dt = new BLL_StatsClassStudentHW_Score().GetList("HomeWork_ID='" + HomeWork_Id + "' and ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "' and StudentId='" + StudentId + "' ").Tables[0];

            if (dt.Rows.Count > 0)
            {
                string tempSql = string.Empty;
                tempSql = string.Format(@"select COUNT(1) as icount from Student_HomeWork shw inner join Student_HomeWork_Correct shwCorrect on shwCorrect.Student_HomeWork_Id=shw.Student_HomeWork_Id  where HomeWork_Id='{0}' 
and Student_Id='{1}'
and shwCorrect.Student_HomeWork_CorrectStatus='{2}'", HomeWork_Id, StudentId, "1");
                int i = int.Parse(Rc.Common.DBUtility.DbHelperSQL.GetSingle(tempSql).ToString());
                this.ltlHomeWork_Name.Text = dt.Rows[0]["Resource_Name"].ToString().ReplaceForFilter()
                                             + (i > 0 ? "<span class='panel_state bg-success'>已完成批改</span>" : "<span class='panel_state bg-warning'>未完成批改</span>");
                this.ltlGradeName.Text    = dt.Rows[0]["GradeName"].ToString();
                this.ltlClassName.Text    = dt.Rows[0]["ClassName"].ToString();
                this.ltlStudentName.Text  = dt.Rows[0]["StudentName"].ToString();
                this.ltlHWScore.Text      = dt.Rows[0]["HWScore"].ToString().clearLastZero();
                this.ltlStudentScore.Text = dt.Rows[0]["StudentScore"].ToString().clearLastZero();

                #region 获取小题得分列表
                string strSql = @"select HomeWork_Id,TestQuestions_Score_ID,Student_Id,Student_Score from Student_HomeWorkAnswer where  HomeWork_Id='" + HomeWork_Id + "' and Student_Id='" + StudentId + "'";
                dtStu_Score = DbHelperSQL.Query(strSql).Tables[0];
                #endregion
                #region 获取知识点得分列表
                //,KPScoreStudentSum=(select ISNULL(SUM(Student_Score),0) from Student_HomeWorkAnswer where Student_Id=stuHW.Student_Id and HomeWork_Id=hw.HomeWork_Id and TestQuestions_Score_ID in(select TestQuestions_Score_ID from TestQuestions_Score where ContentText=tqs.ContentText))
                strSql     = @"	select
	tqs.ResourceToResourceFolder_Id
	,hw.HomeWork_Id
	,stuHW.Student_Id as StudentId
	,left(tqs.ContentText,100) as KPName
    ,ISNULL(SUM(TestQuestions_Score),0) as KPScoreSum	
    ,KPScoreStudentSum=(select ISNULL(SUM(Student_Score),0) from Student_HomeWorkAnswer t 
	inner join TestQuestions_Score t2 on t2.TestQuestions_Score_Id=t.TestQuestions_Score_Id and t2.ContentText=tqs.ContentText
	 where Student_Id=stuHW.Student_Id and HomeWork_Id=hw.HomeWork_Id )	
    from TestQuestions_Score tqs
	left join HomeWork hw on hw.ResourceToResourceFolder_Id=tqs.ResourceToResourceFolder_Id
	left join Student_HomeWork stuHW on stuHW.HomeWork_Id=hw.HomeWork_Id	
	where  stuHW.Student_Id='"     + StudentId + "' and hw.HomeWork_Id='" + HomeWork_Id + "' group by tqs.ResourceToResourceFolder_Id,hw.HomeWork_Id,stuHW.Student_Id,tqs.ContentText";
                dt_KPScore = DbHelperSQL.Query(strSql).Tables[0];
                #endregion

                LoadDateHw_score();
                LoadStatsClassHW_TQ();
                LoadStatsClassHW_KP();
                LoadStatsClassHW_TQ_Target();
            }
            else
            {
                IsTrue = "1";
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 获得基本信息
        /// </summary>
        /// <returns></returns>
        protected void getCommon()
        {
            StringBuilder commonInfo = new StringBuilder();
            DataTable     dt         = new DataTable();

            dt = new BLL_StatsClassStudentHW_Score().GetList("StudentId = '" + Student_ID + "' and HomeWork_ID= '" + HomeWork_ID + "' ").Tables[0];
            foreach (DataRow item in dt.Rows)
            {
                StudentName   = item["StudentName"].ToString() + "的成长轨迹";
                HomeWork_Name = item["Resource_Name"].ToString().ReplaceForFilter();
                SubjectID     = item["SubjectID"].ToString();
                commonInfo.AppendFormat("<span>年级:{0}</span>", item["GradeName"].ToString());
                commonInfo.AppendFormat("<span>班级:{0}</span>", item["ClassName"].ToString());
                commonInfo.AppendFormat("<span>学生:{0}</span>", item["StudentName"].ToString());
                commonInfo.AppendFormat("<span>满分:{0}分</span>", item["HWScore"].ToString().clearLastZero());
                commonInfo.AppendFormat("<span>得分:{0}分</span>", item["StudentScore"].ToString().clearLastZero());
            }
            ltlCommonInfo.Text = commonInfo.ToString();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 获得基本信息
        /// </summary>
        /// <returns></returns>
        protected void getCommon()
        {
            StringBuilder commonInfo = new StringBuilder();
            DataTable     dt         = new DataTable();
            BLL_StatsClassStudentHW_Score bll_StatsClassStudentHW_Score = new BLL_StatsClassStudentHW_Score();

            dt = bll_StatsClassStudentHW_Score.GetList("StatsClassStudentHW_ScoreID = '" + StatsClassStudentHW_ScoreID + "'").Tables[0];
            foreach (DataRow item in dt.Rows)
            {
                PageTitle  = item["StudentName"].ToString() + "的成长轨迹";
                Student_ID = item["StudentID"].ToString();
                SubjectID  = item["SubjectID"].ToString();
                ClassID    = item["ClassID"].ToString();
                GradeID    = item["GradeID"].ToString();
                commonInfo.AppendFormat("<span>年级:{0}</span>", item["GradeName"].ToString());
                commonInfo.AppendFormat("<span>班级:{0}</span>", item["ClassName"].ToString());
                commonInfo.AppendFormat("<span>老师:{0}</span>", item["TeacherName"].ToString());
            }
            ltlCommonInfo.Text = commonInfo.ToString();
        }
Ejemplo n.º 6
0
        List <Model_StatsClassHW_TQ> listHW_TQ = new List <Model_StatsClassHW_TQ>(); //小题统计数据
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Request["wrong"] == "w")
                {
                    isShowWrong = true;
                }
                HomeWork_Name = Server.UrlDecode(Request.QueryString["HomeWork_Name"].Filter());
                ResourceToResourceFolder_Id = Request.QueryString["ResourceToResourceFolder_Id"].Filter();
                HomeWork_Id = Request.QueryString["HomeWork_Id"].Filter();
                StudentId   = Request.QueryString["StudentId"].Filter();
                List <Model_StatsClassStudentHW_Score> listSCSHW = new BLL_StatsClassStudentHW_Score().GetModelList(" HomeWork_ID='" + HomeWork_Id + "' and  StudentId='" + StudentId + "' ");
                if (listSCSHW.Count > 0)
                {
                    this.Title           = this.ltlTitle.Text = listSCSHW[0].Resource_Name;
                    ltlGradeSubject.Text = string.Format("<span>年级:{0}</span><span>班级:{1}</span><span>学生:{2}</span><span>满分:{3}分</span><span>得分:{4}分</span>"
                                                         , listSCSHW[0].GradeName
                                                         , listSCSHW[0].ClassName
                                                         , listSCSHW[0].StudentName
                                                         , listSCSHW[0].HWScore.ToString().clearLastZero()
                                                         , listSCSHW[0].StudentScore.ToString().clearLastZero());
                }
                listHW_TQ = new BLL_StatsClassHW_TQ().GetModelList("ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "' and HomeWork_Id='" + HomeWork_Id + "' ");

                string strSql = string.Format(@"select TestQuestions_Id,TestQuestions_Score_ID,Student_Answer_Status,COUNT(1) as ICOUNT from Student_HomeWorkAnswer
where HomeWork_ID='{0}' group by TestQuestions_Id,TestQuestions_Score_ID,Student_Answer_Status", HomeWork_Id);
                dtTQ_StudentAnswerCount = Rc.Common.DBUtility.DbHelperSQL.Query(strSql).Tables[0];
                if (!IsPostBack)
                {
                }
            }
            catch (Exception ex)
            {
                //Response.Write(ex.Message.ToString());
                Response.Write("页面加载失败...");
                Response.End();
            }
        }
Ejemplo n.º 7
0
 public static string getData(string Student_ID, string SubjectID, string ClassID, string GradeID)
 {
     try
     {
         Student_ID = Student_ID.Filter();
         SubjectID  = SubjectID.Filter();
         ClassID    = ClassID.Filter();
         GradeID    = GradeID.Filter();
         string strScore      = string.Empty;
         string strScoreOrder = string.Empty;
         string strHWName     = string.Empty;
         BLL_StatsClassStudentHW_Score          bll_StatsClassStudentHW_Score = new BLL_StatsClassStudentHW_Score();
         List <Model_StatsClassStudentHW_Score> list = new List <Model_StatsClassStudentHW_Score>();
         list = bll_StatsClassStudentHW_Score.GetModelList("StudentID = '" + Student_ID + "' AND SubjectID='" + SubjectID + "' AND ClassID = '" + ClassID + "' AND GradeID = '" + GradeID + "' ORDER BY HomeWorkCreateTime ASC");
         foreach (var item in list)
         {
             strScore      += (Convert.ToDecimal(item.HWScore.ToString()) == 0 ? "0" : Convert.ToDecimal(item.StudentScore / item.HWScore * 100).ToString("0.00")) + ",";
             strScoreOrder += item.StudentScoreOrder.ToString() + ",";
             strHWName     += ((!string.IsNullOrEmpty(item.Resource_Name.ToString())) ? item.Resource_Name.ToString().ReplaceForFilter() : "-") + ",";
         }
         return(Newtonsoft.Json.JsonConvert.SerializeObject(new
         {
             err = "null",
             Score = strScore.TrimEnd(','),
             ScoreOrder = strScoreOrder.TrimEnd(','),
             HWName = strHWName.TrimEnd(',')
         }));
     }
     catch (Exception)
     {
         return(Newtonsoft.Json.JsonConvert.SerializeObject(new
         {
             err = "error"
         }));
     }
 }
Ejemplo n.º 8
0
        public static string GetList(string GradeId, string SubjectID, string ClassID, string key, int PageIndex, int PageSize)
        {
            try
            {
                SubjectID = SubjectID.Filter();
                ClassID   = ClassID.Filter();
                GradeId   = GradeId.Filter();
                key       = key.Filter();
                HttpContext.Current.Session["StatsGradeSubject"] = SubjectID;
                string strWhere = "1=1 ";
                if (!string.IsNullOrEmpty(SubjectID))
                {
                    strWhere += " and  SubjectID = '" + SubjectID + "'";
                }
                if (!string.IsNullOrEmpty(ClassID))
                {
                    strWhere += " and  ClassID = '" + ClassID + "'";
                }
                if (!string.IsNullOrEmpty(GradeId))
                {
                    strWhere += " and  GradeID = '" + GradeId + "'";
                }
                if (!string.IsNullOrEmpty(key))
                {
                    strWhere += " and  StudentName like '%" + key + "%'";
                }
                strWhere += @" AND StatsClassStudentHW_ScoreID IN(select StatsClassStudentHW_ScoreID from (
                select StatsClassStudentHW_ScoreID, ROW_NUMBER() over(partition by TeacherID,SubjectID,StudentId order by HomeWorkCreateTime  desc) as rowNum
                from StatsClassStudentHW_Score where " + strWhere + " ) t where rowNum=1)";

                DataTable dt = new DataTable();
                BLL_StatsClassStudentHW_Score bll = new BLL_StatsClassStudentHW_Score();
                dt = bll.GetListByPage(strWhere, "ClassName,StudentName", ((PageIndex - 1) * PageSize + 1), PageIndex * PageSize).Tables[0];
                int           intRecordCount = bll.GetRecordCount(strWhere);
                List <object> listReturn     = new List <object>();
                int           inum           = 1;
                string        temp           = string.Empty;
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    listReturn.Add(new
                    {
                        ClassName                   = dt.Rows[i]["ClassName"].ToString(),
                        SubjectName                 = dt.Rows[i]["SubjectName"].ToString(),
                        StudentName                 = dt.Rows[i]["StudentName"].ToString(),
                        Resource_Name               = dt.Rows[i]["Resource_Name"].ToString().ReplaceForFilter(),
                        StudentScore                = dt.Rows[i]["StudentScore"].ToString().clearLastZero(),
                        StudentScoreOrder           = Convert.ToDecimal(dt.Rows[i]["StudentScoreOrder"]).ToString("0"),
                        ScoreImprove                = dt.Rows[i]["ScoreImprove"].ToString(),
                        ScoreImproveAbs             = Math.Abs(Convert.ToInt16(dt.Rows[i]["ScoreImprove"].ToString())),
                        StatsClassStudentHW_ScoreID = dt.Rows[i]["StatsClassStudentHW_ScoreID"].ToString()
                    });
                    inum++;
                }
                if (inum > 1)
                {
                    return(JsonConvert.SerializeObject(new
                    {
                        err = "null",
                        PageIndex = PageIndex,
                        PageSize = PageSize,
                        TotalCount = intRecordCount,
                        list = listReturn
                    }));
                }
                else
                {
                    return(JsonConvert.SerializeObject(new
                    {
                        err = "暂无数据"
                    }));
                }
            }
            catch (Exception ex)
            {
                return(JsonConvert.SerializeObject(new
                {
                    err = ex.Message.ToString()
                }));
            }
        }
        public static string GetStatsClassStudentHW_Score(string Class, string ResourceToResourceFolder_Id, string GradeId)
        {
            try
            {
                Class = Class.Filter();
                ResourceToResourceFolder_Id = ResourceToResourceFolder_Id.Filter();
                GradeId = GradeId.Filter();
                string TempDate = string.Empty;//../Evaluation/StudentAnalysisReports.aspx?ResourceToResourceFolder_Id={8}&HomeWork_Id={9}&StudentId={7}
                //<td class=\"progress font_color_green\"><i class=\"fa fa-arrow-up\"></i>5</td>../student/OHomeWorkViewTT.aspx?ResourceToResourceFolder_Id={8}&HomeWork_Id={9}&StudentId={7}
                // string Temp = "<tr><td>李博</td><td>1班</td><td>80</td><td>3</td><td class=\"progress font_color_green\"><i class=\"fa fa-arrow-up\"></i>5</td><td>第一层次</td><td class=\"table_opera\"><a href=\"##\">作业详情</a><a href=\"成长趋势.html\" target=\"_blank\">成长趋势</a></td></tr>";<a href=\"javascript:ShowPic('{8}','{9}','{11}');\">成长趋势</a>
                string Temp  = "<tr><td class='text-left'>{0}</td><td class='text-left'>{1}</td><td>{2}</td><td>{3}</td>{4}<td>{5}</td>{6}{7}</tr>";
                string Tempo = "<td class=\"table_opera\"><a href=\"javascript:CorrectView('{0}','{1}','{2}','{4}','{8}','{9}');\" class='{3}' title='{5}'>批改详情</a><a href=\"javascript:AnalysisReport('{0}','{1}','{2}','{4}','{6}','{8}','{9}');\" class='{7}' title='{5}'>分析报告</a></td>";
                //学生作业提交情况
                string    SqlSHW = @"select  
shw.Student_HomeWork_Id,shw.HomeWork_Id,shw.Student_Id,shw.CreateTime,shwCorrect.CorrectTime,shwCorrect.Student_HomeWork_CorrectStatus
,shwCorrect.CorrectMode,shwSubmit.Student_HomeWork_Status,shwSubmit.OpenTime,shwSubmit.StudentIP,shwSubmit.Student_Answer_Time from  StatsClassStudentHW_Score ss
inner join dbo.Student_HomeWork shw on shw.HomeWork_Id=ss.HomeWork_ID and shw.Student_Id=ss.StudentID 
inner join Student_HomeWork_Submit shwSubmit on shwSubmit.Student_HomeWork_Id=shw.Student_HomeWork_Id 
inner join Student_HomeWork_Correct shwCorrect on shwCorrect.Student_HomeWork_Id=shw.Student_HomeWork_Id 
where ss.Gradeid='" + GradeId + "' and ss.ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "' ";
                DataTable dtSHW  = Rc.Common.DBUtility.DbHelperSQL.Query(SqlSHW).Tables[0];
                if (string.IsNullOrEmpty(Class))
                {
                    List <Model_StatsGradeStudentHW_Score> ClassStudentHW_ScoreList = new List <Model_StatsGradeStudentHW_Score>();
                    ClassStudentHW_ScoreList = new BLL_StatsGradeStudentHW_Score().GetModelList("Gradeid='" + GradeId + "' and ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "' order by GradeStudentScoreOrder,StudentScoreOrder");
                    //根据资源标识+班级标识,关联出作业标识
                    string    strHW = @"select ss.StatsGradeStudentHW_ScoreId,hw.HomeWork_Id from StatsGradeStudentHW_Score ss
inner join dbo.HomeWork hw on hw.ResourceToResourceFolder_Id=ss.ResourceToResourceFolder_Id and hw.UserGroup_Id=ss.ClassId
where ss.Gradeid='" + GradeId + "' and ss.ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "' ";
                    DataTable dtHW  = Rc.Common.DBUtility.DbHelperSQL.Query(strHW).Tables[0];
                    foreach (var item in ClassStudentHW_ScoreList)
                    {
                        DataRow[] drHW           = dtHW.Select("StatsGradeStudentHW_ScoreId='" + item.StatsGradeStudentHW_ScoreID + "'");
                        string    strHomeWork_ID = string.Empty;
                        if (drHW.Length > 0)
                        {
                            strHomeWork_ID = drHW[0]["HomeWork_ID"].ToString();
                        }
                        DataRow[] drPG = dtSHW.Select("Student_Id='" + item.StudentID + "' and HomeWork_Id='" + strHomeWork_ID + "' and Student_HomeWork_CorrectStatus=1 and Student_HomeWork_Status=1");
                        string    PG   = (drPG.Length > 0 ? "1" : "0");
                        DataRow[] drTJ = dtSHW.Select("Student_Id='" + item.StudentID + "' and HomeWork_Id='" + strHomeWork_ID + "' and  Student_HomeWork_Status=1");
                        string    TJ   = (drTJ.Length > 0 ? "1" : "0");

                        string    strCorrectMode         = string.Empty;
                        string    strStudent_Homework_Id = string.Empty;
                        DataRow[] drSHW = dtSHW.Select("Student_Id='" + item.StudentID + "' ");
                        if (drSHW.Length > 0)
                        {
                            strCorrectMode         = drSHW[0]["CorrectMode"].ToString();
                            strStudent_Homework_Id = drSHW[0]["Student_Homework_Id"].ToString();
                        }

                        TempDate += string.Format(Temp
                                                  , item.StudentName
                                                  , item.ClassName
                                                  , item.StudentScore.ToString().clearLastZero()
                                                  , item.GradeStudentScoreOrder.ToString().clearLastZero()
                                                  , GetScoreImprove(item.GradeScoreImprove.ToString())
                                                  , item.StudentScoreOrder
                                                  , GetScoreImprove(item.ScoreImprove.ToString())
                                                  //, item.Hierarchy.ToString().clearLastZero()
                                                  , string.Format(Tempo
                                                                  , item.ResourceToResourceFolder_ID
                                                                  , strHomeWork_ID
                                                                  , item.StudentID
                                                                  , TJ == "0" ? "disabled" : PG == "0" ? "danger" : ""
                                                                  , TJ == "0" ? "1" : ""
                                                                  , TJ == "0" ? "学生未提交" : PG == "0" ? "老师未批改" : ""
                                                                  , TJ == "0" ? "" : PG == "0" ? "1" : ""
                                                                  , TJ == "0" ? "disabled" : PG == "0" ? "disabled" : ""
                                                                  , strCorrectMode
                                                                  , strStudent_Homework_Id)

                                                  , item.StudentID
                                                  , item.ResourceToResourceFolder_ID
                                                  , strHomeWork_ID);
                    }
                    return(TempDate);
                }
                else
                {
                    BLL_StatsClassStudentHW_Score          bllClassStudentHW_Score  = new BLL_StatsClassStudentHW_Score();
                    List <Model_StatsClassStudentHW_Score> ClassStudentHW_ScoreList = new List <Model_StatsClassStudentHW_Score>();
                    ClassStudentHW_ScoreList = bllClassStudentHW_Score.GetModelList("ClassID='" + Class + "' and ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "' order by GradeStudentScoreOrder,StudentScoreOrder");
                    foreach (var item in ClassStudentHW_ScoreList)
                    {
                        DataRow[] drPG = dtSHW.Select("Student_Id='" + item.StudentID + "' and HomeWork_Id='" + item.HomeWork_ID + "' and Student_HomeWork_CorrectStatus=1 and Student_HomeWork_Status=1");
                        string    PG   = (drPG.Length > 0 ? "1" : "0");
                        DataRow[] drTJ = dtSHW.Select("Student_Id='" + item.StudentID + "' and HomeWork_Id='" + item.HomeWork_ID + "' and  Student_HomeWork_Status=1");
                        string    TJ   = (drTJ.Length > 0 ? "1" : "0");

                        string    strCorrectMode         = string.Empty;
                        string    strStudent_Homework_Id = string.Empty;
                        DataRow[] drSHW = dtSHW.Select("Student_Id='" + item.StudentID + "' ");
                        if (drSHW.Length > 0)
                        {
                            strCorrectMode         = drSHW[0]["CorrectMode"].ToString();
                            strStudent_Homework_Id = drSHW[0]["Student_Homework_Id"].ToString();
                        }

                        TempDate += string.Format(Temp
                                                  , item.StudentName
                                                  , item.ClassName
                                                  , item.StudentScore.ToString().clearLastZero()
                                                  , item.GradeStudentScoreOrder.ToString().clearLastZero()
                                                  , GetScoreImprove(item.GradeScoreImprove.ToString())
                                                  , item.StudentScoreOrder.ToString().clearLastZero()
                                                  , GetScoreImprove(item.ScoreImprove.ToString())
                                                  //, item.Hierarchy.ToString().clearLastZero()
                                                  , string.Format(Tempo
                                                                  , item.ResourceToResourceFolder_Id
                                                                  , item.HomeWork_ID
                                                                  , item.StudentID
                                                                  , TJ == "0" ? "disabled" : PG == "0" ? "danger" : ""
                                                                  , TJ == "0" ? "1" : ""
                                                                  , TJ == "0" ? "学生未提交" : PG == "0" ? "老师未批改" : ""
                                                                  , TJ == "0" ? "" : PG == "0" ? "1" : ""
                                                                  , TJ == "0" ? "disabled" : PG == "0" ? "disabled" : ""
                                                                  , strCorrectMode
                                                                  , strStudent_Homework_Id)

                                                  , item.StudentID
                                                  , item.ResourceToResourceFolder_Id
                                                  , item.HomeWork_ID);
                    }
                    return(TempDate);
                }
            }
            catch (Exception)
            {
                return("");
            }
        }
Ejemplo n.º 10
0
        public static string GetStatsClassHW_ScoreOrder(string ClassCode, string ResourceToResourceFolder_Id, string UserId)
        {
            try
            {
                CommonHandel ch      = new CommonHandel();
                DataTable    dt      = new DataTable();
                string       StrTemp = string.Empty;
                string       Num     = "5";
                string       StrSql  = string.Empty;
                if (ClassCode == "-1")
                {
                    StrSql = @"select top 5  stsh.* from StatsTeacherStudentHW_Score stsh 
 where  stsh.StudentID in(select Student_Id from Student_HomeWork shw 
 inner join Student_HomeWork_Submit shwSubmit on shwSubmit.Student_HomeWork_Id=shw.Student_HomeWork_Id and shwSubmit.Student_HomeWork_Status=1
 where  HomeWork_Id in(select HomeWork_Id from HomeWork 
 where ResourceToResourceFolder_Id=stsh.ResourceToResourceFolder_Id and HomeWork_AssignTeacher=stsh.TeacherID) ) and stsh.TeacherID='" + UserId + "' and stsh.ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "' order by stsh.StudentScoreOrder";
                    BLL_StatsTeacherStudentHW_Score bllTeacherStudentHW_Score = new BLL_StatsTeacherStudentHW_Score();
                    dt = Rc.Common.DBUtility.DbHelperSQL.Query(StrSql).Tables[0];
                    //dt = bllTeacherStudentHW_Score.GetList(5, "TeacherID='" + UserId + "' and ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "'", "StudentScoreOrder").Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        if (dt.Rows.Count < 5)
                        {
                            Num = dt.Rows.Count.ToString();
                        }
                        for (int i = 0; i < dt.Rows.Count; i++)//dt.Rows[i]["Score"]dt.Rows[i]["StudentName"]
                        {
                            StrTemp += string.Format(" <td class=\"before\"><h2>{0}</h2><p>{1}</p></td>", dt.Rows[i]["StudentScore"].ToString().clearLastZero(), dt.Rows[i]["StudentName"].ToString());
                        }
                    }
                    StrSql = @"select top 5  stsh.* from StatsTeacherStudentHW_Score stsh 
 where  stsh.StudentID in(select Student_Id from Student_HomeWork shw 
inner join Student_HomeWork_Submit shwSubmit on shwSubmit.Student_HomeWork_Id=shw.Student_HomeWork_Id and shwSubmit.Student_HomeWork_Status=1 where HomeWork_Id in(select HomeWork_Id from HomeWork 
 where ResourceToResourceFolder_Id=stsh.ResourceToResourceFolder_Id and HomeWork_AssignTeacher=stsh.TeacherID) ) and stsh.TeacherID='" + UserId + "' and stsh.ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "' order by stsh.StudentScoreOrder desc";
                    dt     = Rc.Common.DBUtility.DbHelperSQL.Query(StrSql).Tables[0];
                    //dt = bllTeacherStudentHW_Score.GetList(5, "TeacherID='" + UserId + "' and ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "'", "StudentScoreOrder desc").Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        if (dt.Rows.Count < 5)
                        {
                            Num = dt.Rows.Count.ToString();
                        }
                        for (int i = 0; i < dt.Rows.Count; i++)//dt.Rows[i]["Score"]dt.Rows[i]["StudentName"]
                        {
                            StrTemp += string.Format(" <td class=\"after\"><h2>{0}</h2><p>{1}</p></td>", dt.Rows[i]["StudentScore"].ToString().clearLastZero(), (dt.Rows[i]["StudentName"].ToString()));
                        }
                    }
                    return(StrTemp + "|" + Num);
                }
                else
                {
                    BLL_StatsClassStudentHW_Score bllClassStudentHW_Score = new BLL_StatsClassStudentHW_Score();
                    StrSql = @"select top 5  stsh.*,shwSubmit.Student_HomeWork_Status from StatsClassStudentHW_Score stsh 
left join dbo.Student_HomeWork shw on shw.HomeWork_ID=stsh.HomeWork_ID and shw.Student_Id=stsh.StudentID 
 inner join Student_HomeWork_Submit shwSubmit on shwSubmit.Student_HomeWork_Id=shw.Student_HomeWork_Id 
 where  stsh.ClassID='" + ClassCode + "' and stsh.ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "' and shwSubmit.Student_HomeWork_Status=1 order by stsh.StudentScoreOrder,AnswerEnd";
                    dt     = Rc.Common.DBUtility.DbHelperSQL.Query(StrSql).Tables[0];
                    //dt = bllClassStudentHW_Score.GetList(5, "ClassID='" + ClassCode + "' and ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "'", "StudentScoreOrder,AnswerEnd").Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        if (dt.Rows.Count < 5)
                        {
                            Num = dt.Rows.Count.ToString();
                        }
                        for (int i = 0; i < dt.Rows.Count; i++)//dt.Rows[i]["Score"]dt.Rows[i]["StudentName"]
                        {
                            StrTemp += string.Format(" <td class=\"before\"><h2>{0}</h2><p>{1}</p></td>", dt.Rows[i]["StudentScore"].ToString().clearLastZero(), (dt.Rows[i]["StudentName"].ToString()));
                        }
                    }
                    StrSql = @"select top 5 stsh.*,shwSubmit.Student_HomeWork_Status from StatsClassStudentHW_Score stsh 
left join dbo.Student_HomeWork shw on shw.HomeWork_ID=stsh.HomeWork_ID and shw.Student_Id=stsh.StudentID 
 inner join Student_HomeWork_Submit shwSubmit on shwSubmit.Student_HomeWork_Id=shw.Student_HomeWork_Id 
 where  stsh.ClassID='" + ClassCode + "' and stsh.ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "' and shwSubmit.Student_HomeWork_Status=1 order by stsh.StudentScoreOrder desc ,AnswerEnd desc";
                    dt     = Rc.Common.DBUtility.DbHelperSQL.Query(StrSql).Tables[0];
                    //dt = bllClassStudentHW_Score.GetList(5, "ClassID='" + ClassCode + "' and ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "'", "StudentScoreOrder desc,AnswerEnd desc").Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        if (dt.Rows.Count < 5)
                        {
                            Num = dt.Rows.Count.ToString();
                        }
                        for (int i = 0; i < dt.Rows.Count; i++)//dt.Rows[i]["Score"]dt.Rows[i]["StudentName"]
                        {
                            StrTemp += string.Format(" <td class=\"after\"><h2>{0}</h2><p>{1}</p></td>", dt.Rows[i]["StudentScore"].ToString().clearLastZero(), (dt.Rows[i]["StudentName"].ToString()));
                        }
                    }
                    return(StrTemp + "|" + Num);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                StudentId = Request.QueryString["StudentId"].Filter();

                strTestpaperViewWebSiteUrl = pfunction.GetResourceHost("TestWebSiteUrl");
                if (!string.IsNullOrEmpty(StudentId) && strTestpaperViewWebSiteUrl == Rc.Common.ConfigHelper.GetConfigString("TestWebSiteUrl"))
                {
                    strTestpaperViewWebSiteUrl = pfunction.GetResourceHost("TestWebSiteUrl", StudentId);
                }

                stuHomeWorkId = Request.QueryString["Student_HomeWork_Id"].Filter();
                string reqWrong = Request["wrong"].Filter();
                if (reqWrong == "w")
                {
                    isShowWrong = true;
                }

                ResourceToResourceFolder_Id = Request.QueryString["ResourceToResourceFolder_Id"].Filter();
                HomeWork_Id = Request.QueryString["HomeWork_Id"].Filter();

                modelHW = new BLL_HomeWork().GetModel(HomeWork_Id);
                string tempSql = string.Empty;
                tempSql = string.Format(@"select COUNT(1) as icount from Student_HomeWork shw inner join Student_HomeWork_Correct shwCorrect on shwCorrect.Student_HomeWork_Id=shw.Student_HomeWork_Id  where HomeWork_Id='{0}' 
and Student_Id='{1}'
and shwCorrect.Student_HomeWork_CorrectStatus='{2}'", HomeWork_Id, StudentId, "1");
                int i = int.Parse(Rc.Common.DBUtility.DbHelperSQL.GetSingle(tempSql).ToString());
                if (i > 0)
                {
                    //}
                    List <Model_StatsClassStudentHW_Score> listSCSHW = new BLL_StatsClassStudentHW_Score().GetModelList(" HomeWork_ID='" + HomeWork_Id + "' and  StudentId='" + StudentId + "' ");
                    if (listSCSHW.Count > 0)
                    {
                        isCorrect            = true;
                        this.Title           = listSCSHW[0].Resource_Name.ReplaceForFilter();
                        this.ltlTitle.Text   = listSCSHW[0].Resource_Name.ReplaceForFilter() + "<span class='correct_state bg-success'>已完成批改</span>";
                        ltlGradeSubject.Text = string.Format("<span>年级:{0}</span><span>班级:{1}</span><span>学生:{2}</span><span>满分:{3}分</span><span>得分:{4}分</span>"
                                                             , listSCSHW[0].GradeName
                                                             , listSCSHW[0].ClassName
                                                             , listSCSHW[0].StudentName
                                                             , listSCSHW[0].HWScore.ToString().clearLastZero()
                                                             , listSCSHW[0].StudentScore.ToString().clearLastZero());
                    }
                }
                else
                {
                    #region 未批改
                    DataTable dtw = new DataTable();
                    dtw = Rc.Common.DBUtility.DbHelperSQL.Query(string.Format(@"select hw.*
,vw.GradeName,vw.GradeId,vw.ClassId,vw.ClassName
,u.UserName,u.TrueName
,HWScore=(select SUM(TestQuestions_Score) from TestQuestions_Score where ResourceToResourceFolder_Id=hw.ResourceToResourceFolder_Id)
,StudentScore=(select SUM(Student_Score) from Student_HomeWorkAnswer where Student_Id='{0}' and HomeWork_Id=hw.HomeWork_Id )
,shwCorrect.Student_HomeWork_CorrectStatus
from HomeWork hw 
inner join Student_HomeWork shw on shw.Student_Id='{0}' and shw.HomeWork_Id=hw.HomeWork_Id 
inner join Student_HomeWork_Correct shwCorrect on shwCorrect.Student_HomeWork_Id=shw.Student_HomeWork_Id 
inner join F_User u on u.UserId=shw.Student_Id
left join VW_ClassGradeSchool vw on vw.ClassId=hw.UserGroup_Id and vw.GradeId!=''
where hw.HomeWork_Id='{1}'"
                                                                              , StudentId, HomeWork_Id)).Tables[0];
                    this.Title           = dtw.Rows[0]["HomeWork_Name"].ToString();
                    this.ltlTitle.Text   = dtw.Rows[0]["HomeWork_Name"].ToString() + "<span class='correct_state bg-warning'>未完成批改</span>";
                    ltlGradeSubject.Text = string.Format("<span>年级:{0}</span><span>班级:{1}</span><span>学生:{2}</span><span>满分:{3}分</span><span>得分:{4}分</span>"
                                                         , dtw.Rows[0]["GradeName"]
                                                         , dtw.Rows[0]["ClassName"]
                                                         , string.IsNullOrEmpty(dtw.Rows[0]["TrueName"].ToString()) ? dtw.Rows[0]["UserName"] : dtw.Rows[0]["TrueName"]
                                                         , dtw.Rows[0]["HWScore"].ToString().clearLastZero()
                                                         , dtw.Rows[0]["StudentScore"].ToString().clearLastZero());
                    if (dtw.Rows[0]["Student_HomeWork_CorrectStatus"].ToString() == "1")
                    {
                        isCorrect = true;
                    }
                    #endregion
                }
                StringBuilder stbLink = new StringBuilder();
                stbLink.AppendFormat("<li {3}><a href=\"ohomeworkview_clientNew.aspx?ResourceToResourceFolder_Id={0}&HomeWork_Id={1}&StudentId={2}&Student_HomeWork_Id={4}\">批改详情</a></li>"
                                     , ResourceToResourceFolder_Id
                                     , HomeWork_Id
                                     , StudentId
                                     , (isShowWrong ? "" : "class=\"active\"")
                                     , stuHomeWorkId);
                if (isCorrect)
                {
                    //stbLink.AppendFormat("<li {3}><a href=\"ohomeworkview_client.aspx?ResourceToResourceFolder_Id={0}&HomeWork_Id={1}&StudentId={2}&wrong=w&Student_HomeWork_Id={4}\">错题详情</a></li>"
                    //, ResourceToResourceFolder_Id
                    //, HomeWork_Id
                    //, StudentId
                    //, (isShowWrong ? "class=\"active\"" : "")
                    //, stuHomeWorkId);
                    //stbLink.AppendFormat("<li><a href=\"../Evaluation/StudentAnalysisReports.aspx?ResourceToResourceFolder_Id={0}&HomeWork_Id={1}&StudentId={2}&Student_HomeWork_Id={3}\">分析报告</a></li>"
                    //, ResourceToResourceFolder_Id
                    //, HomeWork_Id
                    //, StudentId
                    //, stuHomeWorkId);
                    stbLink.AppendFormat("<li><a href=\"../Evaluation/StudentAnalysisReportsNew2.aspx?ResourceToResourceFolder_Id={0}&HomeWork_Id={1}&StudentId={2}&Student_HomeWork_Id={3}\">分析报告</a></li>"
                                         , ResourceToResourceFolder_Id
                                         , HomeWork_Id
                                         , StudentId
                                         , stuHomeWorkId);
                    // stbLink.AppendFormat("<li><a href=\"../Evaluation/StudentErrorAnalysis.aspx?ResourceToResourceFolder_Id={0}&HomeWork_Id={1}&StudentId={2}&Student_HomeWork_Id={3}\">错题分析</a></li>"
                    // , ResourceToResourceFolder_Id
                    // , HomeWork_Id
                    // , StudentId
                    // , stuHomeWorkId);
                    // stbLink.AppendFormat("<li><a href=\"../Evaluation/StudentRemedyScheme.aspx?ResourceToResourceFolder_Id={0}&HomeWork_Id={1}&StudentId={2}&Student_HomeWork_Id={3}\">补救方案</a></li>"
                    //, ResourceToResourceFolder_Id
                    //, HomeWork_Id
                    //, StudentId
                    //, stuHomeWorkId);
                }
                else
                {
                    stbLink.AppendFormat("<li><a href=\"javascript:;\" title='老师未批改' class='disabled'>分析报告</a></li>"
                                         , ResourceToResourceFolder_Id
                                         , HomeWork_Id
                                         , StudentId
                                         , stuHomeWorkId);
                    //   stbLink.AppendFormat("<li><a href=\"javascript:;\" title='老师未批改' class='disabled'>错题分析</a></li>"
                    //  , ResourceToResourceFolder_Id
                    //  , HomeWork_Id
                    //  , StudentId
                    //  , stuHomeWorkId);
                    //   stbLink.AppendFormat("<li><a href=\"javascript:;\" title='老师未批改' class='disabled'>补救方案</a></li>"
                    //, ResourceToResourceFolder_Id
                    //, HomeWork_Id
                    //, StudentId
                    //, stuHomeWorkId);
                }

                ltlLink.Text = stbLink.ToString();
                if (!IsPostBack)
                {
                }
            }
            catch (Exception)
            {
                Response.Write("页面加载失败...");
                Response.End();
            }
        }
Ejemplo n.º 12
0
        public static string GetHWList(string StudentID, string SubjectID, string HomeWorkCreateTime, string HomeWorkFinishTime, int PageIndex, int PageSize)
        {
            try
            {
                StudentID          = StudentID.Filter();
                SubjectID          = SubjectID.Filter();
                HomeWorkCreateTime = HomeWorkCreateTime.Filter();
                HomeWorkCreateTime = HomeWorkCreateTime.Filter();
                string strWhere = "1=1";
                if (!string.IsNullOrEmpty(StudentID))
                {
                    strWhere += " AND  StudentID = '" + StudentID + "'";
                }
                if (!string.IsNullOrEmpty(SubjectID) && SubjectID != "-1")
                {
                    strWhere += " AND  SubjectID = '" + SubjectID + "'";
                }
                if (!string.IsNullOrEmpty(HomeWorkCreateTime))
                {
                    strWhere += " and HomeWorkCreateTime > '" + HomeWorkCreateTime + "'";
                }
                if (!string.IsNullOrEmpty(HomeWorkFinishTime))
                {
                    strWhere += " and HomeWorkCreateTime <= '" + HomeWorkFinishTime + "'";
                }
                DataTable dt = new DataTable();
                BLL_StatsClassStudentHW_Score bll = new BLL_StatsClassStudentHW_Score();
                StringBuilder strSql = new StringBuilder();
                strSql.Append("SELECT * FROM ( ");
                strSql.Append(" SELECT ROW_NUMBER() OVER ( order by HomeWorkCreateTime desc ");

                strSql.Append(@")AS Row, T.*,shwCorrect.Student_HomeWork_CorrectStatus  from StatsClassStudentHW_Score T  
                                                 left join Student_HomeWork shw on shw.HomeWork_Id=T.HomeWork_Id and Student_Id='" + StudentID + @"' 
                                                 inner join Student_HomeWork_Correct shwCorrect on shwCorrect.Student_HomeWork_Id=shw.Student_HomeWork_Id  ");
                if (!string.IsNullOrEmpty(strWhere.Trim()))
                {
                    strSql.Append(" WHERE " + strWhere);
                }

                strSql.Append(" ) TT");
                strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", ((PageIndex - 1) * PageSize + 1), (PageIndex * PageSize));
                dt = Rc.Common.DBUtility.DbHelperSQL.Query(strSql.ToString()).Tables[0];
                string SqlCount       = @"select count(1) from StatsClassStudentHW_Score T   where " + strWhere;
                int    intRecordCount = (int)Rc.Common.DBUtility.DbHelperSQL.GetSingle(SqlCount);

                string    StrSql = @"select shw.Student_HomeWork_Id,shw.HomeWork_Id,shw.Student_Id,shw.CreateTime,shwCorrect.CorrectMode from Student_HomeWork shw
 inner join Student_HomeWork_Correct shwCorrect on shwCorrect.Student_HomeWork_Id=shw.Student_HomeWork_Id where Student_Id='" + StudentID + "'";
                DataTable dtSHW  = Rc.Common.DBUtility.DbHelperSQL.Query(StrSql).Tables[0];

                List <object> listReturn = new List <object>();
                int           inum       = 1;
                string        temp       = string.Empty;
                string        cProgress  = string.Empty;
                string        gProgress  = string.Empty;
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    cProgress = dt.Rows[i]["ScoreImprove"].ToString();
                    gProgress = dt.Rows[i]["GradeScoreImprove"].ToString();
                    if (Convert.ToInt16(cProgress) > 0)
                    {
                        cProgress = "<span class='text-success'><i class='fa fa-arrow-up'></i>&nbsp;" + cProgress + "</span>";
                    }
                    else if (Convert.ToInt16(cProgress) < 0)
                    {
                        cProgress = "<span class='text-danger'><i class='fa fa-arrow-down'></i>&nbsp;" + Math.Abs(Convert.ToInt16(cProgress)) + "</span>";
                    }
                    else
                    {
                        cProgress = "-";
                    }
                    if (Convert.ToInt16(gProgress) > 0)
                    {
                        gProgress = "<span class='text-success'><i class='fa fa-arrow-up'></i>&nbsp;" + gProgress + "</span>";
                    }
                    else if (Convert.ToInt16(gProgress) < 0)
                    {
                        gProgress = "<span class='text-danger'><i class='fa fa-arrow-down'></i>&nbsp;" + Math.Abs(Convert.ToInt16(gProgress)) + "</span>";
                    }
                    else
                    {
                        gProgress = "-";
                    }
                    string    strCorrectMode         = string.Empty;
                    string    strStudent_Homework_Id = string.Empty;
                    DataRow[] drSHW = dtSHW.Select("Homework_Id='" + dt.Rows[i]["HomeWork_ID"].ToString() + "' and Student_Id='" + dt.Rows[i]["StudentID"].ToString() + "' ");
                    if (drSHW.Length > 0)
                    {
                        strCorrectMode         = drSHW[0]["CorrectMode"].ToString();
                        strStudent_Homework_Id = drSHW[0]["Student_Homework_Id"].ToString();
                    }
                    double sec = 0;
                    try
                    {
                        TimeSpan ts1 = Convert.ToDateTime(dt.Rows[i]["AnswerEnd"].ToString()) - Convert.ToDateTime(dt.Rows[i]["AnswerStart"].ToString());
                        sec = ts1.TotalSeconds;
                    }
                    catch (Exception)
                    {
                    }

                    listReturn.Add(new
                    {
                        HomeWork_Name                  = dt.Rows[i]["HomeWork_Name"].ToString(),
                        AnswerStart                    = dt.Rows[i]["AnswerStart"].ToString(),
                        AnswerEnd                      = dt.Rows[i]["AnswerEnd"].ToString(),
                        StudentIP                      = dt.Rows[i]["StudentIP"].ToString(),
                        StudentScore                   = dt.Rows[i]["StudentScore"].ToString().clearLastZero(),
                        StudentScoreOrder              = dt.Rows[i]["StudentScoreOrder"].ToString().clearLastZero(),
                        ScoreImprove                   = "[" + cProgress + "]",
                        Hierarchy                      = dt.Rows[i]["Hierarchy"].ToString().clearLastZero() == "0" ? "-" : "第" + dt.Rows[i]["Hierarchy"].ToString() + "层次",
                        GradeStudentScoreOrder         = dt.Rows[i]["GradeStudentScoreOrder"].ToString().clearLastZero() == "0" ? "-" : dt.Rows[i]["GradeStudentScoreOrder"].ToString().clearLastZero(),
                        GradeScoreImprove              = "[" + gProgress + "]",
                        GradeHierarchy                 = dt.Rows[i]["GradeHierarchy"].ToString().clearLastZero() == "0" ? "-" : "第" + dt.Rows[i]["GradeHierarchy"].ToString() + "层次",
                        HomeWork_ID                    = dt.Rows[i]["HomeWork_ID"].ToString(),
                        StudentID                      = dt.Rows[i]["StudentID"].ToString(),
                        ResourceToResourceFolder_Id    = dt.Rows[i]["ResourceToResourceFolder_Id"].ToString(),
                        CorrectMode                    = strCorrectMode,
                        Student_Homework_Id            = strStudent_Homework_Id,
                        DateDiffMin                    = Rc.Cloud.Web.Common.pfunction.ConvertSecond(sec.ToString()),
                        Student_HomeWork_CorrectStatus = dt.Rows[i]["Student_HomeWork_CorrectStatus"].ToString()
                    });
                    inum++;
                }
                if (inum > 1)
                {
                    return(JsonConvert.SerializeObject(new
                    {
                        err = "null",
                        PageIndex = PageIndex,
                        PageSize = PageSize,
                        TotalCount = intRecordCount,
                        list = listReturn
                    }));
                }
                else
                {
                    return(JsonConvert.SerializeObject(new
                    {
                        err = "暂无数据"
                    }));
                }
            }
            catch (Exception ex)
            {
                return(JsonConvert.SerializeObject(new
                {
                    err = ex.Message.ToString()
                }));
            }
        }
Ejemplo n.º 13
0
        public static string GetStatsClassStudentHW_Score(string BabyId, string SubjectId, string HomeWorkCreateTime, string HomeWorkFinishTime, int PageSize, int PageIndex)
        {
            try
            {
                PageIndex          = Convert.ToInt32(PageIndex.ToString().Filter());
                BabyId             = BabyId.Filter();
                SubjectId          = SubjectId.Filter();
                HomeWorkCreateTime = HomeWorkCreateTime.Filter();
                HomeWorkCreateTime = HomeWorkCreateTime.Filter();
                DataTable     dt         = new DataTable();
                List <object> listReturn = new List <object>();
                BLL_StatsClassStudentHW_Score bllStatsClassStudentHW_Score = new BLL_StatsClassStudentHW_Score();

                string strSqlCount = string.Empty;
                string strWhere    = " StudentID='" + BabyId + "'";
                if (!string.IsNullOrEmpty(SubjectId) && SubjectId != "-1")
                {
                    strWhere += "and SubjectID='" + SubjectId + "'";;
                }
                if (!string.IsNullOrEmpty(HomeWorkCreateTime))
                {
                    strWhere += " and HomeWorkCreateTime > '" + HomeWorkCreateTime + "'";
                }
                if (!string.IsNullOrEmpty(HomeWorkFinishTime))
                {
                    strWhere += " and HomeWorkCreateTime <= '" + HomeWorkFinishTime + "'";
                }
                StringBuilder strSql = new StringBuilder();
                strSql.Append("SELECT * FROM ( ");
                strSql.Append(" SELECT ROW_NUMBER() OVER ( order by HomeWorkCreateTime desc ");

                strSql.Append(@")AS Row, T.*  from (select scss.StudentID,scss.HomeWorkCreateTime,scss.SubjectID,scss.SubjectName,scss.ClassName,scss.HomeWork_Name,scss.StudentScore,scss.GradeStudentScoreOrder,scss.StudentScoreOrder,scs.AVGScore classavg,sgs.AVGScore as gradeavg from StatsClassStudentHW_Score scss
inner join HomeWork hw on hw.HomeWork_ID=scss.HomeWork_ID
left join dbo.StatsClassHW_Score scs on scs.ClassID=scss.ClassID and scss.HomeWork_ID=scs.HomeWork_ID and scs.ResourceToResourceFolder_Id=scss.ResourceToResourceFolder_Id
left join dbo.StatsGradeHW_Score sgs on sgs.Gradeid=scss.Gradeid and sgs.ResourceToResourceFolder_Id=scss.ResourceToResourceFolder_Id) T ");
                if (!string.IsNullOrEmpty(strWhere.Trim()))
                {
                    strSql.Append(" WHERE " + strWhere);
                }

                strSql.Append(" ) TT");
                strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", ((PageIndex - 1) * PageSize + 1), (PageIndex * PageSize));
                dt = Rc.Common.DBUtility.DbHelperSQL.Query(strSql.ToString()).Tables[0];
                string SqlCount           = @"select count(1) from (select scss.HomeWorkCreateTime,StudentID, scss.SubjectID from  StatsClassStudentHW_Score scss
inner join HomeWork hw on hw.HomeWork_ID=scss.HomeWork_ID
left join dbo.StatsClassHW_Score scs on scs.ClassID=scss.ClassID and scss.HomeWork_ID=scs.HomeWork_ID and scs.ResourceToResourceFolder_Id=scss.ResourceToResourceFolder_Id
left join dbo.StatsGradeHW_Score sgs on sgs.Gradeid=scss.Gradeid and sgs.ResourceToResourceFolder_Id=scss.ResourceToResourceFolder_Id) t where" + strWhere;
                int    rCount             = (int)Rc.Common.DBUtility.DbHelperSQL.GetSingle(SqlCount);
                int    inum               = 0;
                string HomeWork_NameArray = string.Empty;
                string StudentScoreArray  = string.Empty;
                string classavgArray      = string.Empty;
                //string gradeavgArray = string.Empty;
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    HomeWork_NameArray += dt.Rows[i]["HomeWork_Name"] + ",";
                    StudentScoreArray  += dt.Rows[i]["StudentScore"].ToString().clearLastZero() + ",";
                    classavgArray      += dt.Rows[i]["classavg"].ToString().clearLastZero() + ",";
                    //gradeavgArray += dt.Rows[i]["gradeavg"] + ",";
                    inum++;
                    listReturn.Add(new
                    {
                        inum                   = (i + 1),
                        ClassName              = dt.Rows[i]["ClassName"].ToString(),
                        HomeWork_Name          = dt.Rows[i]["HomeWork_Name"].ToString(),
                        HomeWorkCreateTime     = pfunction.ConvertToLongDateTime(dt.Rows[i]["HomeWorkCreateTime"].ToString(), "yyyy-MM-dd HH:mm:ss"),
                        StudentScore           = dt.Rows[i]["StudentScore"].ToString().clearLastZero(),
                        StudentScoreOrder      = dt.Rows[i]["StudentScoreOrder"].ToString().clearLastZero(),
                        GradeStudentScoreOrder = dt.Rows[i]["GradeStudentScoreOrder"].ToString().clearLastZero() == "0" ? "-" : dt.Rows[i]["GradeStudentScoreOrder"].ToString().clearLastZero(),
                        SubjectName            = dt.Rows[i]["SubjectName"].ToString(),
                        classavg               = dt.Rows[i]["classavg"].ToString().clearLastZero() == "0" ? "-" : dt.Rows[i]["classavg"].ToString().clearLastZero(),
                        gradeavg               = dt.Rows[i]["gradeavg"].ToString().clearLastZero() == "0" ? "-" : dt.Rows[i]["gradeavg"].ToString().clearLastZero()
                    });
                }
                string[] scoreArr = StudentScoreArray.TrimEnd(',').Split(',');
                string[] classArr = classavgArray.TrimEnd(',').Split(',');
                if (inum > 0)
                {
                    return(JsonConvert.SerializeObject(new
                    {
                        err = "null",
                        PageIndex = PageIndex,
                        PageSize = PageSize,
                        TotalCount = rCount,
                        HomeWork_NameArray = HomeWork_NameArray.TrimEnd(','),
                        jsonStr = "[{\"name\": \"分数\",\"data\": [" + string.Join(",", scoreArr.Reverse()) + "]},{\"name\": \"班级平均分\",\"data\": [" + string.Join(",", classArr.Reverse()) + "]}]",
                        list = listReturn
                    }));
                }
                else
                {
                    return(JsonConvert.SerializeObject(new
                    {
                        err = "暂无数据"
                    }));
                }
            }
            catch (Exception)
            {
                return(JsonConvert.SerializeObject(new
                {
                    err = "error"//ex.Message.ToString()
                }));
            }
        }
        public static string GetStatsClassStudentHW_Score(string Class, string ResourceToResourceFolder_Id, string UserId)
        {
            try
            {
                Class = Class.Filter();
                ResourceToResourceFolder_Id = ResourceToResourceFolder_Id.Filter();
                UserId = UserId.Filter();
                string TempDate = string.Empty;
                //<td class=\"progress font_color_green\"><i class=\"fa fa-arrow-up\"></i>5</td>../student/OHomeWorkViewTT.aspx?ResourceToResourceFolder_Id={0}&HomeWork_Id={1}&StudentId={2}
                // string Temp = "<tr><td>李博</td><td>1班</td><td>80</td><td>3</td><td class=\"progress font_color_green\"><i class=\"fa fa-arrow-up\"></i>5</td><td>第一层次</td><td class=\"table_opera\"><a href=\"##\">作业详情</a><a href=\"成长趋势.html\" target=\"_blank\">成长趋势</a></td></tr>";
                //string Temp = "<tr><td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td>{4}<td>{5}</td>{6}<td>第{7}层次</td><td class=\"table_opera\"><a href=\"../student/OHomeWorkViewTT.aspx?ResourceToResourceFolder_Id={8}&HomeWork_Id={9}&StudentId={10}\" target=\"_blank\">批改详情</a><a href=\"javascript:ShowPic('{10}','{11}','{9}');\">成长趋势</a></td></tr>";
                string Temp  = "<tr><td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td>{4}{5}</tr>";
                string Tempo = "<td><a href=\"javascript:CorrectView('{0}','{1}','{2}','{4}','{8}','{9}');\" class='{3}' title='{5}'>批改详情</a><a href=\"javascript:AnalysisReport('{0}','{1}','{2}','{4}','{6}','{8}','{9}');\" class='{7}' title='{5}'>分析报告</a></td>";
                if (Class == "-1")
                {
                    HttpContext.Current.Session["StatsClassClassId"] = "-1";
                    BLL_StatsTeacherStudentHW_Score          bllStatsTeacherStudentHW_Score = new BLL_StatsTeacherStudentHW_Score();
                    List <Model_StatsTeacherStudentHW_Score> TeacherStudentHW_ScoreList     = new List <Model_StatsTeacherStudentHW_Score>();
                    TeacherStudentHW_ScoreList = bllStatsTeacherStudentHW_Score.GetModelList("TeacherID='" + UserId + "' and ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "' order by StudentScore desc,StudentScoreOrder ");
                    //根据资源标识+班级标识,关联出作业标识
                    string    strSqlHW = @"select ss.StatsTeacherStudentHW_ScoreId,hw.HomeWork_Id from StatsTeacherStudentHW_Score ss
inner join HomeWork hw on hw.ResourceToResourceFolder_Id=ss.ResourceToResourceFolder_Id and hw.UserGroup_Id=ss.ClassId
where ss.TeacherID='" + UserId + "' and ss.ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "'";
                    DataTable dtHW     = Rc.Common.DBUtility.DbHelperSQL.Query(strSqlHW).Tables[0];

                    string    strSqlSHW = @"select shw.Student_HomeWork_Id,shw.HomeWork_Id,shw.Student_Id,shw.CreateTime,shwCorrect.CorrectMode from Student_HomeWork shw 
inner join Student_HomeWork_Correct shwCorrect on shwCorrect.Student_HomeWork_Id=shw.Student_HomeWork_Id 
where shw.HomeWork_Id in(select hw.HomeWork_Id from StatsTeacherStudentHW_Score ss
inner join HomeWork hw on hw.ResourceToResourceFolder_Id=ss.ResourceToResourceFolder_Id and hw.UserGroup_Id=ss.ClassId
where ss.TeacherID='" + UserId + "' and ss.ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "') ";
                    DataTable dtSHW     = Rc.Common.DBUtility.DbHelperSQL.Query(strSqlSHW).Tables[0];

                    foreach (var item in TeacherStudentHW_ScoreList)
                    {
                        DataRow[] drHW           = dtHW.Select("StatsTeacherStudentHW_ScoreId='" + item.StatsTeacherStudentHW_ScoreID + "'");
                        string    strHomeWork_ID = string.Empty;
                        if (drHW.Length > 0)
                        {
                            strHomeWork_ID = drHW[0]["HomeWork_ID"].ToString();
                        }
                        string    strCorrectMode         = string.Empty;
                        string    strStudent_Homework_Id = string.Empty;
                        DataRow[] drSHW = dtSHW.Select("Student_Id='" + item.StudentID + "' ");
                        if (drSHW.Length > 0)
                        {
                            strCorrectMode         = drSHW[0]["CorrectMode"].ToString();
                            strStudent_Homework_Id = drSHW[0]["Student_Homework_Id"].ToString();
                        }
                        string TJ = GetSubmitStudent(strHomeWork_ID, item.StudentID);
                        string PG = GetCorrectStudent(strHomeWork_ID, item.StudentID);
                        TempDate += string.Format(Temp
                                                  , item.StudentName                                  //0
                                                  , item.ClassName                                    //1
                                                  , item.StudentScore.ToString().clearLastZero()      //2
                                                                                                      //, item.GradeStudentScoreOrder.ToString().clearLastZero()//3
                                                                                                      //, GetScoreImprove(item.GradeScoreImprove.ToString())//4
                                                  , item.StudentScoreOrder.ToString().clearLastZero() //5
                                                  , GetScoreImprove(item.ScoreImprove.ToString())     //6
                                                                                                      //, item.Hierarchy.ToString().clearLastZero()//7
                                                  , string.Format(Tempo
                                                                  , item.ResourceToResourceFolder_Id
                                                                  , strHomeWork_ID
                                                                  , item.StudentID
                                                                  , TJ == "0" ? "disabled" : PG == "0" ? "danger" : ""
                                                                  , TJ == "0" ? "1" : ""
                                                                  , TJ == "0" ? "学生未提交" : PG == "0" ? "老师未批改" : ""
                                                                  , TJ == "0" ? "" : PG == "0" ? "1" : ""
                                                                  , TJ == "0" ? "disabled" : PG == "0" ? "disabled" : ""
                                                                  , strCorrectMode
                                                                  , strStudent_Homework_Id)

                                                  , item.ResourceToResourceFolder_Id //8
                                                  , strHomeWork_ID                   //9
                                                  , item.StudentID                   //10
                                                  );                                 //11
                    }
                    return(TempDate);
                }
                else
                {
                    HttpContext.Current.Session["StatsClassClassId"] = Class;
                    BLL_StatsClassStudentHW_Score          bllClassStudentHW_Score  = new BLL_StatsClassStudentHW_Score();
                    List <Model_StatsClassStudentHW_Score> ClassStudentHW_ScoreList = new List <Model_StatsClassStudentHW_Score>();
                    ClassStudentHW_ScoreList = bllClassStudentHW_Score.GetModelList("ClassID='" + Class + "' and ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "' order by StudentScore desc,StudentScoreOrder ");

                    string strSqlSHW = @"select  shw.Student_HomeWork_Id,shw.HomeWork_Id,shw.Student_Id,shw.CreateTime,shwCorrect.CorrectMode from Student_HomeWork shw 
inner join Student_HomeWork_Correct shwCorrect on shwCorrect.Student_HomeWork_Id=shw.Student_HomeWork_Id 
                    where shw.HomeWork_Id in(select HomeWork_Id from HomeWork where UserGroup_Id='" + Class
                                       + "' and HomeWork_AssignTeacher='" + UserId + "' and ResourceToResourceFolder_Id='" + ResourceToResourceFolder_Id + "') ";
                    DataTable dtSHW = Rc.Common.DBUtility.DbHelperSQL.Query(strSqlSHW).Tables[0];

                    foreach (var item in ClassStudentHW_ScoreList)
                    {
                        string    strCorrectMode         = string.Empty;
                        string    strStudent_Homework_Id = string.Empty;
                        DataRow[] drSHW = dtSHW.Select("Student_Id='" + item.StudentID + "' ");
                        if (drSHW.Length > 0)
                        {
                            strCorrectMode         = drSHW[0]["CorrectMode"].ToString();
                            strStudent_Homework_Id = drSHW[0]["Student_Homework_Id"].ToString();
                        }
                        string TJ = GetSubmitStudent(item.HomeWork_ID, item.StudentID);
                        string PG = GetCorrectStudent(item.HomeWork_ID, item.StudentID);
                        TempDate += string.Format(Temp
                                                  , item.StudentName
                                                  , item.ClassName
                                                  , item.StudentScore.ToString().clearLastZero()
                                                  //, item.GradeStudentScoreOrder.ToString().clearLastZero()
                                                  //, GetScoreImprove(item.GradeScoreImprove.ToString())
                                                  , item.StudentScoreOrder.ToString().clearLastZero()
                                                  , GetScoreImprove(item.ScoreImprove.ToString())
                                                  , string.Format(Tempo
                                                                  , item.ResourceToResourceFolder_Id
                                                                  , item.HomeWork_ID
                                                                  , item.StudentID
                                                                  , TJ == "0" ? "disabled" : PG == "0" ? "danger" : ""
                                                                  , TJ == "0" ? "1" : ""
                                                                  , TJ == "0" ? "学生未提交" : PG == "0" ? "老师未批改" : ""
                                                                  , TJ == "0" ? "" : PG == "0" ? "1" : ""
                                                                  , TJ == "0" ? "disabled" : PG == "0" ? "disabled" : ""
                                                                  , strCorrectMode
                                                                  , strStudent_Homework_Id)

                                                  //, item.Hierarchy.ToString().clearLastZero()
                                                  , item.ResourceToResourceFolder_Id
                                                  , item.HomeWork_ID
                                                  , item.StudentID);
                    }
                    return(TempDate);
                }
            }
            catch (Exception)
            {
                return("");
            }
        }