Пример #1
0
        //public ActivityAssignmentExt IsAlreadyCourseLaunchedMgr(string clientId,  string tokenKey)
        //{
        //    ActivityAssignmentExt oActivityAssignmentExt = new ActivityAssignmentExt();
        //    oActivityAssignmentExt = _courseAssignmentRepository.IsAlreadyCourseLaunched(clientId, tokenKey);

        //    return oActivityAssignmentExt;
        //}

        private ActivityAssignment AddAdminAssignment(string clientId, string courseId, string learnerId)
        {
            var entContentModule = _contentModuleRetriever.GetMetaData(clientId, courseId);
            var assignment       = new ActivityAssignment
            {
                ID                    = courseId,
                UserID                = learnerId,
                ClientId              = clientId,
                CreatedById           = learnerId,
                DateCreated           = DateTime.UtcNow,
                ActivityTypeId        = entContentModule.ContentModuleTypeId,
                ActivityName          = entContentModule.ContentModuleEnglishName,
                IsAdminAssignment     = true,
                IsForAdminPreview     = true,
                CompletionConditionId = ActivityCompletionCondition.Mandatory,
                LastModifiedById      = learnerId
            };

            assignment.ActivityType = (ActivityContentType)Enum.Parse(typeof(ActivityContentType), assignment.ActivityTypeId);

            assignment              = _courseAssignmentRepository.AddActivityAssignment(assignment);
            assignment.ClientId     = clientId;
            assignment.ActivityName = entContentModule.ContentModuleEnglishName;

            return(assignment);
        }
Пример #2
0
        private ActivityAssignment GetAssignment(string clientId, ContentModuleSession session)
        {
            var assignment = new ActivityAssignment {
                ID = session.ContentModuleId, UserID = session.SystemUserGuid, ClientId = clientId
            };

            //return new ActivityAssignmentManager().Execute(assignment, ActivityAssignment.Method.CheckAssignment_CoursePlayer);
            return(assignment);
        }