Esempio n. 1
0
        /// <summary>
        /// Validates the curriculum chapter topic.
        /// </summary>
        /// <param name="curriculumChapter">The curriculum chapter topic.</param>
        /// <returns></returns>
        public ValidationStatus ValidateCurriculumChapterTopic(CurriculumChapterTopic data)
        {
            ValidationStatus validationStatus = new ValidationStatus();

            ValidateDate(data.TestStartDate, data.TestEndDate, validationStatus);
            ValidateDate(data.TheoryStartDate, data.TheoryEndDate, validationStatus);

            //TODO: check topic timelines and curriculum timelines!

            return validationStatus;
        }
Esempio n. 2
0
        /// <summary>
        /// Validates the curriculum chapter topic.
        /// </summary>
        /// <param name="data">The data.</param>
        /// <returns></returns>
        public ValidationStatus ValidateCurriculumChapterTopic(CurriculumChapterTopic data)
        {
            var validationStatus = new ValidationStatus();

            ValidateDate(data.TestStartDate, data.TestEndDate, validationStatus);
            ValidateDate(data.TheoryStartDate, data.TheoryEndDate, validationStatus);

            if (data.ThresholdOfSuccess <= 0)
            {
                validationStatus.AddLocalizedError("MaxScoreMustBeGreaterThanZero");
            }

            return validationStatus;
        }
Esempio n. 3
0
 public double GetStudentResultForTopic(User student, CurriculumChapterTopic curriculumChapterTopic)
 {
     if (this.AllAttempts.Count != 0)
     {
         var attemptResult =
             this.AllAttempts.SingleOrDefault(
                 x => x.User.Id == student.Id && x.CurriculumChapterTopic.Id == curriculumChapterTopic.Id);
         if (attemptResult != null)
         {
             var result = attemptResult.Score.RawScore;
             return result.HasValue ? result.Value : 0;
         }
         
         return 0;
     }
     
     return 0;
 }
Esempio n. 4
0
        public void CreateAttemptResultWithParameters()
        {
            const long AttemptId = 12312;
            const int IudicoCourseRef = 23;
            var user = new User();
            var curriculumChapterTopic = new CurriculumChapterTopic();
            const TopicTypeEnum TopicTypeEnum = TopicTypeEnum.TestWithoutCourse;
            const CompletionStatus CompletionStatus = CompletionStatus.Incomplete;
            const AttemptStatus AttemptStatus = AttemptStatus.Completed;
            const SuccessStatus SuccessStatus = SuccessStatus.Passed;
            DateTime? startTime = new DateTime(32478932);
            DateTime? finishTime = new DateTime(189041324);
            float? score = 0.22f;
            float? minScore = 0;
            float? maxScore = 50;
            float? rawScore = 11;

            var attemptResult = new AttemptResult(
                AttemptId,
                user,
                curriculumChapterTopic,
                TopicTypeEnum,
                CompletionStatus,
                AttemptStatus,
                SuccessStatus,
                startTime,
                finishTime,
                IudicoCourseRef,
                minScore,
                maxScore,
                rawScore,
                score);

            Assert.AreEqual(AttemptId, attemptResult.AttemptId);
            Assert.AreEqual(user, attemptResult.User);
            Assert.AreEqual(curriculumChapterTopic, attemptResult.CurriculumChapterTopic);
            Assert.AreEqual(TopicTypeEnum, attemptResult.TopicType);
            Assert.AreEqual(CompletionStatus, attemptResult.CompletionStatus);
            Assert.AreEqual(AttemptStatus, attemptResult.AttemptStatus);
            Assert.AreEqual(SuccessStatus, attemptResult.SuccessStatus);
            Assert.AreEqual(startTime, attemptResult.StartTime);
            Assert.AreEqual(finishTime, attemptResult.FinishTime);
            Assert.AreEqual(score, attemptResult.Score.ScaledScore);
        }
Esempio n. 5
0
 private void attach_CurriculumChapterTopics(CurriculumChapterTopic entity)
 {
     this.SendPropertyChanging();
     entity.CurriculumChapter = this;
 }
