예제 #1
0
        //班级操作
        public ActionResult ClassAction(string strAction, int Id, int? Instructor)
        {
            try
            {
                var bll = new Class_DetailBLL();
                var model = bll.GetModel(Id.ToInt());
                switch (strAction)
                {
                    case "clear"://清除
                        model.Delflag = true;
                        break;
                    case "complete"://结业
                        model.Status = 6;
                        break;
                    case "cancel"://撤销
                        model.Status = 1;
                        break;
                    case "setInstructor"://设置辅导员
                        model.Instructor = Instructor.Value;
                        break;
                    case "start"://开班
                        var traingModel=new Traning_DetailBLL().GetModel(model.TraningId,"");
                        if (traingModel.OutSideType == -1)//内部课程要有课程信息及比例
                        {
                            var list = new Course_DetailBLL().GetList(" Delflag=0 and TrainingId=" + model.TraningId, "");
                            if (list == null || list.Count == 0)
                                return Json(new { Code = -1, Msg = "请设置课程信息!" }, JsonRequestBehavior.AllowGet);
                            var courseDetail = list.First();
                            if (courseDetail.ReadingRate + courseDetail.DisscusRate + courseDetail.HomeWorkRate
                                + courseDetail.QuestionRate + courseDetail.TestingRate + courseDetail.CommentRate != 100)
                            {
                                return Json(new { Code = -1, Msg = "请设置课程考核比例!" }, JsonRequestBehavior.AllowGet);
                            }
                        }
                        model.Status = 5;
                        break;

                }

                bll.Update(model);

                return Json(new { Code = 0, Msg = "提交成功" }, JsonRequestBehavior.AllowGet);
            }
            catch (Exception ex)
            {
                return Json(new { Code = -1, Msg = ex.Message }, JsonRequestBehavior.AllowGet);
            }
        }
예제 #2
0
        public bool AddCourseDetail(int TrainingId)
        {
            Code.SiteCache cache = Code.SiteCache.Instance;
            Course_Detail model = new Course_Detail();
            Course_DetailBLL bll = new Course_DetailBLL();

            #region 设置课程Model的值
            model.TrainingId = TrainingId;
            model.AccountId = cache.LoginInfo.UserId;
            model.OrganId = cache.OrganId;
            model.Status = 2;
            model.Display = true;
            model.Sort = 50;
            model.Delflag = false;
            model.CreateDate = DateTime.Now;
            #endregion

            return bll.Add(model);
        }
예제 #3
0
        public ActionResult CourseSetUpRatio(int TrainingId)
        {
            //ViewBag.Title = "考核比例设定";
            Course_DetailBLL bll = new Course_DetailBLL();

            //指定课程的课程ID
            ViewBag.TrainingId = TrainingId;
            //获取指定课程ID对应的课程单元信息
            ViewBag.TrainingInfo = bll.GetTrainingInfoById(TrainingId);
            //获取指定课程ID对应的课程考核比例信息
            ViewBag.TestRateInfo = bll.GetTestRateModel(TrainingId, "delflag = 0");

            return View();
        }
예제 #4
0
        public ActionResult CoursePreviewLearn(int TrainingId)
        {
            //ViewBag.Title = "课程预览";

            Course_DetailBLL bll = new Course_DetailBLL();
            Code.SiteCache cache = Code.SiteCache.Instance;

            //指定课程的课程ID
            ViewBag.TrainingId = TrainingId;
            //获取指定课程ID对应的课程单元信息
            ViewBag.TrainingInfo = bll.GetTrainingInfoById(TrainingId);

            cache.TrainingId = TrainingId;
            cache.UnitId = TrainingId;
            ViewBag.ExamQuesCnt = cache.ExamQuesInfo.Count;
            ViewBag.ExamInfo = cache.ActivityInfo;

            return View();
        }
