Ejemplo n.º 1
0
        public static void GenerateAllDisciplines(IDisciplineStorage storage)
        {
            ImportExportDiscipline importer = new ImportExportDiscipline(storage);

            var path = (new System.Uri(Assembly.GetExecutingAssembly().CodeBase)).AbsolutePath;

            path = path.Replace("IUDICO.LMS/Plugins/IUDICO.DataGenerator.DLL", "IUDICO.DataGenerator/Content/Disciplines/");

            if (Directory.Exists(path))
            {
                var files = Directory.GetFiles(path, "*.zip");

                foreach (var file in files)
                {
                    var name = Path.GetFileNameWithoutExtension(file);

                    if (storage.GetDisciplines().Any(d => d.Name == name && d.Owner == "prof3"))
                    {
                        return;
                    }

                    importer.Import(file);
                }
            }
        }
Ejemplo n.º 2
0
      public static void SeleniumTestingSystemTestDiscipline(IDisciplineStorage storage, string path)
      {
         if (storage.GetDisciplines().Any(d => d.Name == "Testing discipline" && d.Owner == "SeleniumTeacher"))
         {
            return;
         }

         ImportExportDiscipline importer = new ImportExportDiscipline(storage);
         importer.Import(path);

      }
Ejemplo n.º 3
0
      public static void PascalDiscipline(IDisciplineStorage storage, string path)
		{
			if (storage.GetDisciplines().Any(d => d.Name == "Pascal" && d.Owner == "OlehVukladachenko"))
			{
				return;
			}
			
			ImportExportDiscipline importer = new ImportExportDiscipline(storage);
         importer.Import(path);

		}
Ejemplo n.º 4
0
        public static void SeleniumTestingSystemTestDiscipline(IDisciplineStorage storage, string path)
        {
            if (storage.GetDisciplines().Any(d => d.Name == "Testing discipline" && d.Owner == "SeleniumTeacher"))
            {
                return;
            }

            ImportExportDiscipline importer = new ImportExportDiscipline(storage);

            importer.Import(path);
        }
Ejemplo n.º 5
0
        public static void PascalDiscipline(IDisciplineStorage storage, string path)
        {
            if (storage.GetDisciplines().Any(d => d.Name == "Pascal" && d.Owner == "OlehVukladachenko"))
            {
                return;
            }

            ImportExportDiscipline importer = new ImportExportDiscipline(storage);

            importer.Import(path);
        }
Ejemplo n.º 6
0
      public static void GenerateAllDisciplines(IDisciplineStorage storage)
      {
         ImportExportDiscipline importer = new ImportExportDiscipline(storage);

         var path = (new System.Uri(Assembly.GetExecutingAssembly().CodeBase)).AbsolutePath;
         path = path.Replace("IUDICO.LMS/Plugins/IUDICO.DataGenerator.DLL", "IUDICO.DataGenerator/Content/Disciplines/");

         if (Directory.Exists(path))
         {
           var files = Directory.GetFiles(path, "*.zip");

            foreach (var file in files)
            {
               var name = Path.GetFileNameWithoutExtension(file);

               if (storage.GetDisciplines().Any(d => d.Name == name && d.Owner == "prof3"))
               {
                  return;
               }

               importer.Import(file);
            }
         }
      }
