Пример #1
0
 public static LessonPreReq getPreReq(int id)
 {
     foreach (Lesson l in Controller.getLessons())
     {
         if (l.Id == id)
         {
             LessonPreReq p = new LessonPreReq(l);
             p.RelativeImportance = 0.5;
             p.MasteringLevel     = 0.8;
             return(p);
         }
     }
     return(null);
 }
Пример #2
0
        public static List <int> getPreReqsForLesson(int lesson_id)
        {
            List <int>  adj_ids = new List <int>();
            CustomGraph g       = new CustomGraph(@"..\..\Resources\assests\Matrices.txt", "SIMPLE");

            // CustomGraph g = Controller.GetLessonGraphs().ElementAt(0);
            // Console.WriteLine("tOTAL gRAPHS :"+Controller.GetLessonGraphs().Count);

            for (int i = 0; i < g.NumberNodes; i++)
            {
                if (g.AreAdjacent(lesson_id, i))
                {
                    adj_ids.Add(i);
                    LessonPreReq pre = getPreReq(i);
                    if (pre != null)
                    {
                        getLesson(lesson_id).PreReqs.Add((pre));
                    }
                    //Console.WriteLine("Oh Yes ADDED");
                }
            }
            //MessageBox.Show(adj_ids.Count + "");
            return(adj_ids);
        }
        public static LessonPreReq getPreReq(int id)
        {
            foreach (Lesson l in Controller.getLessons())
            {
                if (l.Id == id)
                {
                    LessonPreReq p = new LessonPreReq(l);
                    p.RelativeImportance = 0.5;
                    p.MasteringLevel = 0.8;
                    return p;
                }

            }
            return null;
        }