private void LoadAssessment() { if (Request.QueryString["xID"] == null || (_assessmentID = GetDecryptedEntityId(X_ID)) <= 0) { SessionObject.RedirectMessage = "No assessment ID provided in URL."; Response.Redirect("~/PortalSelection.aspx", true); } else if (Request.QueryString["yID"] == null || (_teacherID = Cryptography.GetDecryptedID(SessionObject.LoggedInUser.CipherKey, "yID")) <= 0) { SessionObject.RedirectMessage = "No teacher ID provided in URL."; Response.Redirect("~/PortalSelection.aspx", true); } else { cacheKey = "Assessment_" + Request.QueryString["xID"]; if(!RecordExistsInCache(cacheKey)) { _assessment = Base.Classes.Assessment.GetAssessmentAndQuestionsByID(_assessmentID); if(_assessment != null) Thinkgate.Base.Classes.Cache.Insert(cacheKey, _assessment); else { SessionObject.RedirectMessage = "Could not find the assessment."; Response.Redirect("~/PortalSelection.aspx", true); } } else _assessment = (Base.Classes.Assessment)Cache[cacheKey]; } }
protected void Page_Load(object sender, EventArgs e) { if (Tile == null) return; _assessmentID = (Int32)Tile.TileParms.GetParm("assessmentID"); _assessment = (Thinkgate.Base.Classes.Assessment)Tile.TileParms.GetParm("assessment"); _userID = SessionObject.LoggedInUser.Page; _ds = ThinkgateDataAccess.FetchDataSet("E3_Assessment_GetByID", new object[] { _assessmentID, _userID }); _ds.Tables[0].TableName = "Summary"; _ds.Tables[1].TableName = "StandardQuestionCounts"; _ds.Tables[2].TableName = "RigorCounts"; DataTable summaryTbl = _ds.Tables["Summary"]; DataTable standardQuestionCountsTbl = _ds.Tables["StandardQuestionCounts"]; DataTable rigorCountsTbl = _ds.Tables["RigorCounts"]; Int32 totalRigorLevelCount = 0; Int32 totalRigorCount = 0; foreach(DataRow row in rigorCountsTbl.Rows) { if (String.Compare("Blank", row["Text"].ToString(), true) != 0 && (Int32)row["ItemCount"] > 0 && String.Compare("Not Specified", row["Text"].ToString(), true) != 0) { totalRigorLevelCount++; totalRigorCount += DataIntegrity.ConvertToInt(row["ItemCount"]); } } LoadSummaryView(summaryTbl, standardQuestionCountsTbl, totalRigorLevelCount, _assessment); LoadStandardView(standardQuestionCountsTbl); LoadRigorView(rigorCountsTbl, totalRigorCount); }