Ejemplo n.º 7
0
        public static void PascalCurriculum(ICurriculumStorage curriculumStorage, IDisciplineStorage disciplineStorage, IUserStorage userStorage)
        {
            var groups      = userStorage.GetGroups();
            var disciplines = disciplineStorage.GetDisciplines();

            var curriculum = new Curriculum
            {
                UserGroupRef  = groups.FirstOrDefault(g => g.Name == "Демонстраційна група").Id,
                DisciplineRef = disciplines.FirstOrDefault(d => d.Name == "Pascal" && d.Owner == "OlehVukladachenko").Id,
                StartDate     = DateTime.Now,
                EndDate       = DateTime.Now + new TimeSpan(365, 0, 0, 0, 0)
            };

            if (curriculumStorage.GetCurriculums().Any(c => c.DisciplineRef == curriculum.DisciplineRef && c.UserGroupRef == curriculum.UserGroupRef))
            {
                return;
            }
            curriculumStorage.AddCurriculum(curriculum);

            foreach (var chapter in curriculumStorage.GetCurriculum(curriculum.Id).CurriculumChapters)
            {
                chapter.StartDate = DateTime.Now;
                chapter.EndDate   = DateTime.Now + new TimeSpan(364, 0, 0, 0, 0);
                curriculumStorage.UpdateCurriculumChapter(chapter);

                foreach (var topic in chapter.CurriculumChapterTopics)
                {
                    topic.TestStartDate   = DateTime.Now;
                    topic.TestEndDate     = DateTime.Now + new TimeSpan(363, 0, 0, 0, 0);
                    topic.TheoryStartDate = DateTime.Now;
                    topic.TheoryEndDate   = DateTime.Now + new TimeSpan(363, 0, 0, 0, 0);

                    curriculumStorage.UpdateCurriculumChapterTopic(topic);
                }
            }
        }
Ejemplo n.º 8
0
      public static void PascalCurriculum(ICurriculumStorage curriculumStorage, IDisciplineStorage disciplineStorage, IUserStorage userStorage)
      {
         var groups = userStorage.GetGroups();
         var disciplines = disciplineStorage.GetDisciplines();

         var curriculum = new Curriculum
                                       {
                                          UserGroupRef = groups.FirstOrDefault(g => g.Name == "Демонстраційна група").Id,
                                          DisciplineRef = disciplines.FirstOrDefault(d => d.Name == "Pascal" && d.Owner == "OlehVukladachenko").Id,
                                          StartDate = DateTime.Now,
                                          EndDate = DateTime.Now + new TimeSpan(365, 0, 0, 0, 0)
                                       };

         if (curriculumStorage.GetCurriculums().Any(c => c.DisciplineRef == curriculum.DisciplineRef && c.UserGroupRef == curriculum.UserGroupRef))
         {
            return;
         }
         curriculumStorage.AddCurriculum(curriculum);

         foreach (var chapter in curriculumStorage.GetCurriculum(curriculum.Id).CurriculumChapters)
         {
            chapter.StartDate = DateTime.Now;
            chapter.EndDate = DateTime.Now + new TimeSpan(364, 0, 0, 0, 0);
            curriculumStorage.UpdateCurriculumChapter(chapter);

            foreach (var topic in chapter.CurriculumChapterTopics)
            {
               topic.TestStartDate = DateTime.Now;
               topic.TestEndDate = DateTime.Now + new TimeSpan(363, 0, 0, 0, 0);
               topic.TheoryStartDate = DateTime.Now;
               topic.TheoryEndDate = DateTime.Now + new TimeSpan(363, 0, 0, 0, 0);

               curriculumStorage.UpdateCurriculumChapterTopic(topic);
            }
         }
      }
