private void SaveSuspendData(XmlDocument requestXml) { string strContentModuleId = string.Empty; string strAttempId = string.Empty; string strSystemUserGUID = string.Empty; string strClientId = string.Empty; if (LMSSession.IsInSession(ContentKeys.SESSION_ACTIVITYID)) { strContentModuleId = Convert.ToString(LMSSession.GetValue(ContentKeys.SESSION_ACTIVITYID)); } if (LMSSession.IsInSession(ContentKeys.SESSION_ATTEMPT_ID)) { strAttempId = Convert.ToString(LMSSession.GetValue(ContentKeys.SESSION_ATTEMPT_ID)); } if (LMSSession.IsInSession(ContentKeys.SESSION_LEARNER_ID)) { strSystemUserGUID = Convert.ToString(LMSSession.GetValue(ContentKeys.SESSION_LEARNER_ID)); } if (LMSSession.IsInSession("CLIENT_SESSION_ID")) { strClientId = Convert.ToString(LMSSession.GetValue("CLIENT_SESSION_ID")); } if (string.IsNullOrEmpty(strClientId) && !string.IsNullOrEmpty(hdnClientId.Value)) { strClientId = EncryptionManager.Decrypt(hdnClientId.Value); } if (string.IsNullOrEmpty(strClientId) && !string.IsNullOrEmpty(hdnContentModuleId.Value)) { strContentModuleId = EncryptionManager.Decrypt(hdnContentModuleId.Value); } if (string.IsNullOrEmpty(strClientId) && !string.IsNullOrEmpty(hdnUserId.Value)) { strSystemUserGUID = EncryptionManager.Decrypt(hdnUserId.Value); } if (string.IsNullOrEmpty(strContentModuleId) || string.IsNullOrEmpty(strSystemUserGUID) || string.IsNullOrEmpty(strClientId)) { RedirectToMainPage(); } else { //var activityAssignment = CoursePlayerAssignmentManager.GetAssignmentForLaunch(strClientId, strContentModuleId, strSystemUserGUID, LaunchSite.Learner); //if (activityAssignment.ActivityStatus != ActivityCompletionStatus.Completed) //{ //List<UserAssessmentQuestionTracking> lstQTrack = BusinessManager.UserDataXMLUtil.GetSuspendData(requestXml, strContentModuleId, strAttempId, strSystemUserGUID, strClientId); //#region SaveTracking //if (lstQTrack != null && lstQTrack.Count > 0) //{ // try // { // UserAssessmentQuestionTrackingManager objAssessmentQTrackMgr = new UserAssessmentQuestionTrackingManager(); // List<UserAssessmentQuestionTracking> lstRetAssessmentQTrack = new List<UserAssessmentQuestionTracking>(); // lstRetAssessmentQTrack = objAssessmentQTrackMgr.Execute(lstQTrack, UserAssessmentQuestionTracking.ListMethod.BulkAdd); // } // catch // { // } //} //#endregion //} } }
private void ProcessRequest(XmlDocument RequestXMLObj, string useCase) { switch (useCase) { case "SaveCurrentSco": try { string strContentModuleId = string.Empty; string strLearnerId = string.Empty; ////string strClientId = string.Empty; if (LMSSession.IsInSession(ContentKeys.SESSION_ACTIVITYID)) { strContentModuleId = Convert.ToString(LMSSession.GetValue(ContentKeys.SESSION_ACTIVITYID)); } if (LMSSession.IsInSession(ContentKeys.SESSION_LEARNER_ID)) { strLearnerId = Convert.ToString(LMSSession.GetValue(ContentKeys.SESSION_LEARNER_ID)); } ////if (LMSSession.IsInSession(Client.CLIENT_SESSION_ID)) //// strClientId = Convert.ToString(LMSSession.GetValue(Client.CLIENT_SESSION_ID)); ////if (string.IsNullOrEmpty(strClientId) && !string.IsNullOrEmpty(hdnClientId.Value)) ////{ //// strClientId = EncryptionManager.Decrypt(hdnClientId.Value); ////} if (!string.IsNullOrEmpty(hdnContentModuleId.Value)) { strContentModuleId = EncryptionManager.Decrypt(hdnContentModuleId.Value); } if (!String.IsNullOrEmpty(strContentModuleId)) { bool flag = false; if (hdnContentModuleIdIsA.Value == String.Empty) { ContentModuleManager _CMManager = new ContentModuleManager(); ContentModule entContentModule = new ContentModule(); entContentModule.ID = strContentModuleId; ////entContentModule.ClientId = strClientId; entContentModule = _CMManager.Execute(entContentModule, ContentModule.Method.GetByIDCoursePlayer); flag = entContentModule.IsAssessment; hdnContentModuleIdIsA.Value = entContentModule.IsAssessment.ToString(); } else { flag = Convert.ToBoolean(hdnContentModuleIdIsA.Value); } if (flag) { SaveSuspendData(RequestXMLObj); } } else { RedirectToMainPage(); } } catch (Exception ex) { } SaveCurrentSco(RequestXMLObj); ////string xmlFromPost = Request["TARecords"]; break; } }