Esempio n. 6
0
 public bool CanPassCurriculumChapterTopic(User user, CurriculumChapterTopic curriculumChapterTopic, TopicTypeEnum topicType)
 {
     return this.curriculumStorage.CanPassCurriculumChapterTopic(user, curriculumChapterTopic, topicType);
 }
Esempio n. 7
0
        public IEnumerable<AttemptResult> GetResults(
            User user, CurriculumChapterTopic curriculumChapterTopic, TopicTypeEnum topicType)
        {
            var job = this.LStore.CreateJob();
            var conditions = new List<QueryCondition>
                {
                    new QueryCondition(Schema.AllAttemptsResults.UserItemKey, user.Id.ToString()),
                    new QueryCondition(Schema.AllAttemptsResults.CurriculumChapterTopicId, curriculumChapterTopic.Id),
                    new QueryCondition(Schema.AllAttemptsResults.TopicType, (int)topicType)
                };

            this.RequestAttemptResults(job, conditions);

            var dataTable = job.Execute<DataTable>();

            return this.ParseAttemptResults(dataTable.AsEnumerable(), conditions);
        }
Esempio n. 8
0
 public long GetAttempId(User student, CurriculumChapterTopic curriculumChapterTopic)
 {
     var res = this.lastAttempts.Find(x => x.User.Id == student.Id & x.CurriculumChapterTopic.Id == curriculumChapterTopic.Id);
     
     return res != null ? res.AttemptId : -1;
 }
Esempio n. 9
0
        public double GetMaxResutForTopic(User student, CurriculumChapterTopic curriculumChapterTopic)
        {
            if (this.AllAttempts.Count != 0)
            {
                var attemptResult =
                    this.AllAttempts.SingleOrDefault(
                        x => x.User.Id == student.Id && x.CurriculumChapterTopic.Id == curriculumChapterTopic.Id);
                if (attemptResult != null)
                {
                    var answerResults = lmsService.FindService<ITestingService>().GetAnswers(attemptResult);
                    var courseId = attemptResult.IudicoCourseRef;
                    var courseInfo = this.lmsService.FindService<ICourseService>().GetCourseInfo(courseId);

                    double maxScore = 0;
                    foreach (var node in courseInfo.NodesInfo)
                    {
                        if (answerResults.Any(answer => int.Parse(answer.PrimaryResourceFromManifest.Replace(".html", "")) == node.Id))
                        {
                            maxScore += node.MaxScore;
                        }
                    }

                    return maxScore;
                }

                return 0;
            }

            return 0;
        }
Esempio n. 10
0
        public bool CanPassCurriculumChapterTopic(User user, CurriculumChapterTopic curriculumChapterTopic, TopicTypeEnum topicType)
        {
            // TODO: implement in more sophisticated and performance-proof maner

            var descriptions = this.GetTopicDescriptions(user);

            var selectedDescriptions =
                descriptions.Where(desc => desc.CurriculumChapterTopicId == curriculumChapterTopic.Id
                                           && desc.TopicType == topicType);

            return selectedDescriptions.Count() == 1;
        }
Esempio n. 11
0
        public int AddCurriculumChapterTopic(CurriculumChapterTopic curriculumChapterTopic)
        {
            var db = this.GetDbContext();

            curriculumChapterTopic.IsDeleted = false;

            db.CurriculumChapterTopics.InsertOnSubmit(curriculumChapterTopic);
            var curriculum = GetCurriculum(db, GetCurriculumChapter(db, curriculumChapterTopic.CurriculumChapterRef).CurriculumRef);

            curriculum.IsValid = this.IsCurriculumValid(curriculum);

            db.SubmitChanges();
            return curriculumChapterTopic.Id;
        }
Esempio n. 12
0
        public int AddCurriculumChapterTopic(CurriculumChapterTopic curriculumChapterTopic)
        {
            var id = this.storage.AddCurriculumChapterTopic(curriculumChapterTopic);
            var curriculumId = this.storage.GetCurriculumChapter(this.storage.GetCurriculumChapterTopic(id).CurriculumChapterRef).CurriculumRef;
            this.cacheProvider.Invalidate("curriculums", "curriculum-" + curriculumId);

            this.cacheProvider.Invalidate("curriculumchaptertopics");

            return id;
        }
