コード例 #1
0
        //public static bool RestoreAspSession(string clientId, string sessionId)
        //{
        //    //if (LMSSession.IsInSession(Client.CLIENT_SESSION_ID))
        //    //{
        //    //    return true;
        //    //}

        //    var sessionDam = new ContentModuleSessionDAM();
        //    var session = sessionDam.GetById(clientId, sessionId);
        //    if (session == null)
        //    {
        //        return false;
        //    }

        //    var mgrLearner = new LearnerManager();
        //    var currentUser = new Learner { ID = session.SystemUserGuid, ClientId = clientId };
        //    currentUser = mgrLearner.Execute(currentUser, Learner.Method.GetUser_CoursePlayer);

        //    var assignmentManager = new ActivityAssignmentManager();
        //    var assignment = new ActivityAssignment { ID = session.ContentModuleId, UserID = session.SystemUserGuid, ClientId = clientId };
        //    assignment = assignmentManager.Execute(assignment, ActivityAssignment.Method.CheckAssignment_CoursePlayer);

        //    PopulateSessionVariables(currentUser, session, assignment);

        //    if (assignment.ActivityType == ActivityContentType.Scorm12)
        //    {
        //        LMSSession.AddSessionItem(ContentKeys.SESSION_TOTAL_NO_PAGES, ManifestReader.GetTotalPages(clientId, assignment.ID));
        //    }

        //    return true;
        //}

        public static string CreateSession(string clientId, ContentModuleSession session)
        {
            var sessionDam = new ContentModuleSessionDAM();

            session = sessionDam.Save(clientId, session);

            return(session.SessionId);
        }
コード例 #2
0
        public ContentModuleSession GetByIdForCourseLaunch_backup_2015_01_13(string clientId, string sessionId)
        {
            ContentModuleSessionDAM contentModuleSessionDAM = new ContentModuleSessionDAM();
            var session = contentModuleSessionDAM.GetById(clientId, sessionId);

            session.Learner               = GetLearner(clientId, session);
            session.Assignment            = GetAssignment(clientId, session);
            session.ContentModule         = GetContentModule(session);
            session.ContentModuleTracking = GetTracking(clientId, session);
            return(session);
        }
コード例 #3
0
        public static void AddAttemptNumberToSession(string clientId, string sessionId, string attemptId)
        {
            if (LMSSession.IsInSession(ContentKeys.SESSION_ATTEMPT_ID))
            {
                return;
            }
            var idParts = attemptId.Split(new[] { '-' });

            if (idParts.Length > 2)
            {
                var sessionDam = new ContentModuleSessionDAM();
                sessionDam.AddAttemptNumber(clientId, sessionId, Convert.ToInt16(idParts[2]));
            }
        }
コード例 #4
0
        public ContentModuleSession GetByIdForCourseLaunch(string learnerId, string contentmoduleId)
        {
            ContentModuleSessionDAM contentModuleSessionDAM = new ContentModuleSessionDAM();
            var session = new ContentModuleSession();//contentModuleSessionDAM.GetById(learnerId, sessionId);

            //////////////////////Session
            session.ContentModuleId = contentmoduleId;
            session.SystemUserGuid  = learnerId;
            //////////////////////Learner
            session.Learner = GetLearnerHRS(session);
            //////session.Learner.FirstName = "B";
            //////session.Learner.LastName = "S";
            //////session.Learner.LearnerId = learnerId;

            session.Assignment = new ActivityAssignment(); //GetAssignment(clientId, session);

            ///////////////////////// ContentModule
            session.ContentModule = GetContentModule(session);
            //session.ContentModuleTracking = new ContentModuleTracking();//GetTracking(clientId, session);
            session.ContentModuleTracking = GetTrackingHRS(session);
            return(session);
        }
コード例 #5
0
        public ContentModuleSession Save(string clientId, ContentModuleSession session)
        {
            var contentModuleSessionDAM = new ContentModuleSessionDAM();

            return(contentModuleSessionDAM.Save(clientId, session));
        }