/// <summary> /// 获取用户学习计划执行详细 /// </summary> /// <param name="userId">用户ID</param> /// <param name="planId">计划ID</param> /// <returns></returns> public UserStudyPlanDetails GetPlanDetails(long userId, long planId) { //学习计划 var plan = new StudyPlanManage(planId); //指定学习对该计划的实施信息 var userPlan = new UserStudyPlanManage(userId, planId); //计算用户课程学习进度 foreach (var course in plan.Courses) { var calc = new CourseStudingProgressComputer(userId, course.CourseId); course.Progress = calc.Calculate(); } return(new UserStudyPlanDetails { UserId = userId, PlanId = plan.StudyPlan.PlanId, Title = plan.StudyPlan.Title, Content = plan.StudyPlan.Content, CreatorId = plan.Creator.UserId, CreatorName = plan.Creator.Username, PlanStatus = plan.StudyPlan.Status, StudentCount = plan.StudyPlan.Student, CreateTime = plan.StudyPlan.CreateTime, StudyStatus = userPlan.Plan.Status, Progress = userPlan.Plan.Progress, LastStudyTime = userPlan.Plan.UpdateTime, Courses = plan.Courses, Students = plan.Students }); }
/// <summary> /// 获取指定学员对学习计划的学习情况 /// </summary> /// <param name="planId">学习计划ID</param> /// <param name="userId">学员ID</param> /// <returns></returns> public StudentPlanStudingDetails GetyPlanStudingDetails(long planId, long userId) { var plan = new StudyPlanManage(planId); var data = plan.GetStudentStudingDetails(userId); return(data); }
/// <summary> /// 获取学习计划的详细信息 /// </summary> /// <param name="planId">学习计划ID</param> /// <returns></returns> public StudyPlanDetails GetStudyPlanDetails(long planId) { var plan = new StudyPlanManage(planId); var data = plan.ConvertToStudyPlanDetails(); return(data); }
/// <summary> /// 设置状态为“禁用” /// </summary> /// <param name="planId">学习计划ID</param> /// <returns></returns> public bool SetDisable(long planId) { var plan = new StudyPlanManage(planId); return(plan.SetDisable()); }