protected void generateButton_Click(object sender, EventArgs e)
        {
            if (hdnCallBackPage.Value == "rigor")
            {
                SessionObject.Standards_RigorLevels_ItemCounts = rigorLevels;
                Session.Remove("ItemRigorSummary");
            }
            else if (hdnCallBackPage.Value == "addendum")
            {
                SessionObject.Standards_Addendumevels_ItemCounts = addendumLevels;
                Session.Remove("AddendumSummary");
            }

            AssessmentWCF obj = new AssessmentWCF();
            string newAssessmentID = obj.RequestNewAssessmentID(new AssessmentWCFVariables());
            Thinkgate.Base.Classes.Grade gradeOrdinal = new Thinkgate.Base.Classes.Grade(grade);
            newAssessmentTitle.Value = "Term " + term + " " + type + " - " + gradeOrdinal.GetFriendlyName() + " Grade " + subject + " " + courseName;

            ScriptManager.RegisterStartupScript(this, typeof(string), "createAssessment", "goToNewAssessment('" + newAssessmentID + "');", true);
        }
        protected void updateButton_Click(object sender, EventArgs e)
        {
            string rigorSelection = hdnRigorSelection.Value;
            System.Web.Script.Serialization.JavaScriptSerializer jSerializer =
               new System.Web.Script.Serialization.JavaScriptSerializer();
            AssessmentWCFVariables assessmentWCFVariable = jSerializer.Deserialize<AssessmentWCFVariables>(rigorSelection);
            if (lstAssessmentWCFVariables != null)
            {
                lstAssessmentWCFVariables =
                    lstAssessmentWCFVariables.Where(
                        x => x.StandardID != assessmentWCFVariable.StandardID).ToList();
                lstAssessmentWCFVariables.Add(assessmentWCFVariable);
            }

            #region CODE BLOCK-Update session values
            Thinkgate.Classes.SessionObject SessionObject = (Thinkgate.Classes.SessionObject)System.Web.HttpContext.Current.Session["SessionObject"];
            foreach (AssessmentWCFVariables assessmentVars in lstAssessmentWCFVariables)
            {

                int itemCount = 0;

                //Set the StandardItemTotals value to 0 for the selected standard
                SessionObject.Standards_RigorLevels_ItemCounts.ClearStandardItemTotal(assessmentVars.StandardID);

                //Loop through all rigor levels and add item counts to the Standards_RigorLevels_ItemCounts dictionary
                if (assessmentVars.RigorLevels != null)
                {
                    for (int i = 0; i < assessmentVars.RigorLevels.Count; i++)
                    {
                        string rigorLevelName = assessmentVars.RigorLevels[i].ToString();
                        int multipleChoice3Count = DataIntegrity.ConvertToInt(assessmentVars.MultipleChoice3Counts[i]);
                        int multipleChoice4Count = DataIntegrity.ConvertToInt(assessmentVars.MultipleChoice4Counts[i]);
                        int multipleChoice5Count = DataIntegrity.ConvertToInt(assessmentVars.MultipleChoice5Counts[i]);
                        int shortAnswerCount = DataIntegrity.ConvertToInt(assessmentVars.ShortAnswerCounts[i]);
                        int essayCount = DataIntegrity.ConvertToInt(assessmentVars.EssayCounts[i]);
                        int trueFalseCount = DataIntegrity.ConvertToInt(assessmentVars.TrueFalseCounts[i]);
                        int blueprintCount = DataIntegrity.ConvertToInt(assessmentVars.BlueprintCounts[i]);

                        SessionObject.Standards_RigorLevels_ItemCounts.RemoveLevel(assessmentVars.StandardID, rigorLevelName);

                        if (multipleChoice3Count > 0 || multipleChoice4Count > 0 || multipleChoice5Count > 0 || shortAnswerCount > 0 || essayCount > 0 || trueFalseCount > 0 || blueprintCount > 0)
                        {
                            itemCount += multipleChoice3Count + multipleChoice4Count + multipleChoice5Count + shortAnswerCount + essayCount + trueFalseCount + blueprintCount;
                            SessionObject.Standards_RigorLevels_ItemCounts.AddLevel(assessmentVars.StandardID, rigorLevelName, multipleChoice3Count, multipleChoice4Count, multipleChoice5Count, shortAnswerCount, essayCount, trueFalseCount, blueprintCount);
                        }
                    }
                }

                //Store total item count for standard
                SessionObject.Standards_RigorLevels_ItemCounts.AddStandardItemTotal(assessmentVars.StandardID, assessmentVars.StandardSet, assessmentVars.TotalItemCount);
            }

            #endregion

            AssessmentWCF obj = new AssessmentWCF();
            string newAssessmentID = obj.RequestNewAssessmentID(new AssessmentWCFVariables());
            Thinkgate.Base.Classes.Grade gradeOrdinal = new Thinkgate.Base.Classes.Grade(grade);
            newAssessmentTitle.Value = "Term " + term + " " + type + " - " + gradeOrdinal.GetFriendlyName() + " Grade " + subject + " " + courseName;

            ScriptManager.RegisterStartupScript(this, typeof(string), "createAssessment", "goToNewAssessment('" + newAssessmentID + "');", true);
        }
        protected void generateButton_Click(object sender, EventArgs e)
        {
            string rigorSelection = hdnAddendumSelection.Value;
            System.Web.Script.Serialization.JavaScriptSerializer jSerializer =
               new System.Web.Script.Serialization.JavaScriptSerializer();
            StandardAddendumList assessmentVars = jSerializer.Deserialize<StandardAddendumList>(rigorSelection);         

            #region CODE BLOCK-Update session values            
            Thinkgate.Classes.SessionObject SessionObject = (Thinkgate.Classes.SessionObject)System.Web.HttpContext.Current.Session["SessionObject"];
            foreach (StandardAddendum item in assessmentVars.AddendumLevels)
            {
             
                SessionObject.Standards_Addendumevels_ItemCounts.ClearStandardItemTotal(item.StandardID);                

                SessionObject.Standards_Addendumevels_ItemCounts.RemoveLevel(item.StandardID, item.AddendumID);
                if (item.ItemCount > 0)
                {
                    SessionObject.Standards_Addendumevels_ItemCounts.AddLevel(item.StandardID, item.AddendumID, item.ItemCount);
                }
            }

            //Store total item count for standard
            SessionObject.Standards_Addendumevels_ItemCounts.AddStandardItemTotal(assessmentVars.StandardCounts);           
            

            AssessmentWCF obj = new AssessmentWCF();
            string newAssessmentID = obj.RequestNewAssessmentID(new AssessmentWCFVariables());
            Thinkgate.Base.Classes.Grade gradeOrdinal = new Thinkgate.Base.Classes.Grade(grade);

            string isSecure = string.Empty;
            if (!string.IsNullOrEmpty(Request.QueryString["isSecure"]))
            {
                isSecure = Convert.ToString(Request.QueryString["isSecure"]);
            }
            string title = "Term ";
            //if (isSecure == "true")
            //{
            //    title = "[SECURE]Term ";
            //}
            newAssessmentTitle.Value = title + term + " " + type + " - " + gradeOrdinal.GetFriendlyName() + " Grade " + subject + " " + courseName;

            ScriptManager.RegisterStartupScript(this, typeof(string), "createAssessment", "goToNewAssessment('" + newAssessmentID + "');", true);
            #endregion
        }