Ejemplo n.º 9
0
        public static void CurriculumForSeleniumTestingSystem(ICurriculumStorage curriculumStorage, IDisciplineStorage disciplineStorage, IUserStorage userStorage)
        {
            var groups      = userStorage.GetGroups();
            var disciplines = disciplineStorage.GetDisciplines();

            var curriculums = new List <Curriculum>
            {
                new Curriculum
                {
                    UserGroupRef =
                        groups.FirstOrDefault(
                            g => g.Name == "Selenium testing system group").Id,
                    DisciplineRef =
                        disciplines.FirstOrDefault(
                            d => d.Name == "Testing discipline" && d.Owner == "SeleniumTeacher").Id,
                    StartDate = DateTime.Now,
                    EndDate   = DateTime.Now + new TimeSpan(365, 0, 0, 0, 0)
                },
                //new Curriculum
                //   {
                //      UserGroupRef =
                //         userStorage.GetGroups().FirstOrDefault(
                //            g => g.Name == "Disc timeline").Id,
                //      DisciplineRef =
                //         disciplineStorage.GetDisciplines().FirstOrDefault(
                //            d => d.Name == "Testing discipline" && d.Owner == "SeleniumTeacher").Id,
                //      StartDate = DateTime.Now,
                //      EndDate = DateTime.Now + new TimeSpan(0, 0, 0, 0, 1)
                //   },
                //new Curriculum
                //   {
                //      UserGroupRef =
                //         userStorage.GetGroups().FirstOrDefault(
                //            g => g.Name == "Chapter timeline").Id,
                //      DisciplineRef =
                //         disciplineStorage.GetDisciplines().FirstOrDefault(
                //            d => d.Name == "Testing discipline" && d.Owner == "SeleniumTeacher").Id,
                //      StartDate = DateTime.Now,
                //      EndDate = DateTime.Now + new TimeSpan(36500, 0, 0, 0, 0)
                //   },
                //new Curriculum
                //   {
                //      UserGroupRef =
                //         userStorage.GetGroups().FirstOrDefault(
                //            g => g.Name == "Topic timeline").Id,
                //      DisciplineRef =
                //         disciplineStorage.GetDisciplines().FirstOrDefault(
                //            d => d.Name == "Testing discipline" && d.Owner == "SeleniumTeacher").Id,
                //      StartDate = DateTime.Now,
                //      EndDate = DateTime.Now + new TimeSpan(36500, 0, 0, 0, 0)
                //   }
            };

            foreach (var curriculum in curriculums)
            {
                if (curriculumStorage.GetCurriculums().Any(c => c.DisciplineRef == curriculum.DisciplineRef && c.UserGroupRef == curriculum.UserGroupRef))
                {
                    continue;
                }
                curriculumStorage.AddCurriculum(curriculum);

                foreach (var chapter in curriculumStorage.GetCurriculum(curriculum.Id).CurriculumChapters)
                {
                    chapter.StartDate = DateTime.Now;
                    chapter.EndDate   = DateTime.Now + new TimeSpan(364, 0, 0, 0, 0);
                    if (userStorage.GetGroup(curriculum.UserGroupRef).Name == "Chapter timeline")
                    {
                        chapter.EndDate = DateTime.Now + new TimeSpan(0, 0, 0, 0, 1);
                    }
                    curriculumStorage.UpdateCurriculumChapter(chapter);

                    foreach (var topic in chapter.CurriculumChapterTopics)
                    {
                        topic.TestStartDate   = DateTime.Now;
                        topic.TestEndDate     = DateTime.Now + new TimeSpan(363, 0, 0, 0, 0);
                        topic.TheoryStartDate = DateTime.Now;
                        topic.TheoryEndDate   = DateTime.Now + new TimeSpan(363, 0, 0, 0, 0);
                        if (userStorage.GetGroup(curriculum.UserGroupRef).Name == "Topic timeline")
                        {
                            topic.TestEndDate   = DateTime.Now + new TimeSpan(0, 0, 0, 0, 1);
                            topic.TheoryEndDate = DateTime.Now + new TimeSpan(0, 0, 0, 0, 1);
                        }
                        curriculumStorage.UpdateCurriculumChapterTopic(topic);
                    }
                }
            }
        }