예제 #5
0
        public ActionResult CourseList()
        {
            //获取用户Id
            int AccountId = Code.SiteCache.Instance.LoginInfo.UserId;
            //ViewBag.Title = "课程制作列表";
            Course_DetailBLL bll = new Course_DetailBLL();

            //获取所有课程单元信息
            int subjectId;
            int.TryParse(Request["SubjectId"], out subjectId);
            ViewBag.Subject = bll.GetSubjectInfoList();
            ViewBag.SubjectId = subjectId;

            string keyWords = "";
            if (!string.IsNullOrEmpty(Request["KeyWords"]))
                keyWords = Request["KeyWords"].Trim();
            ViewBag.KeyWords = keyWords;

            Code.SiteCache cache = Code.SiteCache.Instance;
            StringBuilder where = new StringBuilder();
            where.Append("A.Delflag=0 and A.Status<>1 and A.PartitionId=" + cache.LoginInfo.PartitionId);
            if (keyWords != "")
                where.Append(" and Title like '%" + keyWords + "%'");
            if (subjectId != 0)
                where.Append(" and " + subjectId + " in (select value from [dbo].[split](Subject,','))");
            where.Append(" and A.Status > 2 AND A.Status != 4 and A.OutSideType = -1 and C.AccountId=" + AccountId);

            //获取课程总记录数
            int recordCount = bll.GetTrainingInfoCount(where.ToString());

            int pageSize = 8, pageIndex;
            int pageCount = (int)Math.Ceiling((double)recordCount / pageSize);
            int.TryParse(Request["PageIndex"], out pageIndex);
            if (pageIndex < 1)
                pageIndex = 1;
            else if (pageIndex > pageCount)
                pageIndex = pageCount;
            ViewBag.RecordCount = recordCount;
            ViewBag.PageCount = pageCount;
            ViewBag.PageIndex = pageIndex;
            ViewBag.PageSize = pageSize;

            //获取课程单元信息
            ViewBag.SubjectData = bll.GetSubject();
            //获取课程列表信息
            ViewBag.TrainingInfoList = bll.GetTrainingInfoList(pageSize, pageIndex, where.ToString(), "A.CreateDate");

            return View();
        }
예제 #6
0
        public ActionResult CourseLearn(int TrainingId,int ClassId)
        {
            //ViewBag.Title = "课程预览";

            Course_DetailBLL bll = new Course_DetailBLL();
            Code.SiteCache cache = Code.SiteCache.Instance;

            //指定课程的课程ID
            ViewBag.TrainingId = TrainingId;
            //获取指定课程ID对应的课程单元信息
            ViewBag.TrainingInfo = bll.GetTrainingInfoById(TrainingId);
            //获取班级ID
            ViewBag.ClassId = ClassId;

            Member_ClassRegisterBLL member_ClassRegisterBLL = new Member_ClassRegisterBLL();
            ViewBag.Score = member_ClassRegisterBLL.GetList("ClassId='" + ClassId + "' and Status=4 and Delflag='false' and PlanId='" + Code.SiteCache.Instance.PlanId + "' and AccountId='" + Code.SiteCache.Instance.LoginInfo.UserId + "'", "")[0].ExaminationScore;

            cache.TrainingId = TrainingId;
            cache.UnitId = TrainingId;
            cache.ClassId = ClassId;
            ViewBag.ExamQuesCnt = cache.ExamQuesInfo.Count;
            ViewBag.ExamInfo = cache.ActivityLearn;

            this.MyProgress(TrainingId);

            return View();
        }
예제 #7
0
        public ActionResult CourseDetail(int TrainingId)
        {
            //ViewBag.Title = "课程制作详细";
            Course_DetailBLL bll = new Course_DetailBLL();
            Code.SiteCache cache = Code.SiteCache.Instance;

            if (!bll.IsExistsCourseInfo(TrainingId))
            {
                AddCourseDetail(TrainingId);
            }

            //指定课程的课程ID
            ViewBag.TrainingId = TrainingId;
            //获取指定课程ID对应的课程单元信息
            ViewBag.TrainingInfo = bll.GetTrainingInfoById(TrainingId);

            cache.TrainingId = TrainingId;
            cache.UnitId = TrainingId;
            ViewBag.ExamQuesCnt = cache.ExamQuesInfo.Count;
            ViewBag.ExamInfo = cache.ActivityInfo;

            return View();
        }