Esempio n. 13
0
 public TopicResult(User user, CurriculumChapterTopic curriculumChapterTopic)
 {
     this.user = user;
     this.curriculumChapterTopic = curriculumChapterTopic;
 }
Esempio n. 14
0
 public TopicResult()
 {
     this.user = new User();
     this.curriculumChapterTopic = new CurriculumChapterTopic();
 }
Esempio n. 15
0
 public IEnumerable<AttemptResult> GetResults(CurriculumChapterTopic curriculumChapterTopic)
 {
     return this.MlcProxy.GetResults(curriculumChapterTopic);
 }
Esempio n. 16
0
 public IEnumerable<AttemptResult> GetResults(
     User user, CurriculumChapterTopic curriculumChapterTopic, TopicTypeEnum topicType)
 {
     return this.MlcProxy.GetResults(user, curriculumChapterTopic, topicType);
 }
Esempio n. 17
0
        public IEnumerable<AttemptResult> GetResults(CurriculumChapterTopic curriculumChapterTopic)
        {
            var job = this.LStore.CreateJob();
            var conditions = new List<QueryCondition>
                { new QueryCondition(Schema.AllAttemptsResults.CurriculumChapterTopicId, curriculumChapterTopic.Id) };

            this.RequestAttemptResults(job, conditions);

            var dataTable = job.Execute<DataTable>();

            return this.ParseAttemptResults(dataTable.AsEnumerable(), conditions);
        }
Esempio n. 18
0
 private void detach_CurriculumChapterTopics(CurriculumChapterTopic entity)
 {
     this.SendPropertyChanging();
     entity.Topic = null;
 }
Esempio n. 19
0
        public int AddCurriculumChapter(CurriculumChapter curriculumChapter)
        {
            var db = this.GetDbContext();

            curriculumChapter.IsDeleted = false;

            db.CurriculumChapters.InsertOnSubmit(curriculumChapter);
            
            var curriculum = GetCurriculum(db, curriculumChapter.CurriculumRef);

            if (curriculumChapter.StartDate < curriculum.StartDate || curriculumChapter.EndDate > curriculum.EndDate)
            {
                curriculum.IsValid = false;
            }

            db.SubmitChanges();
            
            // add corresponding curriculum chapter topics
            var topics = this.GetTopicsByChapterId(curriculumChapter.ChapterRef);

            foreach (var topic in topics)
            {
                var curriculumChapterTopic = new CurriculumChapterTopic
                {
                    CurriculumChapterRef = curriculumChapter.Id,
                    TopicRef = topic.Id,
                    ThresholdOfSuccess = Constants.DefaultThresholdOfSuccess,
                    BlockTopicAtTesting = false,
                    BlockCurriculumAtTesting = false
                };

                this.AddCurriculumChapterTopic(curriculumChapterTopic);
            }

            return curriculumChapter.Id;
        }
Esempio n. 20
0
        public void UpdateCurriculumChapterTopic(CurriculumChapterTopic curriculumChapterTopic)
        {
            this.storage.UpdateCurriculumChapterTopic(curriculumChapterTopic);
            var curriculumId = this.storage.GetCurriculumChapter(this.storage.GetCurriculumChapterTopic(curriculumChapterTopic.Id).CurriculumChapterRef).CurriculumRef;

            this.cacheProvider.Invalidate("curriculums", "curriculum-" + curriculumId);
            this.cacheProvider.Invalidate("curriculumchaptertopics", "curriculumchaptertopic-" + curriculumChapterTopic.Id);
        }
