/// <summary> /// Load Item from query string /// </summary> private void LoadItem() { _sItemID = "" + Request.QueryString["xID"]; _sQuestionType = "" + Request.QueryString["qType"]; ItemID = Cryptography.GetDecryptedID(SessionObject.LoggedInUser.CipherKey); _iAssessmentID = Cryptography.GetDecryptedID(SessionObject.LoggedInUser.CipherKey, "AssessmentID"); lbl_TestCategory.Value = Request.QueryString["TestCategory"]; lbl_TestType.Value = Request.QueryString["TestType"]; if (_sItemID == null) { SessionObject.RedirectMessage = "No entity ID provided in URL."; Response.Redirect("~/PortalSelection.aspx", true); } else { if (_sQuestionType.Equals("TestQuestion")) { // Remove the copy item button if we are coming from the item editor. btnCopyItem.Visible = false; if (ItemID == 0 && _iAssessmentID > 0 && !String.IsNullOrEmpty(_sItemID)) { _itemTestQuestion = TestQuestion.GetTestQuestionByID(DataIntegrity.ConvertToInt(_sItemID), false); ItemID = _itemTestQuestion.ID; if (_itemTestQuestion.TestID != _iAssessmentID) { SessionObject.RedirectMessage = "Invalid entity ID provided in URL."; Response.Redirect("~/PortalSelection.aspx", true); } } else { _itemTestQuestion = TestQuestion.GetTestQuestionByID(ItemID, false); } UseTq = true; } else { _itemBankQuestion = BankQuestion.GetQuestionByID(ItemID); _itemBankQuestion.LoadAddendum(); UseTq = false; } LoadAddendums(); LoadStandards(); LoadItemText(); _itemReservation = "No"; if (UserHasPermission(Permission.Access_ItemReservation)) _itemReservation = "Yes"; else reservationDropDown.Enabled = false; string qType = UseTq ? "TestQuestion" : ""; ScriptManager.RegisterStartupScript(this, typeof(string), "SetQType", "setQuestionType('"+qType+"');", true); } if (Request.QueryString["isCopy"] == "true") ScriptManager.RegisterStartupScript(this, typeof(string), "AlertForCopiedItem", "AlertForCopiedItem();", true); }
private void LoadItem() { _sItemID = "" + Request.QueryString["xID"]; _sQuestionType = "" + Request.QueryString["qType"]; _iItemID = Cryptography.GetDecryptedID(SessionObject.LoggedInUser.CipherKey); _iAssessmentID = Cryptography.GetDecryptedID(SessionObject.LoggedInUser.CipherKey, "AssessmentID"); lbl_TestCategory.Value = Request.QueryString["TestCategory"]; if (_sItemID == null) { SessionObject.RedirectMessage = "No entity ID provided in URL."; Response.Redirect("~/PortalSelection.aspx", true); } else { if (_sQuestionType.Equals("TestQuestion")) { // Remove the copy item button if we are coming from the item editor. if (_iItemID == 0 && _iAssessmentID > 0 && !String.IsNullOrEmpty(_sItemID)) { _itemTestQuestion = TestQuestion.GetTestQuestionByID(DataIntegrity.ConvertToInt(_sItemID), false); _iItemID = _itemTestQuestion.ID; if (_itemTestQuestion.TestID != _iAssessmentID) { SessionObject.RedirectMessage = "Invalid entity ID provided in URL."; Response.Redirect("~/PortalSelection.aspx", true); } } else { _itemTestQuestion = TestQuestion.GetTestQuestionByID(_iItemID, false); } useTestQuestion = true; //_itemTestQuestion.LoadItemAndScoreTypes(); //_itemTestQuestion.LoadRubric(); } else { _itemBankQUestion = BankQuestion.GetQuestionByID(_iItemID); _itemBankQUestion.LoadAddendum(); useTestQuestion = false; } LoadStandards(); LoadItemText(); } }