private void Initialize(int aoid) { try { Assessment ass = new Assessment(); ass = ass.GetAssessmentByOID(aoid); foreach (Section s in ass.SectionList) { foreach (Question q in s.QuestionList) { if (q.RespAction == "Radio Button") { ;//For Radion Button } else if (q.RespAction == "Drop Down") { ;//For DropDown } } } } catch (Exception ex) { } }
private void Initialize(int aid,string reg) { try { //aid Assessment ass = new Assessment(); ass=ass.GetAssessmentByOID(aid); if (ass.AssessmentName != null&® =="") { FormsAuthentication.SetAuthCookie("Student", false); Response.Redirect("~/pg/answer/home.aspx?aid=" + aid,true); } else if (ass.AssessmentName != null && reg == "yes"&&Request.QueryString["id"] != null) { FormsAuthentication.SetAuthCookie("Student", false); string url="~/pg/answer/home.aspx?aid=" + aid+"®=yes&id="+Request.QueryString["id"]; Response.Redirect(url, true); } else { Response.Write("Your link is not correct"); } } catch (Exception ex) { } }
public void UpdateIntervention(int aid, int rlst) { try { Assessment ass = new Assessment(); ass = ass.GetAssessmentByOID(aid); ResultLetterDetail letterDetail = null; ResultLetter resultLetter = new ResultLetter(); resultLetter = resultLetter.GetResultLetterByAOID(aid); Collection<Student> studentList = new Student().GetAllStudentByResultLetterSentTimes(rlst); StringBuilder sb = new StringBuilder(); string dateStr = System.DateTime.Today.ToString(); foreach (Student student in studentList) { sb.Append("<table cellpadding='0px' cellspacing='0px' style='width:100%; page-break-after: always; margin:0px 20px 0px 20px'>"); sb.Append("<tr>"); sb.Append("<td> " + dateStr + "</td>"); sb.Append("</tr>"); sb.Append("<tr>"); sb.Append("<td> " + student.FullName + "</td>"); sb.Append("</tr>"); sb.Append("<tr>"); sb.Append("<td> " + student.AddressOne + "</td>"); sb.Append("</tr>"); sb.Append("<tr>"); sb.Append("<td> " + student.AddressTwo + "</td>"); sb.Append("</tr>"); sb.Append("<tr>"); sb.Append("<td> " + student.AddressThree + "</td>"); sb.Append("</tr>"); sb.Append("<tr>"); sb.Append("<td align='right'> Student ID: " + student.StudentID + "</td>"); sb.Append("</tr>"); sb.Append("<tr>"); sb.Append("<td> Dear " + student.FirstName + ":</td>"); sb.Append("</tr>"); if (resultLetter != null) { sb.Append("<tr>"); sb.Append("<td>" + resultLetter.Header + "</td>"); sb.Append("</tr>"); } sb.Append("<tr>"); sb.Append("<td>"); sb.Append("<table cellpadding='0px' cellspacing='0px' style='width:100%;'>"); sb.Append("<tr>"); sb.Append("<td style='background-color:Gray; width:30%; border: thin solid #000000;'>CATEGORY</td>"); sb.Append("<td style='background-color:Gray; width:70%; border: thin solid #000000;'>DEFINITION</td>"); sb.Append("</tr>"); //Collection<StudentRank> studentRankList_ = new StudentRank().GetStudentRankBySOIDandAOID(student.StudentOID, ass.AssessmentOID); foreach (Section s in ass.SectionList) { string definition = "", starValue = ""; if (resultLetter != null) { if (resultLetter.LetterDetail != null) { var tmp = from detail in resultLetter.LetterDetail where detail.SectionOID == s.SectionOID select detail; letterDetail = tmp != null ? tmp.First() : null; } } sb.Append("<tr>"); //foreach (StudentRank SR in studentRankList) //{ // if (SR.SectionOID == s.SectionOID) // { // if (SR.Rank < s.Flag) // { // starValue = " *"; // break; // } // else // { starValue = ""; } // } //} sb.Append("<td style='width:30%; border: thin solid #000000'>" + s.SectionName + starValue + "</td>"); definition = (letterDetail != null) ? letterDetail.SectionDefinition : ""; sb.Append("<td style='width:70%; border: thin solid #000000'>" + definition + "</td>"); sb.Append("</tr>"); } sb.Append("</table>"); if (resultLetter != null) { sb.Append("<tr>"); sb.Append("<td>" + resultLetter.ShowAboveResult + "</td>"); sb.Append("</tr>"); } sb.Append("</td>"); sb.Append("</tr>"); sb.Append("</table>"); } //print_div1.InnerHtml = sb.ToString(); Response.Write(sb.ToString()); return; } catch (Exception ex) { } }
public void PrintIntervention(int aid, int rlst,string riskName) { try { Assessment ass = new Assessment(); ass = ass.GetAssessmentByOID(aid); ResultLetterDetail letterDetail = null; ResultLetter resultLetter = new ResultLetter(); resultLetter = resultLetter.GetResultLetterByAOID(aid); Collection<Answer> answers = new Answer().GetAnswerByAOIDAndRLST_ForPrintResultLetter(aid, rlst); //Collection<Student> studentList = new Student().GetAllStudentByResultLetterSentTimes(rlst); Collection<Student> studentList = new Collection<Student>();// new Student().GetAllStudentByResultLetterSentTimes(rlst); foreach (Answer answer in answers) { //Student student = new Student(); Student student = new Student().GetStudentByStudentOID(answer.BannerID.ToString()); RiskCalculation riskCalculation = new RiskCalculation(); if (student != null) { riskCalculation = riskCalculation.GetRiskCalculationByAOIDAndSOIDAndRiskName(aid, student.StudentOID,riskName); } // if (student.StudentOID == 0) break ; bool isContain = false; foreach (Student std in studentList) { if (student.StudentOID == std.StudentOID) { isContain = true; } } if (!isContain && riskCalculation != null && student != null) //if (!isContain && riskCalculation != null) { answer.UpdateAnswer_ForNumberofPrinted(aid, rlst, Convert.ToInt32(student.StudentOID)); answer.UpdateScoreDetailsTable_ForNumberofPrinted(aid, rlst, Convert.ToInt32(student.StudentOID)); studentList.Add(student); } } // bool updateStatus = new Student().UpdateAllStudentByResultLetterSentTimes(rlst); List<ScoreDetailTable> scoreDetailTableList = new ScoreDetailTable().GetScoreDetailTableByAOID(ass.AssessmentOID); //List<ScoreDetailTable> scoreDetailTableList = new List<ScoreDetailTable>(); StringBuilder sb = new StringBuilder(); string dateStr = System.DateTime.Today.ToLongDateString(); foreach (Student student in studentList) { //sb.Append("<table cellpadding='0' cellspacing='0' style='page-break-after:always; width:90%; margin:0px 0px 0px 0px;' >"); #region Header sb.Append("<table cellpadding='0' cellspacing='0' style='width:100%; margin:10px 10px 5px 10px;font-size:12px; page-break-after:always; height:100%'>"); sb.Append("<tr>"); sb.Append("<td> " + dateStr + "</td>"); sb.Append("</tr>"); sb.Append("<tr>"); sb.Append("<td> <br/>" + student.FullName + "</td>"); sb.Append("</tr>"); sb.Append("<tr>"); sb.Append("<td> " + student.AddressOne + "</td>"); sb.Append("</tr>"); sb.Append("<tr>"); sb.Append("<td> "); sb.Append("<table cellpadding='0' cellspacing='0' style='width:100%;'>"); sb.Append("<tr>"); sb.Append("<td align='left' style='font-size:12px'>"); if (!string.IsNullOrEmpty(student.City)) { sb.Append(student.City); } if (!string.IsNullOrEmpty(student.State)) { sb.Append(", " + student.State); } if (!string.IsNullOrEmpty(student.ZIPCode)) { sb.Append(", " + student.ZIPCode); } sb.Append("</td> "); sb.Append("<td align='right'> Student ID: " + student.StudentID + "</td>"); sb.Append("<tr>"); sb.Append("</table>"); sb.Append("</td>"); sb.Append("</tr>"); #endregion #region StudentName string studentFirstName = student.FullName; if (!string.IsNullOrEmpty(studentFirstName)) { try { if (studentFirstName.Contains(',')) { studentFirstName = studentFirstName.Split(',')[1]; } } catch { } } #endregion sb.Append("<tr>"); sb.Append("<td><br/>Dear " + studentFirstName + ":</td>"); sb.Append("</tr>"); // sb.Append("</br><div id='Header' style='height:150px;position: relative;vertical-align:top;border:1px solid red'>"); if (resultLetter != null) { sb.Append("<tr>"); sb.Append("<td style='font-size:12px;border:1px''>" + resultLetter.Header + "</td>"); sb.Append("</tr>"); } // sb.Append("</div>"); sb.Append("<tr>"); sb.Append("<td><br/>"); sb.Append("<table cellpadding='0' cellspacing='0' style='width:98%;'>"); sb.Append("<tr>"); sb.Append("<td style='background:#d7d7d7; width:29%; border: thin solid #999; padding:8px;font-family:Calibri;font-size:10px;'><b>CATEGORY</b></td>"); sb.Append("<td style='background:#d7d7d7; width:69%; border: thin solid #999; padding:8px;font-family:Calibri;font-size:10px;'><b>DEFINITION</b></td>"); sb.Append("</tr>"); //Collection<StudentRank> studentRankList_ = new StudentRank().GetStudentRankBySOIDandAOID(student.StudentOID, ass.AssessmentOID); #region SectionList foreach (Section s in ass.SectionList) { if (s.SectionName == "NoScore") continue; string definition = "", starValue = ""; if (resultLetter != null) { if (resultLetter.LetterDetail != null) { var tmp = from detail in resultLetter.LetterDetail where detail.SectionOID == s.SectionOID select detail; letterDetail = tmp != null ? tmp.First() : null; } } #endregion sb.Append("<tr>"); #region unused //foreach (StudentRank SR in studentRankList) //{ // if (SR.SectionOID == s.SectionOID) // { // if (SR.Rank < s.Flag) // { // starValue = " *"; // break; // } // else // { starValue = ""; } // } //} //scoreDetailTableList #endregion #region Star foreach (ScoreDetailTable SR in scoreDetailTableList) { if ((SR.StudentOID == student.StudentOID) && (SR.SectionOID == s.SectionOID)) { //if ((SR.Score*s.TotalQuestion) < s.Flag) if ((SR.Rank) < s.Flag) { starValue = " *"; break; } else { starValue = ""; break; } } } #endregion sb.Append("<td style='width:29%; border: thin solid #999; padding:8px;font-family:Calibri;font-size:10px;'><b>" + s.SectionName + starValue + "</b></td>"); definition = (letterDetail != null) ? letterDetail.SectionDefinition : ""; sb.Append("<td style='width:69%; border: thin solid #999; padding:8px; text-align:left; font-family:Calibri;font-size:10px;'>" + definition + "</td>"); } sb.Append("</table>"); //sb.Append("<div id='Footer' style='height:150px;position: relative;vertical-align:top;border:1px solid red'>"); if (resultLetter != null) { sb.Append("<tr>"); sb.Append("<td style='valign:top;font-size:12px;border:1px''><br/>" + resultLetter.ShowAboveResult + "</td>"); sb.Append("</tr>"); } //sb.Append("</div>"); sb.Append("</td>"); sb.Append("</tr>"); sb.Append("</table>"); sb.Append("</table>"); } ////print_div1.InnerHtml = sb.ToString(); Response.Write(sb.ToString()); return; } catch (Exception ex) { } }
protected void ButtonSubmit_Click(object sender, EventArgs e) { try { User user = (User)Session["CurrentUser"]; if (user == null) return; int aid = (ViewState["AssessmentOID"] != null) ? (Convert.ToInt32(ViewState["AssessmentOID"])) : 0; Assessment ass = new Assessment(); ass = ass.GetAssessmentByOID(aid); ReminderEmail reminderEmail = new ReminderEmail(); //reminderEmail.EmailBody = TextBoxEMail.Text; //reminderEmail.EmailBody = Server.HtmlEncode(TextBoxEMail.Text); reminderEmail.EmailBody = EMailBodyHtml; reminderEmail.AssessmentOID = aid; reminderEmail.CreatedBy = user.UserOID; reminderEmail.LastModifiedBy = user.UserOID; //Result Detail ReminderEmail rEmail = reminderEmail.GetReminderEmailByAOID(aid); bool status = false; if (rEmail == null) { status = reminderEmail.AddReminderEmail(); } else { reminderEmail.AssessmentReminderOID = rEmail.AssessmentReminderOID; status = reminderEmail.UpdateReminderEmail(); } if (status) { LabelMessage.Text = "Saved Successfully."; this.ShowEmailBody(aid); } else { LabelMessage.Text = "Not Saved."; } } catch (Exception ex) { LabelMessage.Text = "Not Saved."; } }
protected void ButtonSendEMails_Click(object sender, EventArgs e) { bool status = false; for (int i = 0; i < CheckBoxListTermCode.Items.Count; i++) { if (CheckBoxListTermCode.Items[i].Selected) { status = true; } } if (!status) { LabelStatus.Text = "Please select term code first."; return; } int aid = (ViewState["AssessmentOID"] != null) ? (Convert.ToInt32(ViewState["AssessmentOID"])) : 0; if (aid == 0) { LabelStatus.Text = "Assessment ID is null."; return; } Assessment ass = new Assessment(); ass = ass.GetAssessmentByOID(aid); List<string> mailAddressList = new List<string>(); int counterTotal = 0, counterSuccess = 0; bool mailsendStatus = false; for (int i = 0; i < CheckBoxListTermCode.Items.Count; i++) { if (CheckBoxListTermCode.Items[i].Selected) { string termCode = CheckBoxListTermCode.Items[i].Value; Collection<Student> studentList = new Student().GetAllStudentByTermCodeofProgramEnrollment(termCode); foreach (Student student in studentList) { string mailAddress = Convert.ToString(student.EmailAddress); if (!mailAddressList.Contains(mailAddress)) { mailAddressList.Add(mailAddress); //if(CheckMailFormat(mailAddress)) //{ counterTotal++; string toEmail = null; if (ConfigurationManager.AppSettings["productionMode"].ToString() == "OFF") { toEmail = ConfigurationManager.AppSettings["toEmail"].ToString(); } else if (ConfigurationManager.AppSettings["productionMode"].ToString() == "ON") { toEmail = mailAddress; } mailsendStatus = this.SendMail(toEmail, "Reminder for " + ass.AssessmentName, EMailBodyHtml); //mailsendStatus = this.SendMail("*****@*****.**", "Reminder for " + ass.AssessmentName, EMailBodyHtml); if (mailsendStatus) { counterSuccess++; } //} } } } mailAddressList.Clear(); } ShowEmailBody(aid); LabelStatus.Text = "Mail sent success " + counterSuccess.ToString() + " of " + counterTotal.ToString() + "."; }
private void Initialize(int aid) { try { StringBuilder html = new StringBuilder(); StudentAnswer stdAns = new StudentAnswer(); Assessment ass = new Assessment(); Collection<StudentAnswer> stdAnsList=stdAns.GetStudentAnswerByAOID(aid); ass=ass.GetAssessmentByOID(aid); html.Append("<table border='0' cellspacing='0' cellpadding='0'><tr> <td bgcolor='#000000'>"); html.Append("<table bgcolor='#000000' cellspacing='1' cellpadding='0' >"); html.Append("<tr>"); html.Append("<td bgcolor='#FFFFFF'> </td><td bgcolor='#FFFFFF'> </td>"); foreach (Section s in ass.SectionList) { html.Append("<td bgcolor='#FFFFFF'>"); html.Append(s.SectionName); html.Append("</td>"); } html.Append("</tr>"); //Second Row html.Append("<tr>"); html.Append("<td bgcolor='#FFFFFF'>Student Name</td><td bgcolor='#FFFFFF'>Banner ID</td>"); // foreach (Section s in ass.SectionList) { html.Append("<td bgcolor='#FFFFFF'>"); html.Append("<table bgcolor='#000000' cellspacing='1' cellpadding='4'>"); html.Append("<tr>"); int i = 1; foreach (Question q in s.QuestionList) { html.Append("<td bgcolor='#FFFFFF'>"); html.Append(i++.ToString()); html.Append("</td>"); } html.Append("</tr>"); html.Append("</table>"); html.Append("</td>"); } // html.Append("</tr>"); //Third Row and onward var StdList = from stans in stdAnsList group stans.StudentName by new {stans.StudentName,stans.BannerID} into g select g; //for (int j = 0; j < StdList.Count; j++) int j = 0; foreach (var stName in StdList) { html.Append("<tr>"); html.Append("<td bgcolor='#FFFFFF' >" + stName.Key.StudentName + "</td><td bgcolor='#FFFFFF'>" + stName.Key.BannerID + "</td>"); // foreach (Section s in ass.SectionList) { html.Append("<td bgcolor='#FFFFFF'>"); html.Append("<table bgcolor='#000000' cellspacing='1' cellpadding='4'>"); html.Append("<tr>"); foreach (Question q in s.QuestionList) { if (stdAnsList.Count == 0) { html.Append("<td bgcolor='#FFFFFF'> </td>"); continue; } stdAns = stdAnsList[j++]; if (stdAns.questionOID == q.QuestionOID && stdAns.SectionOID == s.SectionOID) { if (stdAns.IsRight == 1) { html.Append("<td bgcolor='#FFFFFF'>"); } else { html.Append("<td bgcolor='#FF0000'>"); } //html.Append(q.OrderNo); html.Append(stdAns.Response); html.Append("</td>"); } else { j--; html.Append("<td bgcolor='#FFFFFF'> </td>"); } } html.Append("</tr>"); html.Append("</table>"); html.Append("</td>"); } // html.Append("</tr>"); } //END third html.Append("</table>"); html.Append(" </td></tr></table>"); Response.Write(html); //html.Remove(0, html.Length); } catch (Exception ex) { } }
private void PrintIntervention(int aid, string studentID,string StuEmail) { try { Assessment ass = new Assessment(); ass = ass.GetAssessmentByOID(aid); ResultEmail resultEmail = new ResultEmail(); resultEmail = resultEmail.GetResultEmailByAOID(aid); if (resultEmail == null) return; Student student = new Student().GetStudentByStudentOID(studentID); StringBuilder sb = new StringBuilder(); sb.Append("<table cellpadding='0px' cellspacing='0px' style='width:100%; margin:0px 30px 0px 30px'>"); sb.Append("<tr>"); sb.Append("<td align='center' style='font-size:24px; font-weight:bold;'> " + ass.AssessmentName + " Feedback Report</td>"); sb.Append("</tr>"); sb.Append("<tr>"); sb.Append("<td>CVTC applicant: <b>" + student.FullName + "</b> Program Interest: <b>" + student.MajorProgramEnrollment + "</b></td>"); sb.Append("</tr>"); sb.Append("<tr>"); sb.Append("<td > <br />" + resultEmail.Header + "</td>"); sb.Append("</tr>"); sb.Append("<tr>"); sb.Append("<td ><br /><b>*Your individual Inventory of Student Success assessment results suggest . . .</b><br /></td>"); sb.Append("</tr>"); StudentRank studentRank = new StudentRank(); Collection<StudentRank> studentRankList = studentRank.GetStudentRankBySOIDandAOID(student.StudentOID, ass.AssessmentOID); int i = 0; string txtSign = "", txtComments = ""; sb.Append("<td>"); sb.Append("<table cellpadding='0px' cellspacing='0px' style='width:80%;'>"); foreach (StudentRank SR in studentRankList) { txtComments = SR.Comment; foreach (Section s in ass.SectionList) { if (SR.SectionOID == s.SectionOID) { if (SR.Rank >= s.Medium) { txtSign = "+"; } else if ((SR.Rank < s.Medium) && (SR.Rank >= s.Low)) { txtSign = "~"; } else if ((SR.Rank < s.Low)) { txtSign = "-"; } //else //{ // txtSign = "-"; // //txtComments = ""; //} break; } } if (i % 2 == 0) { sb.Append("<tr>"); sb.Append("<td align='right' valign='middle' style='width:2%'><b>" + txtSign + "</b></td>"); sb.Append("<td style='width:48%; border: thin solid #000000; padding:10px;'> " + txtComments + " </td>"); //sb.Append("<td style='width:48%; border: thin solid #000000; padding:10px;'> " + SR.Rank + " </td>"); } else { sb.Append("<td align='right' valign='middle' style='width:2%'><b>" + txtSign + "</b></td>"); sb.Append("<td style='width:48%; border: thin solid #000000; padding:10px;'> " + txtComments + " </td>"); //sb.Append("<td style='width:48%; border: thin solid #000000; padding:10px;'> " + SR.Rank + " </td>"); sb.Append("</tr>"); } i++; txtSign = ""; txtComments = ""; } if (studentRankList.Count % 2 == 0) { sb.Append("<tr>"); sb.Append("<td colspan='4'><br />*( +above average ~average -below average )</td>"); sb.Append("</tr>"); } else { sb.Append("<td colspan='2'><br /> *( +above average ~average -below average )</td>"); sb.Append("</tr>"); } sb.Append("</table>"); sb.Append("</td>"); sb.Append("<tr>"); sb.Append("<td > <br />" + resultEmail.ShowAboveResult + "</td>"); sb.Append("</tr>"); sb.Append("</table>"); string StudentEmail=null; if (ConfigurationManager.AppSettings["productionMode"].ToString() == "OFF") { StudentEmail = System.Web.Configuration.WebConfigurationManager.AppSettings["asseeementEmail"].ToString(); } else if (ConfigurationManager.AppSettings["productionMode"].ToString() == "ON") { StudentEmail = StuEmail; if (StudentEmail == null || StudentEmail == "") { StudentEmail = System.Web.Configuration.WebConfigurationManager.AppSettings["asseeementEmail"].ToString(); } } this.SendMail(StudentEmail, "Assesment feedback report ", sb.ToString()); //this.SendMail("*****@*****.**", "Assesment feedback report ", sb.ToString()); } catch (Exception ex) { } }
protected void ButtonSubmit_Click(object sender, EventArgs e) { int aid = 0; try { User user = (User)Session["CurrentUser"]; if (user == null) return; aid = (Session["aid"] != null) ? (Convert.ToInt32(Session["aid"])) : 0; Assessment ass = new Assessment(); ass = ass.GetAssessmentByOID(aid); Collection<ResultLetterDetail> _list = new Collection<ResultLetterDetail>(); ResultLetterDetail letterDetail = null; ResultLetter resultLetter = new ResultLetter(); //resultLetter = resultLetter.GetResultLetterByOID(); resultLetter.AssessmentOID = aid; resultLetter.CreatedBy = user.UserOID; resultLetter.LastModifiedBy = user.UserOID; //resultLetter.Header = TextBoxHeader.Text; //resultLetter.ShowAboveResult = TextBoxShowAboveResult.Text; resultLetter.Header = TextBoxHeaderHtml; resultLetter.ShowAboveResult = TextBoxShowAboveResultHtml; //resultLetter.Header = TextBoxShowAboveResult.Text; int HeaderTextLength = Convert.ToInt32(System.Web.Configuration.WebConfigurationManager.AppSettings["ResultLetterHeaderTextLenth"].ToString()); int FooterTextLength = Convert.ToInt32(System.Web.Configuration.WebConfigurationManager.AppSettings["ResultLetterFooterTextLenth"].ToString()); if (TextBoxHeaderHtml.Length < HeaderTextLength && TextBoxShowAboveResultHtml.Length < FooterTextLength) { string val = ""; foreach (Section s in ass.SectionList) { if (s.SectionName == "NoScore") continue; letterDetail = new ResultLetterDetail(); val = Request.Form["txt" + s.SectionOID.ToString()]; //identifier = "txt" + s.SectionOID.ToString(); //txt = (TextBox)PlaceHolderSectionDefinition.FindControl(identifier); //if (txt == null) continue; letterDetail.SectionDefinition = val; letterDetail.SectionOID = s.SectionOID; letterDetail.LastModifiedBy = user.UserOID; letterDetail.CreatedBy = user.UserOID; _list.Add(letterDetail); } resultLetter.LetterDetail = _list; //check whether it is existing or not ResultLetter rletter = resultLetter.GetResultLetterByAOID(aid); if (rletter == null) { if (resultLetter.AddResultLetter()) { LabelMessage.Text = "Saved Successfully."; } else { LabelMessage.Text = "Saved Failed."; } } else { resultLetter.AssessmentResultLetter = rletter.AssessmentResultLetter; for (int i = 0; i < resultLetter.LetterDetail.Count; i++) { try { resultLetter.LetterDetail[i].ResultLetterSectionCommentOID = rletter.LetterDetail[i].ResultLetterSectionCommentOID; } catch { resultLetter.LetterDetail[i].ResultLetterSectionCommentOID = -1; resultLetter.LetterDetail[i].AssessmentLetterOID = rletter.AssessmentResultLetter; } } if (resultLetter.UpdateResultLetter()) { LabelMessage.Text = "Update Successfully."; //LabelMessage .Text ="Header:"+TextBoxHeaderHtml.Length .ToString ()+"And Footer :"+TextBoxShowAboveResultHtml.Length .ToString (); } else { LabelMessage.Text = "Update Failed."; } } TextBoxHeaderHtml = ""; TextBoxShowAboveResultHtml = ""; //Initialize(aid); } else { LabelMessage.Text = "Sorry! can't Save. Header Length Must Be Less than 1000 Characters and Footer Length must be Less than 1500 Characters"; LabelMessage.ForeColor = Color.Red; LabelMessage.Width = 350; } Initialize(aid); } catch (Exception ex) { Initialize(aid); } }
private void Initialize(int aid) { try { Assessment ass = new Assessment(); ass = ass.GetAssessmentByOID(aid); TextBox txtBox; Label lbl ;//= new Label(); ResultLetterDetail letterDetail = null; ResultLetter resultLetter = new ResultLetter(); resultLetter = resultLetter.GetResultLetterByAOID(aid); if (resultLetter != null) { //TextBoxHeader.Text = resultLetter.Header; //TextBoxShowAboveResult.Text = resultLetter.ShowAboveResult; TextBoxHeaderHtml = resultLetter.Header; TextBoxShowAboveResultHtml = resultLetter.ShowAboveResult; } foreach (Section s in ass.SectionList) { if (s.SectionName == "NoScore") continue; if (resultLetter != null) { try { if (resultLetter.LetterDetail != null) { var tmp = from detail in resultLetter.LetterDetail where detail.SectionOID == s.SectionOID select detail; letterDetail = tmp != null ? tmp.First() : null; } } catch (Exception ex) { letterDetail = null; } } PlaceHolderSectionDefinition.Controls.Add(InsertLineBreaks(1)); txtBox = new TextBox(); txtBox.Height = 20; lbl = new Label(); txtBox.ID = "txt" + s.SectionOID.ToString(); txtBox.Width = 630; //txtBox.Height = 60; //txtBox.TextMode = TextBoxMode.MultiLine; txtBox.Text = (letterDetail != null) ? letterDetail.SectionDefinition : ""; lbl.ID = "lbl" + s.SectionOID.ToString(); lbl.Text = s.SectionName+" : Definition"; PlaceHolderSectionDefinition.Controls.Add(lbl); // PlaceHolderSectionDefinition.Controls.Add(InsertSpace(3)); PlaceHolderSectionDefinition.Controls.Add(InsertLineBreaks(1)); PlaceHolderSectionDefinition.Controls.Add(txtBox); PlaceHolderSectionDefinition.Controls.Add(InsertLineBreaks(1)); } } catch (Exception ex) { } }
protected void ImageButtonDelete_Click(object sender, ImageClickEventArgs e) { Assessment ass = new Assessment(); GridViewRow row = ((ImageButton)sender).Parent.Parent as GridViewRow; HiddenField HiddenFieldAssessmentID = (HiddenField)row.Cells[0].FindControl("HiddenFieldAssessmentID"); string OID = HiddenFieldAssessmentID.Value; string AssessmentName = null; if (ass.GetAssessmentStatusByOID(Convert.ToInt32(OID)) == 1) { PopulateGrid(); lblStatus.Text = "This Assessment can not be Deleted.It has been Locked"; return; } if (OID != null && OID != "") { ass = ass.GetAssessmentByOID(Convert.ToInt32(OID)); if (ass != null) { AssessmentName = ass.AssessmentName; } } if (ass.DisableAssessmentStatus(Convert.ToInt32(OID))) { CVTCMenu menu = new CVTCMenu(); menu = menu.GetMenuByMenuName(AssessmentName); if (menu != null) { int MenuID = menu.MenuID; int parentID = menu.Parent; while (MenuID <= (menu.MenuID + 8)) { menu.DeleteMenuByParent(MenuID); MenuID++; } menu.DeleteMenuByMenuID(menu.MenuID); } PopulateGrid(); lblStatus.Text = "This Assessment has been deleted successfully"; } }
private void Initialize( int POID) { try { Interventions inter = new Interventions(); inter=inter.GetInterventionByOID(POID); if (inter != null) { TextBoxContactNotes.Text = inter.Comment; if (inter.Urgent == 1) CheckBoxListLeft.Items[0].Selected = true; if (inter.Internal == 1) CheckBoxListLeft.Items[1].Selected = true; if (inter.Prescribed == 1) CheckBoxListLeft.Items[2].Selected = true; if (inter.Participating == 1) CheckBoxListLeft.Items[3].Selected = true; if (inter.Completed == 1) CheckBoxListLeft.Items[4].Selected = true; if (inter.Email == 1) CheckBoxListRight.Items[0].Selected = true; if (inter.Telephone == 1) CheckBoxListRight.Items[1].Selected = true; if (inter.InPerson == 1) CheckBoxListRight.Items[2].Selected = true; if (inter.HandOff == 1) CheckBoxListRight.Items[3].Selected = true; if (inter.Testing == 1) CheckBoxTesting.Checked = true; //DropDownListDomain.Text = inter.DomainName; //DropDownListDomain.DataValueField = inter.DomainName; DropDownListDomain.Items.Add(inter.DomainName); Assessment assment = new Assessment(); assment = assment.GetAssessmentByOID(inter.AssessmentOID); if (assment != null) { ddlAssessment.Items.Add(assment.AssessmentName); } //DropDownListDomain.selectedte = inter.DomainName; //DropDownListIntervention.Text = inter.InterventionName; //DropDownListIntervention.DataValueField = inter.InterventionName; DropDownListIntervention.Items.Add(inter.InterventionName); //DropDownListIntervention.SelectedItem = inter.InterventionName; //DropDownListAdvocate.SelectedItem = inter.UserName; DropDownListAdvocate.Text = inter.UserName; TextBoxLatestAction.Value = inter.LatestActionDate; TextBoxLatestContact.Value = inter.LatestContact; ViewState["studentID"] = inter.StudentOID; } } catch(Exception ex) { } }
protected void ButtonSaveMyWork_Click(object sender, EventArgs e) { string ordNum = null, ques = null, RespAct = null, Resp = null, Flag = null,Reverse=null; int assessmentOID=0; Question questn;//=new Question(); try { assessmentOID = (Session["aid"] != null) ? Convert.ToInt32(Session["aid"]) : -1; Collection<Question> quesList;// = new Collection<Question>(); Collection<QuestionResponse> respList;//=new Collection<QuestionResponse>(); QuestionResponse quesResp; Section section=new Section(); section.SectionName = TextBoxSectionName.Text; section.AssessmentOID = assessmentOID; section.LastModifiedBy = 1; section.CreatedBy = 1; section.FlagPointTotal = 0; section.PassingTotal = 0; section.SectionOID = 0; section.TotalFlag = 0; section.TotalQuestion = 0; section.Flag =Convert.ToInt32( TextBoxFlag.Text); section.Low = Convert.ToInt32(TextBoxLow.Text); section.Medium = Convert.ToInt32(TextBoxMedium.Text); section.High = 67; #region Question //Loop For Questions quesList = new Collection<Question>(); for(int i=1;;i+=6) { questn = new Question(); ordNum = "TextOrderNumber" + i.ToString(); if (ordNum==null ) { break; } ques = "TextQuestion" + i.ToString(); RespAct = "SelectResponseAction" + i.ToString(); //Loop For Question Responses respList = new Collection<QuestionResponse>(); for (int j = 0; j < 6; j++) { quesResp = new QuestionResponse(); Resp = "TextResponse" + (i+j).ToString(); Flag = "SelectFalgRating" + (i + j).ToString(); //Get Value From Form Resp = Request.Form[Resp]; Flag = Request.Form[Flag]; //Assign values Question Response quesResp.CreatedBy = 1; quesResp.LastModifiedBy = 1; quesResp.FlagRating = Convert.ToInt32(Flag); quesResp.Response = Resp; respList.Add(quesResp); } ordNum = Request.Form[ordNum]; if (ordNum == null) break; ques = Request.Form[ques]; RespAct = Request.Form[RespAct]; //Assign Values to question // quesList= new Collection<Question>(); //questn = new Question(); questn.CreatedBy = 1;//Set current user questn.LastModifiedBy = 1;//Set current user questn.Keyword = " "; questn.MultipleAllow = 1; questn.OrderNo = Convert.ToInt32(ordNum); questn.QuestionText = ques; questn.RespAction = RespAct; Reverse = Convert.ToString("chkReverse" + i.ToString()); Reverse = Request.Form[Reverse]; if (Reverse == "on") { questn.Reverse = 1; } else { questn.Reverse = 0; } quesList.Add(questn); questn.QuestionRespList = respList; } #region dummy ////Process //for (int j = 1; ; j++) //{ // Resp = "TextResponse" + i.ToString() + "_" + j.ToString(); // Flag = "SelectFalgRating" + i.ToString() + "_" + j.ToString(); // Resp = Request.Form[Resp]; // Flag = Request.Form[Flag]; // if (Resp == null) break; // //Assign values Question Response // quesResp = new QuestionResponse(); // quesResp.CreatedBy = 1; // quesResp.LastModifiedBy = 1; // quesResp.FlagRating = Convert.ToInt32(Flag); // quesResp.Response = Resp; // respList.Add(quesResp); //} #endregion #endregion section.QuestionList = quesList; section.AddSection(); section.UpdateAssessmentSection(); TextBoxSectionName.Text = ""; //TextBoxPassingTotal.Text = "0"; TextBoxTotalQuestion.Text = "1"; Assessment ass = new Assessment(); ass = ass.GetAssessmentByOID(assessmentOID); CVTCMenu menu = new CVTCMenu(); CVTCMenu tmp = menu.GetMenuByOID(ass.RefMenuID); menu.NameMenu = section.SectionName; int menuId = new CVTCMenu().GetMaxMenuID(); menuId += 1; menu.MenuID = menuId; menu.URL = "pg/assessment/section.aspx?soid=" + section.SectionOID.ToString(); menu.MenuLevel = 3; menu.Parent = tmp.MenuID+8; menu.IsExpanded = "true"; menu.IsLeave = "true"; menu.SaveAssessmentMenuItem(menu); LabelMessage.Text = "Saved Successfully."; } catch (Exception ex) { } }
protected void ButtonSubmit_Click(object sender, EventArgs e) { int aid = 0; try { User user=(User)Session["CurrentUser"]; if (user == null) return; System.Collections.ObjectModel.Collection<ResultEmailDetail> _list = new System.Collections.ObjectModel.Collection<ResultEmailDetail>(); ResultEmailDetail emailDetail=null; aid = (Session["aid"] != null) ? (Convert.ToInt32(Session["aid"])) : 0; Assessment ass = new Assessment(); ass = ass.GetAssessmentByOID(aid); ResultEmail resultEmail = new ResultEmail(); //resultEmail.Header = TextBoxHeader.Text; //resultEmail.ShowAboveResult = TextBoxShowAboveResult.Text; resultEmail.Header = TextBoxHeaderHtml; resultEmail.ShowAboveResult = TextBoxShowAboveResultHtml; resultEmail.AssessmentOID = aid; resultEmail.CreatedBy = user.UserOID; resultEmail.LastModifiedBy = user.UserOID; //Result Detail ResultEmail rEmail = resultEmail.GetResultEmailByAOID(aid); //TextBox txt; string val = ""; foreach (Section s in ass.SectionList) { emailDetail = new ResultEmailDetail(); ////Positive Result //val = Request.Form["txtPositive" + s.SectionOID.ToString()]; //emailDetail.PositiveResult = val; ////Negative Result //val = Request.Form["txtNegative" + s.SectionOID.ToString()]; //emailDetail.NegativeResult = val; //Low Result val = Request.Form["txtLow" + s.SectionOID.ToString()]; emailDetail.LowResult = val; //Medium Result val = Request.Form["txtMedium" + s.SectionOID.ToString()]; emailDetail.MediumResult = val; //High Result val = Request.Form["txtHigh" + s.SectionOID.ToString()]; emailDetail.HighResult = val; emailDetail.SectionOID = s.SectionOID; emailDetail.LastModifiedBy = user.UserOID; emailDetail.CreatedBy = user.UserOID; _list.Add(emailDetail); } resultEmail.ResultDetail = _list; //check whether It is exist or not if (rEmail == null) { if (resultEmail.AddResultEmail()) { LabelMessage.Text = "Saved Successfully."; } else { LabelMessage.Text = "Not Saved."; } } else { resultEmail.AssessmentResultOID = rEmail.AssessmentResultOID; for (int i = 0; i < rEmail.ResultDetail.Count; i++) { resultEmail.ResultDetail[i].ResultSectionOID = rEmail.ResultDetail[i].ResultSectionOID; } if (resultEmail.UpdateResultEmail()) { LabelMessage.Text = "Update Successfully."; } else { LabelMessage.Text = "Update Failed."; } } TextBoxShowAboveResultHtml = ""; TextBoxHeaderHtml = ""; this.Initialize(aid); } catch (Exception ex) { this.Initialize(aid); } }
//private void PrintIntervention(int aid, string studentID) //{ // try // { // Assessment ass = new Assessment(); // ass = ass.GetAssessmentByOID(aid); // ResultEmail resultEmail = new ResultEmail(); // resultEmail = resultEmail.GetResultEmailByAOID(aid); // Student student = new Student().GetStudentByStudentOID(studentID); // StringBuilder sb = new StringBuilder(); // sb.Append("<table cellpadding='0px' cellspacing='0px' style='width:100%; margin:0px 30px 0px 30px'>"); // sb.Append("<tr>"); // sb.Append("<td align='center' style='font-size:24px; font-weight:bold;'> " + ass.AssessmentName + " Feedback Report</td>"); // sb.Append("</tr>"); // sb.Append("<tr>"); // sb.Append("<td>CVTC applicant: <b>" + student.FullName + "</b> Program Interest: <b>" + student.MajorProgramEnrollment + "</b></td>"); // sb.Append("</tr>"); // sb.Append("<tr>"); // sb.Append("<td >" + resultEmail.Header + "</td>"); // sb.Append("</tr>"); // sb.Append("<tr>"); // sb.Append("<td ><b>*Your individual Inventory of Student Success assessment results suggest . . .</b></br></td>"); // sb.Append("</tr>"); // StudentRank studentRank = new StudentRank(); // Collection<StudentRank> studentRankList = studentRank.GetStudentRankBySOIDandAOID(student.StudentOID, ass.AssessmentOID); // int i = 0; // string txtSign="", txtComments=""; // sb.Append("<td>"); // sb.Append("<table cellpadding='0px' cellspacing='0px' style='width:80%;'>"); // foreach (StudentRank SR in studentRankList) // { // txtComments = SR.Comment; // foreach (Section s in ass.SectionList) // { // if (SR.SectionOID == s.SectionOID) // { // if (SR.Rank >= s.High) // { // txtSign = "+"; // } // else if ((SR.Rank < s.High) && (SR.Rank >= s.Medium)) // { // txtSign = "~"; // } // else if ((SR.Rank < s.Medium) && (SR.Rank >= s.Low)) // { // txtSign = "-"; // } // else // { // txtSign = ""; // txtComments = ""; // } // break; // } // } // if (i % 2 == 0) // { // sb.Append("<tr>"); // sb.Append("<td align='right' valign='middle' style='width:2%'><b>" + txtSign + "</b></td>"); // sb.Append("<td style='width:48%; border: thin solid #000000'> " + txtComments + " </td>"); // } // else // { // sb.Append("<td align='right' valign='middle' style='width:2%'><b>" + txtSign + "</b></td>"); // sb.Append("<td style='width:48%; border: thin solid #000000'> " + txtComments + " </td>"); // sb.Append("</tr>"); // } // i++; // txtSign = ""; // txtComments = ""; // } // if (studentRankList.Count % 2 == 0) // { // sb.Append("<tr>"); // sb.Append("<td colspan='4'></br>*( +above average ~average -below average )</br></td>"); // sb.Append("</tr>"); // } // else // { // sb.Append("<td></br>*( +above average ~average -below average )</br></td>"); // sb.Append("</tr>"); // } // sb.Append("</table>"); // sb.Append("</td>"); // sb.Append("<tr>"); // sb.Append("<td > </br>" + resultEmail.ShowAboveResult + "</td>"); // sb.Append("</tr>"); // sb.Append("</table>"); // print_div1.InnerHtml = sb.ToString(); // } // catch (Exception ex) // { } //} private void Initialize(int aid) { try { string html = ""; Assessment ass = new Assessment(); ass = ass.GetAssessmentByOID(aid); ResultEmail resultEmail = new ResultEmail(); resultEmail = resultEmail.GetResultEmailByAOID(aid); string txtLow, txtMedium, txtHigh; if (resultEmail != null) { //TextBoxHeader.Text = resultEmail.Header; //TextBoxShowAboveResult.Text = resultEmail.ShowAboveResult; TextBoxHeaderHtml = resultEmail.Header; TextBoxShowAboveResultHtml = resultEmail.ShowAboveResult; } ResultEmailDetail rEmailDetail=null; html = "<table>"; foreach (Section s in ass.SectionList) { //PlaceHolderResult.Controls.Add(InsertLineBreaks(1)); if (s.SectionName != "NoScore") { if (resultEmail != null) { if (resultEmail.ResultDetail != null) { var tmp = from detail in resultEmail.ResultDetail where detail.SectionOID == s.SectionOID select detail; if (tmp.Count<ResultEmailDetail>() > 0) { rEmailDetail = tmp != null ? tmp.First() : null; } else { rEmailDetail = null; } } } txtLow = (rEmailDetail != null) ? rEmailDetail.LowResult : ""; txtMedium = (rEmailDetail != null) ? rEmailDetail.MediumResult : ""; txtHigh = (rEmailDetail != null) ? rEmailDetail.HighResult : ""; html += "<tr>"; html += "<td colspan='3' style='font-size:6;font-weight:bold;'>" + s.SectionName + "<td>"; html += "</tr>"; html += "<tr>"; html += "<td>" + "Low Ranking <br/>" + "<input id='txtLow" + s.SectionOID.ToString() + "' name='txtLow" + s.SectionOID.ToString() + "' type='text' style='height:20px;width:250px;' value='" + txtLow + "'/>" + "<td>"; html += "<td>" + "Medium Ranking <br/>" + "<input id='txtMedium" + s.SectionOID.ToString() + "' name='txtMedium" + s.SectionOID.ToString() + "' type='text' style='height:20px;width:250px;' value='" + txtMedium + " '/>" + "<td>"; html += "<td>" + "High Ranking <br/>" + "<input id='txtHigh" + s.SectionOID.ToString() + "' name='txtHigh" + s.SectionOID.ToString() + "' type='text' style='height:20px;width:250px;' value='" + txtHigh + " '/>" + "<td>"; html += "</tr>"; #region Old Code ////Positive Result //txtBox = new TextBox(); //lbl = new Label(); //txtBox.ID = "txtPositive" + s.SectionOID.ToString(); //txtBox.Text = (rEmailDetail != null) ? rEmailDetail.PositiveResult : ""; //lbl.ID = "lblPositive" + s.SectionOID.ToString(); //lbl.Text = "Positive Result for " + s.SectionName; //PlaceHolderResult.Controls.Add(lbl); //PlaceHolderResult.Controls.Add(InsertSpace(2)); //PlaceHolderResult.Controls.Add(txtBox); //PlaceHolderResult.Controls.Add(InsertSpace(10)); ////Negative Result //txtBox = new TextBox(); //lbl = new Label(); //txtBox.ID = "txtNegative" + s.SectionOID.ToString(); //txtBox.Text = (rEmailDetail != null) ? rEmailDetail.NegativeResult : ""; //lbl.ID = "lblNegative" + s.SectionOID.ToString(); //lbl.Text = "Negative Result for "+s.SectionName; //PlaceHolderResult.Controls.Add(lbl); //PlaceHolderResult.Controls.Add(InsertSpace(2)); //PlaceHolderResult.Controls.Add(txtBox); //PlaceHolderResult.Controls.Add(InsertLineBreaks(1)); #endregion } } html += " </table>"; ResultHolder.InnerHtml = html; //PlaceHolderResult.Controls.Add(html); } catch (Exception ex) { } }
protected void Page_Load(object sender, EventArgs e) { lblAssessmentName.Text = ""; Label1.Text = ""; if (!Page.IsPostBack) { //int assOID = Convert.ToInt32(Request.QueryString["aid"].ToString()); //int sectOID = Convert.ToInt32(Request.QueryString["sid"].ToString()); int aid = (Session["aoid"] != null) ? Convert.ToInt32(Session["aoid"].ToString()) : 0; Assessment ass = new Assessment(); ass = ass.GetAssessmentByOID(aid); if (ass!=null ) { lblAssessmentName.Text = ass.AssessmentName; } StringBuilder sb = new StringBuilder(); //Session["soid"] = sectOID; //Initialize(aid); Student student = (Student)(Session["currentStd"]); if (student != null) { lblStudentID.Text = student.StudentID; string strFullName = student.FullName; string[] strNames = null; if (strFullName.Contains(',')) { strNames = strFullName.Split(','); } else { strNames = strFullName.Split(' '); } //lblFirstName.Text = strNames[0]; lblFirstName.Text = student.FirstName; //lblLastName.Text = strNames[1]; lblLastName.Text = student.LastName ; if (student.BirthDate != null) { lblBirthDate.Text = Convert.ToDateTime(student.BirthDate.ToString()).ToShortDateString(); } lblProgram.Text = student.MajorProgramEnrollment ; } if (!IsExist( aid)) { NonScoreTable(aid); ScoreTable(aid); } else { //ButtonSubmit.Visible = true ; Response.Write("<b>You have already sit for this section</b>"); } } }
private void Initialize(int AOID) { try { Assessment ass = new Assessment(); ass = ass.GetAssessmentByOID(AOID); Label lblSect; Label lineBreak=new Label(); lineBreak.Text = "<br />"; //LabelAssessment.Text = "Exam for assessment " + ass.AssessmentName; foreach (Section s in ass.SectionList) { //lblSect = new Label(); //lblSect.Text = s.SectionName; //PlaceHolderMain.Controls.Add(lblSect); //PlaceHolderMain.Controls.Add(InsertLineBreaks(1)); //Each Question foreach (Question q in s.QuestionList) { // PlaceHolderMain.Controls.Add(InsertLineBreaks(1)); lblSect = new Label(); lblSect.Text = q.OrderNo+". "+q.QuestionText; PlaceHolderMain.Controls.Add(lblSect); if (q.RespAction == "Radio Button") { //Panel p = new Panel(); RadioButtonList rblist = new RadioButtonList(); rblist.ID = q.QuestionOID.ToString(); //Each Question Response foreach (QuestionResponse resp in q.QuestionRespList) { rblist.Items.Add(resp.Response); } //p.Controls.Add(rblist); ///PlaceHolderMain.Controls.Add(InsertLineBreaks(1)); PlaceHolderMain.Controls.Add(rblist); } else if (q.RespAction == "Check Box") { //Panel p = new Panel(); CheckBoxList chlist = new CheckBoxList(); chlist.ID = q.QuestionOID.ToString(); //Each Question Response foreach (QuestionResponse resp in q.QuestionRespList) { chlist.Items.Add(resp.Response); } //p.Controls.Add(chlist); //PlaceHolderMain.Controls.Add(InsertLineBreaks(1)); PlaceHolderMain.Controls.Add(chlist); } else if (q.RespAction == "Drop Down") { //Panel p = new Panel(); DropDownList ddl = new DropDownList(); ddl.ID = q.QuestionOID.ToString(); //Each Question Response foreach (QuestionResponse resp in q.QuestionRespList) { ddl.Items.Add(resp.Response); } //p.Controls.Add(ddl); PlaceHolderMain.Controls.Add(ddl); } PlaceHolderMain.Controls.Add(InsertLineBreaks(1)); } //PlaceHolderMain.Controls.Add(InsertLineBreaks(1)); } } catch (Exception ex) { } }
private void Initialize(int aid) { try { Assessment ass = new Assessment(); //Get Assessment by OID ass = ass.GetAssessmentByOID(aid); //Assign it LabelAssessmentName.Text = ass.AssessmentName; LabelSection.Text = ass.TotalSection.ToString(); //LabelFlaggedPoint.Text = ass.TotalFlagPoint.ToString(); //LabelTotalFlagged.Text = ass.TotalFlag.ToString(); LabelTotalQuestion.Text = ass.TotalQuestion.ToString(); //Section Detail LabelSectionDetails.Text = ""; string sectionDetails = ""; if (ass.SectionList.Count > 0) { foreach (Section s in ass.SectionList) { sectionDetails += "<br/>"; sectionDetails += "<br/>"; sectionDetails += "\t" + "<span style='font-weight:bold;font-size:medium;'>" + s.SectionName + "</span>"; sectionDetails += "<br/>"; sectionDetails += "Total Question : " + s.TotalQuestion.ToString(); sectionDetails += "<br/>"; if (s.SectionName == "NoScore") continue; sectionDetails += "Total Points : " + s.FlagPointTotal.ToString(); } } LabelSectionDetails.Text = sectionDetails; //Add Existing RiskCalculation//style='border-style: solid; border-width: thin' string str = "<table id='tblRisk' > <tr><td style='font-weight:bold;font-size:medium;'>At Risk Calculation</td></tr> <tr><td>Current Calculation(s): <input id='ButtonAddRisk' type='button' value='+' /> <span id='AddRiskSpan' style='display:none;'>Name <input id='TextRiskName' type='text' /> <input id='ButtonSaveRisk' type='button' value='Save' /></span></td></tr>"; RiskCalculation risk = new RiskCalculation(); System.Collections.ObjectModel.Collection<RiskCalculation> list; list = risk.GetRiskCalulationByAOID(aid); foreach (RiskCalculation r in list) { /// str += "<tr id='" + r.RiskOID + "'><td><span>" + r.RiskName + "</span><span id='SpanMain" + r.RiskOID + "'> :" + r.NumFlag + " Flagged Point " + " </span><input id='ButtonEdit' type='button' value='Edit' /> <input id='ButtonPrescription' type='button' value='Prescription' /> <span id='SpanInner" + r.RiskOID + "' style='display:none;' > Flagged Point <input id='Flagged" + r.RiskOID + "' style='width:20px' type='text' /> <input id='ButtonSave' type='button' value='Save' /> </span></td></tr>"; } //str+= "<tr id='1' style='display:none;'><td><span id='SpanMain1'>At Risk : 4pts flagged + 2 Section Failed </span><input id='ButtonEdit' type='button' value='Edit' /> <input id='ButtonPrescription' type='button' value='Prescription' /> <span id='SpanInner1' style='display:none;'> Flagged <input id='Flagged1' style='width:20px' type='text' /> Section Failed <input id='SectionFailed1' type='text' style='width:20px' /><input id='ButtonSave' type='button' value='Save' /> </span></td></tr>"; str += " <tr id='RowLast'><td> </td></tr>"; str+="</table>"; LabelRisk.Text = str; } catch (Exception ex) { } }
private void ScoreTable(int AOID) { StringBuilder sb = new StringBuilder(); Assessment ass = new Assessment(); # region Dummy JS //// Working For No Score //sb.Append("<script type='text/javascript'>"); //sb.Append(" function clearAllRadios(radioList, count,position){ if(count == '') count = 7; if(position==0) position = 'Radio'; else if(position==1) position = 'RadioButonLeft'; else position = 'RadioButonRight'; radioList = radioList.toString(); "); //sb.Append(" var mySplitLength = radioList.length; "); //sb.Append(" var SplitResult = radioList.substring(0,mySplitLength-1); "); //sb.Append(" var lastDigit = radioList.substring(mySplitLength-1,mySplitLength); "); //sb.Append(" var firstDigit = radioList.substring(0,1); "); //sb.Append("i = parseInt(radioList); j= i ;"); //sb.Append("var k = count - lastDigit;"); //sb.Append("var i = parseInt(SplitResult) + '1';"); //sb.Append(" alert('i='+i);alert('j+k='+(j+k));"); //sb.Append(" for(i=i; i< j+k; i++){"); //sb.Append("if( i != parseInt(radioList)) { "); //sb.Append(" var test111 = position + i;"); //sb.Append(" alert(test111);"); //sb.Append("document.getElementById(test111).checked = false;"); //// End of IF //sb.Append("}"); //// End of For //sb.Append("}"); //// End of Function //sb.Append("}"); //sb.Append("</script>"); /// End of Working For No Score // //Working For Both // sb.Append("<script type='text/javascript'>"); // sb.Append(" function clearAllRadios(radioList, count,position){ if(count == '') count = 7; if(position==0) position = 'Radio'; else if(position==1) position = 'RadioButonLeft'; else position = 'RadioButonRight'; radioList = radioList.toString(); "); // sb.Append(" var mySplitLength = radioList.length; "); // sb.Append(" var SplitResult = radioList.substring(0,mySplitLength-1); "); // sb.Append(" var lastDigit = radioList.substring(mySplitLength-1,mySplitLength); "); // sb.Append(" var firstDigit = radioList.substring(0,1); "); // sb.Append("i = parseInt(radioList); j= i ;"); // sb.Append(" if(position =='Radio') k = (count - lastDigit)-1; else k = count - lastDigit;"); // sb.Append("var i = parseInt(SplitResult) + '1';"); // //sb.Append(" alert('i='+i);alert('j+k='+(j+k));"); // sb.Append(" for(i=i; i<= j+k; i++){"); // sb.Append("if( i != parseInt(radioList)) { "); // sb.Append(" var test111 = position + i;"); // //sb.Append(" alert(test111);"); // sb.Append("document.getElementById(test111).checked = false;"); // // End of IF // sb.Append("}"); // // End of For // sb.Append("}"); // // End of Function // sb.Append("}"); // sb.Append("</script>"); ////End of Working For Both #endregion #region Active JS //Working For Both sb.Append("<script type='text/javascript'>"); sb.Append(" function clearAllRadios(radioList, count,position){ if(count == '') count = 7; if(position==0) position = 'Radio'; else if(position==1) position = 'RadioButonLeft'; else position = 'RadioButonRight'; radioList = radioList.toString(); "); sb.Append(" var mySplitLength = radioList.length; "); sb.Append(" var SplitResult = radioList.substring(0,mySplitLength-1); "); sb.Append(" var lastDigit = radioList.substring(mySplitLength-1,mySplitLength); "); sb.Append(" var firstDigit = radioList.substring(0,1); "); sb.Append("i = parseInt(radioList); j= i ;"); sb.Append(" if(position =='Radio') k = (count - lastDigit)-1; else k = count - lastDigit;"); sb.Append("var i = parseInt(SplitResult) + '1';"); //sb.Append(" alert('i='+i);alert('j+k='+(j+k));"); sb.Append(" for(i=i; i<= j+k; i++){"); sb.Append("if( i != parseInt(radioList)) { "); sb.Append(" var test111 = position + i;"); //sb.Append(" alert(test111);"); sb.Append("document.getElementById(test111).checked = false;"); // End of IF sb.Append("}"); // End of For sb.Append("}"); // End of Function sb.Append("}"); sb.Append("</script>"); //End of Working For Both #endregion sb.Append(" <table width ='100%' class='answer_table'cellpadding='0' cellspacing='0' >"); //First tr sb.Append(" <tr> <td width='80%' style='padding:5px;'> For the remaining questions, choose one response for each statement that indicates your level of agreement or disagreement with the statement. Measuring attitudes is hard to do, so asking the same questions again in different ways is necessary to reduce error. Please be patient and answer each item as naturally as you can without trying to recall previous responses. Bear in mind that there are no 'right' or 'wrong' answers, simply provide the answer that best fits you. For questions on study habits and teachers, reference mainly your pre-college experiences.</td>"); sb.Append("<td valign='bottom' width='3%' align='center' style='padding-left:5px;><div class ='answer11' > <img src='images/Untitled1.png' alt='Not true at all'/> </div> </td>"); sb.Append("<td valign='bottom' width='3%' align='center' style='padding-left:5px;> <div class ='answer11' > <img src='images/Untitled2.png' alt='Somewhat Untrue'/> </div></td>"); sb.Append("<td valign='bottom' width='3%' align='center' style='padding-left:5px;> <div class ='answer11' > <img src='images/Untitled3.png' alt='Slightly Untrue'/> </div></td>"); sb.Append("<td valign='bottom' width='3%' align='center' style='padding-left:5px;> <div class ='answer11' > <img src='images/Untitled4.png' alt='Slightly True'/> </div></td>"); sb.Append("<td valign='bottom' width='3%' align='center' style='padding-left:5px;> <div class ='answer11' > <img src='images/Untitled5.png' alt='Somewhat True'/> </div> </td>"); sb.Append("<td valign='bottom' width='3%' align='center' style='padding-left:5px;> <div class ='answer11' > <img src='images/Untitled6.png' alt='Completely True'/> </div> </td>"); sb.Append("</tr>"); //End first tr if (AOID != 0) { ass = ass.GetAssessmentByOID(AOID); Section sec ; int count = 0; for (int sn = 0; sn < ass.SectionList.Count; sn++) { sec = ass.SectionList[sn]; if (sec.SectionName != "NoScore") { foreach (Question q in sec.QuestionList) { count++; //Second tr sb.Append("<tr>"); //Question td #region Question td if (q.QuestionOID % 2 == 0) { sb.Append("<td width='80%' style='padding:10px;' align='right' class='qustion_title_bg'>"); } else { sb.Append("<td width='80%' style='padding:10px;' align='right' class='qustion_title_bg_alt'>"); } sb.Append("<span id='span" + q.QuestionOID + "'>" + q.QuestionText + "</span> <br />"); sb.Append("</td>"); #endregion //End Question td //Responses td sb.Append("<td colspan='6' width='20%'>"); // sb.Append("<div >"); sb.Append("<table class='Groupnonscorequestion_" + QuestionCounter + "' cellpadding='0' cellspacing='0'width='100%' >"); sb.Append("<tr>"); #region Responses sb.Append("<td align='center' width='3%' class ='answer1' >"); sb.Append("<label><input id='Radio" + q.QuestionOID + 1 + "' class='nonscorequestions_" + QuestionCounter + "' title='Not true at all' name='A1" + q.QuestionOID + "' onclick=' clearAllRadios(" + q.QuestionOID + 1 + ", 7,0)' type='radio' enableviewstate='true'runat='server'/></label>"); sb.Append("</td>"); sb.Append("<td align='center' width='3%' class ='answer1'>"); sb.Append("<label><input id='Radio" + q.QuestionOID + 2 + "' class='nonscorequestions_" + QuestionCounter + "' title='Somewhat Untrue' name='A2" + q.QuestionOID + "' onclick=' clearAllRadios(" + q.QuestionOID + 2 + ", 7,0)' type='radio' enableviewstate='true'runat='server'/></label>"); sb.Append("</td>"); sb.Append("<td align='center' width='3%' class ='answer1'>"); sb.Append("<label><input id='Radio" + q.QuestionOID + 3 + "' class='nonscorequestions_" + QuestionCounter + "' title='Slightly Untrue' name='A3" + q.QuestionOID + "' onclick=' clearAllRadios(" + q.QuestionOID + 3 + ", 7,0)' type='radio' enableviewstate='true'runat='server'/></label>"); sb.Append("</td>"); sb.Append("<td align='center' width='3%' class ='answer1' >"); sb.Append("<label><input id='Radio" + q.QuestionOID + 4 + "' class='nonscorequestions_" + QuestionCounter + "' title='Slightly True' name='A4" + q.QuestionOID + "' type='radio' onclick=' clearAllRadios(" + q.QuestionOID + 4 + ", 7,0)' enableviewstate='true'runat='server'/></label>"); sb.Append("</td>"); sb.Append("<td align='center' width='3%' class ='answer1'>"); sb.Append("<label><input id='Radio" + q.QuestionOID + 5 + "' class='nonscorequestions_" + QuestionCounter + "' title='Somewhat True' name='A5" + q.QuestionOID + "' onclick=' clearAllRadios(" + q.QuestionOID + 5 + ", 7,0)' type='radio' enableviewstate='true'runat='server'/></label>"); sb.Append("</td>"); sb.Append("<td align='center' width='3%' class ='answer1'>"); sb.Append("<label><input id='Radio" + q.QuestionOID + 6 + "' class='nonscorequestions_" + QuestionCounter + "' title='Completely True' name='A6" + q.QuestionOID + "' onclick=' clearAllRadios(" + q.QuestionOID + 6 + ", 7,0)' type='radio' enableviewstate='true'runat='server'/></label>"); sb.Append("</td>"); #endregion sb.Append("</tr>"); sb.Append("</table>"); //sb.Append("</div>"); sb.Append("</td>"); //End Responses td sb.Append("</tr>"); //End Second tr //} QuestionCounter++; } } } sb.Append(" </table>"); divNonScoreTable.InnerHtml = sb.ToString(); } }
private void Initialized(int aid) { try { string colsp = ""; int i = 0; StringBuilder html = new StringBuilder(); StudentAnswer stdAns = new StudentAnswer(); Assessment ass = new Assessment(); Collection<StudentAnswer> stdAnsList = stdAns.GetStudentAnswerByAOID(aid); ass = ass.GetAssessmentByOID(aid); html.Append("<table border='0' cellspacing='0' cellpadding='0'><tr> <td bgcolor='#000000'>"); html.Append("<table bgcolor='#000000' cellspacing='1' cellpadding='4' >"); //First Row html.Append("<tr>"); html.Append("<td bgcolor='#FFFFFF' colspan='2' > </td>"); foreach (Section s in ass.SectionList) { i = s.QuestionList.Count == 0 ? 1 : s.QuestionList.Count; colsp = "colspan='" + i+"'"; html.Append("<td bgcolor='#CDCABB' " + colsp + " >"); html.Append(s.SectionName); html.Append("</td>"); } html.Append("</tr>"); //Second Row html.Append("<tr>"); html.Append("<td bgcolor='#CDCABB'>Student Name</td><td bgcolor='#CDCABB'>Banner ID</td>"); // foreach (Section s in ass.SectionList) { i = 1; foreach (Question q in s.QuestionList) { html.Append("<td bgcolor='#CDCABB'>"); html.Append(i++.ToString()); html.Append("</td>"); } } html.Append("</tr>"); //Third Row and onword var StdList = from stans in stdAnsList group stans.StudentName by new { stans.StudentName, stans.BannerID } into g select g; //for (int j = 0; j < StdList.Count; j++) int j = 0; foreach (var stName in StdList) { html.Append("<tr>"); html.Append("<td bgcolor='#FFFFFF' >" + stName.Key.StudentName + "</td><td bgcolor='#FFFFFF'>" + stName.Key.BannerID + "</td>"); // foreach (Section s in ass.SectionList) { //html.Append("<td bgcolor='#FFFFFF'>"); //html.Append("<table bgcolor='#000000' cellspacing='1' cellpadding='4'>"); //html.Append("<tr>"); foreach (Question q in s.QuestionList) { if (stdAnsList.Count == 0) { html.Append("<td bgcolor='#FFFFFF'> </td>"); continue; } //stdAns = stdAnsList[j++]; StudentAnswer stdAns1 = null; var t = from ans in stdAnsList where ans.questionOID == q.QuestionOID && ans.SectionOID == s.SectionOID && ans.BannerID == stName.Key.BannerID select ans; foreach (StudentAnswer m in t) { stdAns1 = m; break; } if (stdAns1 == null) { html.Append("<td bgcolor='#FFFFFF'> </td>"); continue; } // StudentAnswer stdAns1 =stdAnsList. if (stdAns1.questionOID == q.QuestionOID && stdAns1.SectionOID == s.SectionOID) { if (stdAns1.IsRight == 1) { html.Append("<td bgcolor='#FFFFFF'>"); } else { html.Append("<td bgcolor='#FF0000'>"); } //html.Append(q.OrderNo); html.Append(stdAns1.Response); html.Append("</td>"); } else { j--; html.Append("<td bgcolor='#FFFFFF'> </td>"); } } //html.Append("</tr>"); //html.Append("</table>"); //html.Append("</td>"); } // html.Append("</tr>"); } html.Append("</table>"); html.Append(" </td></tr></table>"); Response.Write(html); } catch (Exception ex) { } }