예제 #8
0
        public ActionResult EditCourseDetail(Course_TestRate model)
        {
            Course_DetailBLL bll = new Course_DetailBLL();

            if (bll.UpdateTestRate(model))
            {
                return Json(new { Result = true, Msg = "设定成功!" }, JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json(new { Result = false, Msg = "设定失败!" }, JsonRequestBehavior.AllowGet);
            }
        }
예제 #9
0
        public ActionResult CourseActivityQuizQues(int TrainingId,int UnitContent)
        {
            //ViewBag.Title = "添加活动试题";
            Course_DetailBLL bll = new Course_DetailBLL();

            //指定课程的课程ID
            ViewBag.TrainingId = TrainingId;
            //指定活动单元的ID
            ViewBag.UnitContent = UnitContent;
            //获取指定课程ID对应的课程单元信息
            ViewBag.TrainingInfo = bll.GetTrainingInfoById(Convert.ToInt32(TrainingId));

            return View();
        }
예제 #10
0
        public ActionResult CourseActivityQuizEdit(int TrainingId, int UnitId)
        {
            //ViewBag.Title = "测试编辑";
            Course_DetailBLL bll_CourseDetail = new Course_DetailBLL();
            Course_UnitContentBLL bll = new Course_UnitContentBLL();
            Course_UnitQuestionBLL bll_UnitQuestion = new Course_UnitQuestionBLL();

            //指定课程的课程ID
            ViewBag.TrainingId = TrainingId;
            //获取指定课程ID对应的课程单元信息
            ViewBag.TrainingInfo = bll_CourseDetail.GetTrainingInfoById(Convert.ToInt32(TrainingId));
            //获取测试Model
            ViewBag.ActivityQuizModel = bll.GetModel(Convert.ToInt32(UnitId), "Delflag = 0");
            //指定单元活动是否已经添加试题
            ViewBag.IsExistsQuizQues = bll_UnitQuestion.IsExistsQuizQues(Convert.ToInt32(UnitId));

            return View();
        }
예제 #11
0
        public ActionResult CourseActivityAdd(int TrainingId)
        {
            //ViewBag.Title = "学习活动添加";
            Course_DetailBLL bll = new Course_DetailBLL();

            //指定课程的课程ID
            ViewBag.TrainingId = TrainingId;
            //获取指定课程ID对应的课程单元信息
            ViewBag.TrainingInfo = bll.GetTrainingInfoById(TrainingId);

            return View();
        }
예제 #12
0
        /// <summary>
        /// 重新打分
        /// </summary>
        /// <param name="classId"></param>
        /// <param name="planId"></param>
        /// <param name="accountId"></param>
        public static void resetScore(int classId, int planId)
        {
            var member_classBll = new Member_ClassRegisterBLL();

            var classDetail = new Class_DetailBLL().GetModel(classId);

            var traningBll = new Traning_DetailBLL();
            var traning_detail = traningBll.GetModel(classDetail.TraningId, "");
            if (traning_detail == null) return;

            var courseBll = new Course_DetailBLL();
            var cousre_detail = courseBll.GetList(" TrainingId=" + traning_detail.Id, "");
            if (cousre_detail == null || cousre_detail.Count == 0) return;

            var unitContentBll = new Course_UnitContentBLL();
            var memberList = member_classBll.GetList("Delflag=0 and ClassId=" + classId + " and PlanId=" + planId, "");
            foreach (var memberModel in memberList)
            {
                var accountId = memberModel.AccountId;
                int total = 1;

                IList<Course_UnitContent> contentList = new List<Course_UnitContent>();

                #region
                //重新计算阅读分数

                total = unitContentBll.GetUnitCountByClassAndUnitType(classId, "1,2");
                contentList = DataTableToListHelper<Course_UnitContent>.ConvertToModel(unitContentBll.GetUnitByClassAndUnitType(classId, "1,2"));
                if (contentList != null)
                {
                    var scheduleBll = new Member_ClassUnitContentScheduleBLL();
                    int scoreCount = 0;
                    foreach (var item in contentList)
                    {
                        var scheduleModel = scheduleBll.GetList("Delflag=0 and ClassId=" + classId + " and AccountId=" + accountId + " and UnitContent=" + item.Id, "");
                        if (scheduleModel != null && scheduleModel.Count > 0)
                        {
                            if (scheduleModel.First().score.HasValue)//如果有值说明打过分
                            {
                                scoreCount++;
                            }
                        }
                    }
                    if (scoreCount == total)//全部阅读过,给满分
                    {
                        memberModel.ReadingScore = cousre_detail[0].ReadingRate;
                    }
                    else
                    {
                        memberModel.ReadingScore = cousre_detail[0].ReadingRate * scoreCount / total;//阅读数与总数折算
                    }
                }

                //重新计算讨论分数

                total = unitContentBll.GetUnitCountByClassAndUnitType(classId, "3");
                contentList = DataTableToListHelper<Course_UnitContent>.ConvertToModel(unitContentBll.GetUnitByClassAndUnitType(classId, "3"));
                if (contentList != null)
                {
                    var scheduleBll = new Member_ClassUnitContentScheduleBLL();
                    int scoreCount = 0;
                    foreach (var item in contentList)
                    {
                        var scheduleModel = scheduleBll.GetList("Delflag=0 and ClassId=" + classId + " and AccountId=" + accountId + " and UnitContent=" + item.Id, "");
                        if (scheduleModel != null && scheduleModel.Count > 0)
                        {
                            if (scheduleModel.First().score.HasValue)//如果有值说明打过分
                            {
                                scoreCount++;
                            }
                        }
                    }
                    if (scoreCount == total)//全部讨论过,给满分
                    {
                        memberModel.DiscussScore = cousre_detail[0].DisscusRate;
                    }
                    else
                    {
                        memberModel.DiscussScore = cousre_detail[0].DisscusRate * scoreCount / total;//讨论数与总数折算
                    }
                }

                //如有分值,重新计算作业分数

                total = unitContentBll.GetUnitCountByClassAndUnitType(classId, "4");
                contentList = DataTableToListHelper<Course_UnitContent>.ConvertToModel(unitContentBll.GetUnitByClassAndUnitType(classId, "4"));
                if (contentList != null)
                {
                    var homeworkBll = new Course_UnitHomeWorkBLL();
                    double homeworkscore = 0;
                    foreach (var item in contentList)
                    {
                        var scheduleModel = homeworkBll.GetList("Delflag=0 and ClassId=" + classId + " and AccountId=" + accountId + " and UnitContent=" + item.Id, "");
                        if (scheduleModel != null && scheduleModel.Count > 0)
                        {
                            if (scheduleModel.First().Score.HasValue)//如果有值说明打过分
                            {
                                homeworkscore += (scheduleModel.First().Score.Value * (cousre_detail[0].HomeWorkRate) / (total * 100)).ToDouble();//已打分数与总数折算
                            }
                        }
                    }

                    memberModel.HomeWorkScore = homeworkscore;
                }

                //重新计算测试分数

                total = unitContentBll.GetUnitCountByClassAndUnitType(classId, "5");
                contentList = DataTableToListHelper<Course_UnitContent>.ConvertToModel(unitContentBll.GetUnitByClassAndUnitType(classId, "5"));
                if (contentList != null)
                {
                    var scheduleBll = new Member_ClassUnitContentScheduleBLL();
                    double testscore = 0;
                    foreach (var item in contentList)
                    {
                        var scheduleModel = scheduleBll.GetList("Delflag=0 and ClassId=" + classId + " and AccountId=" + accountId + " and UnitContent=" + item.Id, "");
                        if (scheduleModel != null && scheduleModel.Count > 0)
                        {
                            if (scheduleModel.First().score.HasValue)
                            {
                                testscore += (scheduleModel.First().score.Value * (cousre_detail[0].QuestionRate) / (total * 100)).ToDouble();
                            }
                        }
                    }
                    memberModel.TestingScore = testscore;
                }

                //重新计算考试分数

                total = unitContentBll.GetUnitCountByClassAndUnitType(classId, "6");
                contentList = DataTableToListHelper<Course_UnitContent>.ConvertToModel(unitContentBll.GetUnitByClassAndUnitType(classId, "6"));
                if (contentList != null)
                {
                    var scheduleBll = new Member_ClassUnitContentScheduleBLL();
                    double examcore = 0;
                    foreach (var item in contentList)
                    {
                        var scheduleModel = scheduleBll.GetList("Delflag=0 and ClassId=" + classId + " and AccountId=" + accountId + " and UnitContent=" + item.Id, "");
                        if (scheduleModel != null && scheduleModel.Count > 0)
                        {
                            if (scheduleModel.First().score.HasValue)
                            {
                                examcore += (scheduleModel.First().score.Value * (cousre_detail[0].TestingRate) / (total * 100)).ToDouble();
                            }
                        }
                    }
                    memberModel.ExaminationScore = examcore;
                }
                #endregion

                member_classBll.Update(memberModel);
            }
        }
예제 #13
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="objectId">单元ID</param>
        /// <param name="objectType">单元类型</param>
        /// <param name="classId">班级ID</param>
        /// <param name="planId">计划ID</param>
        /// <param name="accountId">成员ID</param>
        /// <param name="score">分值</param>
        public static void ScoreSet(int? objectId, int objectType, int classId, int planId, int accountId, double score, bool add = true)
        {
            dynamic objectBll;
            dynamic model;
            Member_ClassRegister memberModel;
            int total = 1;
            var member_classBll = new Member_ClassRegisterBLL();
            var member_class = member_classBll.GetList(" Delflag=0 and ClassId=" + classId + " and PlanId=" + planId + " and AccountId=" + accountId, "");
            if (member_class == null || member_class.Count == 0) return;
            memberModel = member_class.FirstOrDefault();

            var traningBll = new Traning_DetailBLL();
            var traning_detail = traningBll.GetModel(memberModel.TrainingId.Value, "");
            if (traning_detail == null) return;

            var courseBll = new Course_DetailBLL();
            var cousre_detail = courseBll.GetList(" Delflag=0 and TrainingId=" + traning_detail.Id, "");
            if (cousre_detail == null || cousre_detail.Count == 0) return;

            var unitContentBll = new Course_UnitContentBLL();
            var oldScore = 0.0;
            switch (objectType)
            {
                case 1://read

                    objectBll = new Member_ClassUnitContentScheduleBLL();
                    model = objectBll.GetList("Delflag=0 and ClassId=" + classId + " and AccountId=" + accountId + " and UnitContent=" + objectId, "");
                    if (model.Count > 0)
                    {
                        if (add)
                            model[0].score = 1;
                        else
                            model[0].score = 0;
                        objectBll.Update(model[0]);//
                    }
                    total = unitContentBll.GetUnitCountByClassAndUnitType(classId, "1,2");//阅读视频类的单元活动数
                    if (total > 1)
                    {
                        if (add)
                            memberModel.ReadingScore = (memberModel.ReadingScore.HasValue ? memberModel.ReadingScore.Value : 0)
                                + (cousre_detail[0].ReadingRate / (total)).ToDouble();
                        else
                        {
                            if (memberModel.ReadingScore.HasValue && memberModel.ReadingScore.Value.ToInt() > 0)
                                memberModel.ReadingScore = memberModel.ReadingScore.Value
                                    - (cousre_detail[0].ReadingRate / (total)).ToDouble();
                        }
                    }
                    else
                    {
                        if (add)
                            memberModel.ReadingScore = cousre_detail[0].ReadingRate;
                        else
                            memberModel.ReadingScore = 0.0;
                    }

                    if (memberModel.ReadingScore > cousre_detail[0].ReadingRate)
                    {
                        memberModel.ReadingScore = cousre_detail[0].ReadingRate;
                    }
                    if (memberModel.ReadingScore < 0)
                    {
                        memberModel.ReadingScore = 0;
                    }
                    member_classBll.Update(memberModel);//更新班级成员考试分数总值
                    break;
                case 2://discuss
                    objectBll = new Member_ClassUnitContentScheduleBLL();
                    model = objectBll.GetList("Delflag=0 and ClassId=" + classId + " and AccountId=" + accountId + " and UnitContent=" + objectId, "");
                    if (model.Count > 0)
                    {
                        if (add)
                            model[0].score = 1;
                        else
                            model[0].score = 0;
                        objectBll.Update(model[0]);//
                    }
                    total = unitContentBll.GetUnitCountByClassAndUnitType(classId, "3");//讨论类的单元活动数
                    if (total > 1)
                    {
                        if (add)
                            memberModel.DiscussScore = (memberModel.DiscussScore.HasValue ? memberModel.DiscussScore.Value : 0)
                                + (cousre_detail[0].DisscusRate / (total)).ToDouble();
                        else
                        {
                            if (memberModel.ReadingScore.HasValue && memberModel.ReadingScore.Value.ToInt() > 0)
                                memberModel.DiscussScore = memberModel.DiscussScore.Value
                                    - (cousre_detail[0].DisscusRate / (total)).ToDouble();
                        }
                    }
                    else
                    {
                        if (add)
                            memberModel.DiscussScore = cousre_detail[0].DisscusRate;
                        else
                            memberModel.DiscussScore = 0.0;
                    }

                    if (memberModel.DiscussScore > cousre_detail[0].DisscusRate)
                    {
                        memberModel.DiscussScore = cousre_detail[0].DisscusRate;
                    }
                    if (memberModel.DiscussScore < 0)
                    {
                        memberModel.DiscussScore = 0;
                    }
                    member_classBll.Update(memberModel);//更新班级成员考试分数总值
                    break;
                case 3://homework
                    #region

                    objectBll = new Course_UnitHomeWorkBLL();
                    model = objectBll.GetModel(objectId.Value, "");
                    model.Score = score;
                    model.ScoreCreater = SiteCache.Instance.ManagerId;
                    objectBll.Update(model);//更新结果表
                    total = unitContentBll.GetUnitCountByClassAndUnitType(classId, "4");//作业类的单元活动数
                    if (total > 1)
                    {
                        memberModel.HomeWorkScore = (memberModel.HomeWorkScore.HasValue ? memberModel.HomeWorkScore.Value : 0)
                           + (score * (cousre_detail[0].HomeWorkRate) / (total * 100)).ToDouble();
                    }
                    else
                    {
                        memberModel.HomeWorkScore = (score * (cousre_detail[0].HomeWorkRate) / (100)).ToDouble();
                    }

                    if (memberModel.HomeWorkScore > cousre_detail[0].HomeWorkRate)
                    {
                        memberModel.HomeWorkScore = cousre_detail[0].HomeWorkRate;
                    }
                    member_classBll.Update(memberModel);//更新班级成员作业分数总值
                    #endregion
                    break;
                case 4://question
                    #region

                    objectBll = new Member_ClassUnitContentScheduleBLL();
                    model = objectBll.GetModel(objectId.Value, "");
                    oldScore = model.score == null ? 0 : model.score;
                    model.score = score;
                    objectBll.Update(model);//更新班级成员测试分数总值
                    total = unitContentBll.GetUnitCountByClassAndUnitType(classId, "5");//测试类的单元活动数
                    if (add)//第一次打分
                    {
                        if (total > 1)
                        {
                            memberModel.TestingScore = (memberModel.TestingScore.HasValue ? memberModel.TestingScore.Value : 0)
                               + (score * (cousre_detail[0].QuestionRate) / (total * 100)).ToDouble();
                        }
                        else
                        {
                            memberModel.TestingScore = (score * (cousre_detail[0].QuestionRate) / (100)).ToDouble();
                        }
                    }
                    else//多次打分,重新计算
                    {
                        var contentList = DataTableToListHelper<Course_UnitContent>.ConvertToModel(unitContentBll.GetUnitByClassAndUnitType(classId, "5"));
                        if (contentList != null)
                        {
                            var scheduleBll = new Member_ClassUnitContentScheduleBLL();
                            double testscore = 0;
                            foreach (var item in contentList)
                            {
                                var scheduleModel = scheduleBll.GetList("Delflag=0 and ClassId=" + classId + " and AccountId=" + accountId + " AND UnitContent=" + item.Id, "");
                                if (scheduleModel != null && scheduleModel.Count > 0)
                                {
                                    if (scheduleModel.First().score.HasValue)
                                    {
                                        testscore += (scheduleModel.First().score.Value * (cousre_detail[0].QuestionRate) / (total * 100)).ToDouble();
                                    }
                                }
                            }
                            memberModel.TestingScore = testscore;
                        }
                    }
                    if (memberModel.TestingScore > cousre_detail[0].QuestionRate)
                    {
                        memberModel.TestingScore = cousre_detail[0].QuestionRate;
                    }
                    member_classBll.Update(memberModel);//更新班级成员测试分数总值
                    #endregion
                    break;
                case 5://examnation
                    #region

                    objectBll = new Member_ClassUnitContentScheduleBLL();
                    model = objectBll.GetModel(objectId.Value, "");
                    oldScore = model.score == null ? 0 : model.score;
                    model.score = score;
                    if (score >= 60)//考试大于等于60分算通过
                        memberModel.IsPass = true;
                    objectBll.Update(model);//更新班级成员考试分数总值
                    total = unitContentBll.GetUnitCountByClassAndUnitType(classId, "6");//考试类的单元活动数
                    if (total > 1)
                    {
                        memberModel.ExaminationScore = (memberModel.ExaminationScore.HasValue ? memberModel.ExaminationScore.Value : 0)
                            + (score * (cousre_detail[0].TestingRate) / (total * 100)).ToDouble();
                    }
                    else
                    {
                        memberModel.ExaminationScore = (score * (cousre_detail[0].TestingRate) / (100)).ToDouble();
                    }

                    if (memberModel.ExaminationScore > cousre_detail[0].TestingRate)
                    {
                        memberModel.ExaminationScore = cousre_detail[0].TestingRate;
                    }
                    member_classBll.Update(memberModel);//更新班级成员考试分数总值
                    #endregion
                    break;
                case 6://comment
                    #region
                    objectBll = new Member_ClassRegisterBLL();
                    model = objectBll.GetList(" Delflag=0 and ClassId=" + classId + " and PlanId=" + planId + " and AccountId=" + accountId, "")[0];
                    model.CommentScore = (score * (cousre_detail[0].CommentRate) / (total * 100)).ToDouble();
                    objectBll.Update(model);//更新班级成员评价分数总值
                    #endregion
                    break;
                default: break;
            }
        }
예제 #14
0
        public ActionResult CourseLearn(int TrainingId,int ClassId)
        {
            //ViewBag.Title = "课程预览";

            Course_DetailBLL bll = new Course_DetailBLL();
            Code.SiteCache cache = Code.SiteCache.Instance;

            //指定课程的课程ID
            ViewBag.TrainingId = TrainingId;
            //获取指定课程ID对应的课程单元信息
            ViewBag.TrainingInfo = bll.GetTrainingInfoById(TrainingId);
            //获取班级ID
            ViewBag.ClassId = ClassId;

            cache.TrainingId = TrainingId;
            cache.UnitId = TrainingId;
            cache.ClassId = ClassId;
            ViewBag.ExamQuesCnt = cache.ExamQuesInfo.Count;
            ViewBag.ExamInfo = cache.ActivityLearn;

            this.MyProgress(TrainingId);

            return View();
        }
예제 #15
0
        public ActionResult CourseUnitAdd(int TrainingId)
        {
            //ViewBag.Title = "课程单元添加";
            Course_DetailBLL bll = new Course_DetailBLL();

            //指定课程的课程ID
            ViewBag.TrainingId = TrainingId;
            //获取指定课程ID对应的课程单元信息
            ViewBag.TrainingInfo = bll.GetTrainingInfoById(TrainingId);
            //获取所有章节信息
            ViewBag.AllChapterSectionInfo = GetAllChapterSectionInfo(TrainingId,1);

            return View();
        }
예제 #16
0
        public ActionResult CourseActivityVideo(int TrainingId)
        {
            //ViewBag.Title = "影音教材增加";
            Course_DetailBLL bll = new Course_DetailBLL();

            //指定课程的课程ID
            ViewBag.TrainingId = TrainingId;
            //获取指定课程ID对应的课程单元信息
            ViewBag.TrainingInfo = bll.GetTrainingInfoById(Convert.ToInt32(TrainingId));
            //获取所有章节信息
            ViewBag.AllChapterSectionInfo = GetAllChapterSectionInfo(Convert.ToInt32(TrainingId),2);

            return View();
        }
예제 #17
0
        public ActionResult CourseUnitEdit(int TrainingId,int CourseId)
        {
            //ViewBag.Title = "课程单元编辑";
            Course_DetailBLL bll_CourseDetail = new Course_DetailBLL();
            Course_UnitDetailBLL bll = new Course_UnitDetailBLL();

            //指定课程的课程ID
            ViewBag.TrainingId = TrainingId;
            //获取指定课程ID对应的课程单元信息
            ViewBag.TrainingInfo = bll_CourseDetail.GetTrainingInfoById(TrainingId);
            //获取课程单元Model
            ViewBag.UnitDetailModel = bll.GetModel(CourseId,"Delflag = 0");

            return View();
        }
예제 #18
0
        public ActionResult CourseActivityVideoEdit(int TrainingId, int UnitId)
        {
            //ViewBag.Title = "影音教材编辑";
            Course_DetailBLL bll_CourseDetail = new Course_DetailBLL();
            Course_UnitContentBLL bll = new Course_UnitContentBLL();

            //指定课程的课程ID
            ViewBag.TrainingId = TrainingId;
            //获取指定课程ID对应的课程单元信息
            ViewBag.TrainingInfo = bll_CourseDetail.GetTrainingInfoById(Convert.ToInt32(TrainingId));
            //获取影音教材Model
            ViewBag.ActivityVideoModel = bll.GetModel(Convert.ToInt32(UnitId), "Delflag = 0");

            return View();
        }
예제 #19
0
        public ActionResult LearnNoteView(int TrainingId, int ClassId)
        {
            Course_DetailBLL bll = new Course_DetailBLL();

            //指定课程的课程ID
            ViewBag.TrainingId = TrainingId;
            //指定班级的ID
            ViewBag.ClassId = ClassId;
            //获取指定课程ID对应的课程单元信息
            ViewBag.TrainingInfo = bll.GetTrainingInfoById(TrainingId);

            return View();
        }
예제 #20
0
        public ActionResult List()
        {
            Course_DetailBLL bll_detail = new Course_DetailBLL();
            //指定课程的课程ID
            ViewBag.TrainingId = QueryString.Decrypt(Request["TrainingId"]);
            //指定班级的ID
            ViewBag.ClassId = QueryString.Decrypt(Request["ClassId"]);
            //获取指定课程ID对应的课程单元信息
            ViewBag.TrainingInfo = bll_detail.GetTrainingInfoById(Convert.ToInt32(QueryString.Decrypt(Request["TrainingId"])));

            string where = " and a.DisPlay = 1 ";
            int ClassId = 1;
            int pageIndex = 1, pageSize = 10, pageCount, recordCount;
            if (!String.IsNullOrEmpty(Request["pageIndex"]))
                int.TryParse(QueryString.Decrypt(Request["pageIndex"]), out pageIndex);
            if (!string.IsNullOrEmpty(Request["ClassId"]))
            {
                ClassId = Convert.ToInt32(QueryString.Decrypt(Request["ClassId"]));
            }
            where += " and a.ClassId = " + ClassId + " ";

            List<Class_Notice> list = bll.GetList(pageSize, pageIndex, where, " a.id desc", out recordCount);
            ViewBag.List = list;
            pageCount = (int)Math.Ceiling((double)recordCount / pageSize);
            ViewData["pageSize"] = pageSize;
            ViewData["pageIndex"] = pageIndex;
            ViewData["pageCount"] = pageCount;
            ViewData["recordCount"] = recordCount;
            ViewData["ClassId"] = ClassId;
            return View();
        }