Esempio n. 21
0
        public void UpdateCurriculumChapterTopic(CurriculumChapterTopic curriculumChapterTopic)
        {
            var db = this.GetDbContext();
            var oldTopicAssignment = GetCurriculumChapterTopic(db, curriculumChapterTopic.Id);

            oldTopicAssignment.ThresholdOfSuccess = curriculumChapterTopic.ThresholdOfSuccess;
            oldTopicAssignment.BlockCurriculumAtTesting = curriculumChapterTopic.BlockCurriculumAtTesting;
            oldTopicAssignment.BlockTopicAtTesting = curriculumChapterTopic.BlockTopicAtTesting;
            oldTopicAssignment.TheoryStartDate = curriculumChapterTopic.TheoryStartDate;
            oldTopicAssignment.TheoryEndDate = curriculumChapterTopic.TheoryEndDate;
            oldTopicAssignment.TestStartDate = curriculumChapterTopic.TestStartDate;
            oldTopicAssignment.TestEndDate = curriculumChapterTopic.TestEndDate;            

            db.SubmitChanges();
            var curriculumChapter = GetCurriculumChapter(db, oldTopicAssignment.CurriculumChapterRef);
            var curriculum = GetCurriculum(db, curriculumChapter.CurriculumRef);
            curriculum.IsValid = this.IsCurriculumValid(curriculum);
            db.SubmitChanges();
        }
Esempio n. 22
0
        public int AddTopic(Topic topic)
        {
            var db = GetDbContext();

            topic.Created = DateTime.Now;
            topic.Updated = DateTime.Now;
            topic.IsDeleted = false;
            db.Topics.InsertOnSubmit(topic);
            db.SubmitChanges();

            topic.SortOrder = topic.Id;
            UpdateTopic(topic);

            //TODO : organizing it like events OnTopicCreated
            //add corresponding curriculum chapter topics.
            var curriculumChapters = GetCurriculumChaptersByChapterId(topic.ChapterRef);
            foreach (var curriculumChapter in curriculumChapters)
            {
                var curriculumChapterTopic = new CurriculumChapterTopic
                {
                    CurriculumChapterRef = curriculumChapter.Id,
                    TopicRef = topic.Id,
                    MaxScore = Constants.DefaultTopicMaxScore,
                    BlockTopicAtTesting = false,
                    BlockCurriculumAtTesting = false
                };
                AddCurriculumChapterTopic(curriculumChapterTopic);
            }

            _LmsService.Inform(DisciplineNotifications.TopicCreate, topic);

            return topic.Id;
        }
Esempio n. 23
0
        public int AddCurriculumChapter(CurriculumChapter curriculumChapter)
        {
            var db = GetDbContext();

            curriculumChapter.IsDeleted = false;

            db.CurriculumChapters.InsertOnSubmit(curriculumChapter);
            db.SubmitChanges();

            //add corresponding curriculum chapter topics
            var topics = GetTopicsByChapterId(curriculumChapter.ChapterRef);
            foreach (var topic in topics)
            {
                var curriculumChapterTopic = new CurriculumChapterTopic
                {
                    CurriculumChapterRef = curriculumChapter.Id,
                    TopicRef = topic.Id,
                    MaxScore = Constants.DefaultTopicMaxScore,
                    BlockTopicAtTesting = false,
                    BlockCurriculumAtTesting = false
                };
                AddCurriculumChapterTopic(curriculumChapterTopic);
            }

            return curriculumChapter.Id;
        }
Esempio n. 24
0
        public void SetUpFixture()
        {
            // defining mocks
            this.windsorContainerMock = new Mock<IWindsorContainer>();
            this.lmsServiceMock = new Mock<LmsService>(this.windsorContainerMock.Object);

            this.userServiceMock = new Mock<IUserService>();
            this.courseServiceMock = new Mock<ICourseService>();
            this.curriculumServiceMock = new Mock<ICurriculumService>();

            this.mlcProxyMock = new Mock<IMlcProxy>();

            this.trainingController = new TrainingController(this.mlcProxyMock.Object);

            PluginController.LmsService = this.lmsServiceMock.Object;

            // setuping mocks
            this.mlcProxyMock.Setup(
                proxy => proxy.GetAttemptId(It.IsAny<int>(), It.IsAny<int>(), It.IsAny<TopicTypeEnum>())).Returns(
                    DummyAttemptId);

            this.windsorContainerMock.Setup(container => container.Resolve<IUserService>()).Returns(
                this.userServiceMock.Object);
            this.windsorContainerMock.Setup(container => container.Resolve<ICourseService>()).Returns(
                this.courseServiceMock.Object);
            this.windsorContainerMock.Setup(container => container.Resolve<ICurriculumService>()).Returns(
                this.curriculumServiceMock.Object);

            this.dummyCurriculumChapterTopic = new CurriculumChapterTopic
                { Id = DummyCurriculumChapterTopicId, Topic = new Topic { Name = "C++ Testing" } };
            this.dummyCourse = new Course { Id = DummyCourseId };
            this.dummyUser = new User();
        }
