示例#1
0
        private LessonPlan.LessonPlan LoadLessonPlan()
        {
            LessonPlan.LessonPlan lessonPlan = new LessonPlan.LessonPlan();

            string lessonPlanPath = HttpContext.Current.Server.MapPath("~/LessonPlan/lesson_plan.json");

            using (StreamReader reader = new StreamReader(lessonPlanPath))
            {
                string lessonPlanJson = reader.ReadToEnd();
                lessonPlan = JsonConvert.DeserializeObject <LessonPlan.LessonPlan>(lessonPlanJson);
            }

            return(lessonPlan);
        }
示例#2
0
        private LessonPlan.LessonPlan LoadLessonPlan()
        {
            string lessonPlanAPI = ConfigurationManager.AppSettings["LessonServiceAPI"];

            LessonPlan.LessonPlan lessonPlan = new LessonPlan.LessonPlan();
            List <BotCourseModel> lessons    = LessonPlanHelper.GetLessonPlanAsync <List <BotCourseModel> >(lessonPlanAPI).Result;

            foreach (BotCourseModel lesson in lessons)
            {
                lessonPlan.Lessons.Add(new Lesson()
                {
                    LessonTitle = lesson.Name, currentTopic = lesson.AssignmentId, APIUrl = lesson.APIUrl
                });
            }

            return(lessonPlan);
        }
示例#3
0
 protected override void Load(ContainerBuilder builder)
 {
     base.Load(builder);
     LessonPlan = LoadLessonPlan();
 }