Ejemplo n.º 10
0
      public static void CurriculumForSeleniumTestingSystem(ICurriculumStorage curriculumStorage, IDisciplineStorage disciplineStorage, IUserStorage userStorage)
      {
         var groups = userStorage.GetGroups();
         var disciplines = disciplineStorage.GetDisciplines();

         var curriculums = new List<Curriculum>
                              {
                                 new Curriculum
                                    {
                                       UserGroupRef =
                                          groups.FirstOrDefault(
                                             g => g.Name == "Selenium testing system group").Id,
                                       DisciplineRef =
                                          disciplines.FirstOrDefault(
                                             d => d.Name == "Testing discipline" && d.Owner == "SeleniumTeacher").Id,
                                       StartDate = DateTime.Now,
                                       EndDate = DateTime.Now + new TimeSpan(365, 0, 0, 0, 0)
                                    },
                                 //new Curriculum
                                 //   {
                                 //      UserGroupRef =
                                 //         userStorage.GetGroups().FirstOrDefault(
                                 //            g => g.Name == "Disc timeline").Id,
                                 //      DisciplineRef =
                                 //         disciplineStorage.GetDisciplines().FirstOrDefault(
                                 //            d => d.Name == "Testing discipline" && d.Owner == "SeleniumTeacher").Id,
                                 //      StartDate = DateTime.Now,
                                 //      EndDate = DateTime.Now + new TimeSpan(0, 0, 0, 0, 1)
                                 //   },
                                 //new Curriculum
                                 //   {
                                 //      UserGroupRef =
                                 //         userStorage.GetGroups().FirstOrDefault(
                                 //            g => g.Name == "Chapter timeline").Id,
                                 //      DisciplineRef =
                                 //         disciplineStorage.GetDisciplines().FirstOrDefault(
                                 //            d => d.Name == "Testing discipline" && d.Owner == "SeleniumTeacher").Id,
                                 //      StartDate = DateTime.Now,
                                 //      EndDate = DateTime.Now + new TimeSpan(36500, 0, 0, 0, 0)
                                 //   },
                                 //new Curriculum
                                 //   {
                                 //      UserGroupRef =
                                 //         userStorage.GetGroups().FirstOrDefault(
                                 //            g => g.Name == "Topic timeline").Id,
                                 //      DisciplineRef =
                                 //         disciplineStorage.GetDisciplines().FirstOrDefault(
                                 //            d => d.Name == "Testing discipline" && d.Owner == "SeleniumTeacher").Id,
                                 //      StartDate = DateTime.Now,
                                 //      EndDate = DateTime.Now + new TimeSpan(36500, 0, 0, 0, 0)
                                 //   }
                              };

         foreach (var curriculum in curriculums)
         {

            if (curriculumStorage.GetCurriculums().Any(c => c.DisciplineRef == curriculum.DisciplineRef && c.UserGroupRef == curriculum.UserGroupRef))
            {
               continue;
            }
            curriculumStorage.AddCurriculum(curriculum);

            foreach (var chapter in curriculumStorage.GetCurriculum(curriculum.Id).CurriculumChapters)
            {
               chapter.StartDate = DateTime.Now;
               chapter.EndDate = DateTime.Now + new TimeSpan(364, 0, 0, 0, 0);
               if (userStorage.GetGroup(curriculum.UserGroupRef).Name == "Chapter timeline")
               {
                  chapter.EndDate = DateTime.Now + new TimeSpan(0, 0, 0, 0, 1);
               }
               curriculumStorage.UpdateCurriculumChapter(chapter);

               foreach (var topic in chapter.CurriculumChapterTopics)
               {
                  topic.TestStartDate = DateTime.Now;
                  topic.TestEndDate = DateTime.Now + new TimeSpan(363, 0, 0, 0, 0);
                  topic.TheoryStartDate = DateTime.Now;
                  topic.TheoryEndDate = DateTime.Now + new TimeSpan(363, 0, 0, 0, 0);
                  if (userStorage.GetGroup(curriculum.UserGroupRef).Name == "Topic timeline")
                  {
                     topic.TestEndDate = DateTime.Now + new TimeSpan(0, 0, 0, 0, 1);
                     topic.TheoryEndDate = DateTime.Now + new TimeSpan(0, 0, 0, 0, 1);
                  }
                  curriculumStorage.UpdateCurriculumChapterTopic(topic);
               }
            }
         }
      }