Esempio n. 25
0
 public bool ContainsResult(User student, CurriculumChapterTopic curriculumChapterTopic)
 {
     return this.lastAttempts.Count(x => x.User.Id == student.Id & x.CurriculumChapterTopic.Id == curriculumChapterTopic.Id) > 0;
 }
Esempio n. 26
0
 partial void DeleteCurriculumChapterTopic(CurriculumChapterTopic instance);
Esempio n. 27
0
        public int AddCurriculumChapterTopic(CurriculumChapterTopic curriculumChapterTopic)
        {
            var db = GetDbContext();

            curriculumChapterTopic.IsDeleted = false;

            db.CurriculumChapterTopics.InsertOnSubmit(curriculumChapterTopic);
            db.SubmitChanges();
            return curriculumChapterTopic.Id;
        }
Esempio n. 28
0
 public static AttemptResult GetFakeAttempt(User user, CurriculumChapterTopic curriculumChapterTopic)
 {
     float? attemptScore;
     switch (user.Username)
     {
             //pmi-33
         case "Остап Андрусів(08i301)":
             attemptScore = (float?)0.06;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Назар Врублевський(08i302)":
             attemptScore = (float?)0.09;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Адмайкін Максим(08i303)":
             attemptScore = (float?)0.04;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Михайло Тис(08i304)":
             attemptScore = (float?)0.06;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Оля Іванків(08i305)":
             attemptScore = (float?)0.05;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Юрій Ожирко(08i306)":
             attemptScore = (float?)0.07;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Тарас Бехта(08i307)":
             attemptScore = (float?)0.05;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Василь Бодак(08i308)":
             attemptScore = (float?)0.09;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Василь Багряк(08i309)":
             attemptScore = (float?)0.07;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Максим Гула(08i310)":
             attemptScore = (float?)0.05;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Назар Качмарик(08i311)":
             attemptScore = (float?)0.06;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Мирослав Голуб(08i312)":
             attemptScore = (float?)0.07;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);                
         case "Павло Мартиник(08i313)":
             attemptScore = (float?)0.09;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "08i314 08i314(08i314)":
             attemptScore = (float?)0.06;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "08i315 Горячий(08i315)":
             attemptScore = (float?)0.07;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Данило Савчак(08i316)":
             attemptScore = (float?)0.04;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Ярослав Пиріг(08i317)":
             attemptScore = (float?)0.08;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Ірина Харів(08i318)":
             attemptScore = (float?)0.07;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Ярослав Мота(08i319)":
             attemptScore = (float?)0.07;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "08i320 Федорович(08i320)":
             attemptScore = (float?)0.07;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
             //pmi-32
         case "Олег Булатовський(08i201)":
             attemptScore = (float?)0.07;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Василь Ванівський(08i202)":
             attemptScore = (float?)0.08;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Boзняк Максим(08i203)":
             attemptScore = (float?)0.04;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Юра Гой(08i204)":
             attemptScore = (float?)0.06;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Остап Демків(08i205)":
             attemptScore = (float?)0.05;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Юра Дерев`янко(08i206)":
             attemptScore = (float?)0.07;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Роман Дроботiй(08i207)":
             attemptScore = (float?)0.04;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Дубик Петро(08i208)":
             attemptScore = (float?)0.09;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Віталій Засадний(08i209)":
             attemptScore = (float?)0.07;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "08i210 Андрусишин(08i210)":
             attemptScore = (float?)0.05;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Тарас Кміть(08i211)":
             attemptScore = (float?)0.05;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Роман Коваль(08i212)":
             attemptScore = (float?)0.06;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Маріана Кушла(08i213)":
             attemptScore = (float?)0.08;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Юрій Ладанівський(08i214)":
             attemptScore = (float?)0.07;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Leskiv Andriy(08i215)":
             attemptScore = (float?)0.06;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Юра Лучків(08i216)":
             attemptScore = (float?)0.04;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Mamchur Andriy(08i217)":
             attemptScore = (float?)0.06;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Христина Мандибур(08i218)":
             attemptScore = (float?)0.05;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Андрiй Протасов(08i219)":
             attemptScore = (float?)0.07;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "08i220 08i220(08i220)":
             attemptScore = (float?)0.07;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Стадник Роман(08i221)":
             attemptScore = (float?)0.07;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Андрій Столбовой(08i222)":
             attemptScore = (float?)0.05;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Ігор Сторянський(08i223)":
             attemptScore = (float?)0.05;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Фатич Михайло(08i224)":
             attemptScore = (float?)0.06;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         //pmi-31
         case "Роман Баїк(08i101)":
             attemptScore = (float?)0.08;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Катерина Бугай(08i102)":
             attemptScore = (float?)0.08;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Олексій Гелей(08i103)":
             attemptScore = (float?)0.07;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Карпунь Богдан(08i104)":
             attemptScore = (float?)0.09;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "08i105 08i105(08i105)":
             attemptScore = (float?)0.09;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Олександр Козачук(08i106)":
             attemptScore = (float?)0.07;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Аня Кітчак(08i107)":
             attemptScore = (float?)0.05;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Кравець Роман(08i108)":
             attemptScore = (float?)0.09;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Андрій Крупич(08i109)":
             attemptScore = (float?)0.08;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Літинський Ростислав(08i110)":
             attemptScore = (float?)0.09;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Христина Макар(08i111)":
             attemptScore = (float?)0.06;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Юрко Тимчук(08i112)":
             attemptScore = (float?)0.07;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Oleg Papirnyk(08i113)":
             attemptScore = (float?)0.09;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Віталій Нобіс(08i114)":
             attemptScore = (float?)0.08;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Taras Pelenyo(08i115)":
             attemptScore = (float?)0.07;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "08i116 08i116(08i116)":
             attemptScore = (float?)0.05;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Стадник Богдан(08i117)":
             attemptScore = (float?)0.08;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Andriy Pachva(08i118)":
             attemptScore = (float?)0.05;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Фай Роман(08i119)":
             attemptScore = (float?)0.08;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Мар'яна Хлєбик(08i120)":
             attemptScore = (float?)0.07;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "08i121 08i121(08i121)":
             attemptScore = (float?)0.07;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Руслан Івать(08i122)":
             attemptScore = (float?)0.07;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Андрій Сташко(08i123)":
             attemptScore = (float?)0.06;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "08i124 08i124(08i124)":
             attemptScore = (float?)0.07;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         case "Ігор Михалевич(08i125)":
             attemptScore = (float?)0.08;
             return new AttemptResult(1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, attemptScore);
         default:
             return new AttemptResult(-1, user, curriculumChapterTopic, TopicTypeEnum.Test, new CompletionStatus(), new AttemptStatus(), new SuccessStatus(), DateTime.Now, (float?)1.0);
     }
 }
Esempio n. 29
0
        public void UpdateCurriculumChapterTopic(CurriculumChapterTopic curriculumChapterTopic)
        {
            var db = GetDbContext();
            var oldTopicAssignment = GetCurriculumChapterTopic(db, curriculumChapterTopic.Id);

            oldTopicAssignment.MaxScore = curriculumChapterTopic.MaxScore;
            oldTopicAssignment.BlockCurriculumAtTesting = curriculumChapterTopic.BlockCurriculumAtTesting;
            oldTopicAssignment.BlockTopicAtTesting = curriculumChapterTopic.BlockTopicAtTesting;
            oldTopicAssignment.TheoryStartDate = curriculumChapterTopic.TheoryStartDate;
            oldTopicAssignment.TheoryEndDate = curriculumChapterTopic.TheoryEndDate;
            oldTopicAssignment.TestStartDate = curriculumChapterTopic.TestStartDate;
            oldTopicAssignment.TestEndDate = curriculumChapterTopic.TestEndDate;

            db.SubmitChanges();
        }
Esempio n. 30
0
 partial void UpdateCurriculumChapterTopic(CurriculumChapterTopic instance);