protected void lbViewStudentResponse_Click(object sender, EventArgs e) { LinkButton linkUpdate = sender as LinkButton; GridViewRow grid = (GridViewRow)linkUpdate.NamingContainer; string tempID = gvViewStudentResponse.DataKeys[grid.RowIndex].Value.ToString(); ViewState["tempId"] = tempID; RenderXML RX = new RenderXML(); DataSet ds = RX.XMLContent2(tempID); XmlDoc.LoadXml(ds.Tables[0].Rows[0]["XMLStudentResponse"].ToString()); ns = new XmlNamespaceManager(XmlDoc.NameTable); ns.AddNamespace("ns", "urn:Question-Schema"); string xpath = "/ns:Quiz"; XmlNodeList QuizNode = XmlDoc.SelectNodes(xpath, ns); DLViewResponseReport.DataSource = QuizNode; DLViewResponseReport.DataBind(); DLViewResponseReportFillin.DataSource = QuizNode; DLViewResponseReportFillin.DataBind(); DLViewResponseReportTrueFalse.DataSource = QuizNode; DLViewResponseReportTrueFalse.DataBind(); MPE2.Show(); }
protected void btnSubmit_Click(object sender, EventArgs e) { string confirmValue = Request.Form["confirm_value"]; if (confirmValue == "Yes") { myDal.ClearParams(); myDal.AddParam("@Versionid", ddlVersion.SelectedValue.ToString()); myDal.AddParam("@ClassId", ddlClass.SelectedValue.ToString()); myDal.AddParam("@Mentorid", HttpContext.Current.Session["Userid"].ToString()); DataSet dsGetNewIssueQuizId = myDal.ExecuteProcedure("SD18EXAM_spIssueNewQuiz"); string NewId = null; if (dsGetNewIssueQuizId.Tables[0].Columns["IssuedQuizId"] != null) { NewId = dsGetNewIssueQuizId.Tables[0].Rows[0]["IssuedQuizId"].ToString(); } if (NewId != null) { foreach (ListItem Student in cblStudents.Items) {//default: all Students are selected if (Student.Selected == true) { RenderXML RX = new RenderXML(); RX.GetNRandomizeXMLContent(ddlVersion.SelectedValue.ToString(), Student, NewId); //RenderXML RX = new RenderXML(); //RX.GetNRandomizeXMLContent(ddlVersion.SelectedValue.ToString()); } } Response.Write("<SCRIPT>alert('New Quiz has been issued')</SCRIPT>"); } } }
protected void lbDownloadQuiz_Click(object sender, EventArgs e) { LinkButton linkUpdate = sender as LinkButton; GridViewRow grid = (GridViewRow)linkUpdate.NamingContainer; string tempID = gvViewQuiz.DataKeys[grid.RowIndex].Value.ToString(); ViewState["tempId"] = tempID; RenderXML RX = new RenderXML(); DataSet ds = RX.XMLContent(tempID); XmlDoc.LoadXml(ds.Tables[0].Rows[0]["XmlFile"].ToString()); //string QuizTitle = gvViewQuiz.SelectedRow.Cells[3].Text; string filePath = Server.MapPath(DateTime.Now.ToString("yyyyMMddHHmmss") + ".xqz"); XmlDoc.Save(filePath); string fileName = DateTime.Now.ToString("yyyyMMddHHmmss") + ".xqz"; Response.AppendHeader("content-disposition", "attachment; filename=" + fileName); string type = ""; if (type != "") { Response.ContentType = type; } Response.WriteFile(filePath); Response.End(); XmlDoc.Save(Response.OutputStream); }
private void ViewQuizPopUp() { RenderXML RX = new RenderXML(); DataSet ds = RX.XMLContent(ddlVersion.SelectedValue.ToString()); XmlDoc.LoadXml(ds.Tables[0].Rows[0]["XmlFile"].ToString()); ns = new XmlNamespaceManager(XmlDoc.NameTable); ns.AddNamespace("ns", "urn:Question-Schema"); string xpath = "/ns:Quiz"; XmlNodeList QuizNode = XmlDoc.SelectNodes(xpath, ns); //string x= XmlDoc.InnerXml; //DataSet ds1 = new DataSet(); //ds1.ReadXml(new StringReader(x)); // string serverPath = Server.MapPath(".") + "\\XSLT_Files\\"; // XmlDataSource xmlDS = new XmlDataSource(); // xmlDS.Data = XmlDoc.OuterXml; //xmlDS.TransformFile = serverPath + "QuestionX.xslt"; // xmlDS.XPath = "Quiz"; DLExamDemo.DataSource = QuizNode; DLExamDemo.DataBind(); DLExamDemoFillBlanks.DataSource = QuizNode; DLExamDemoFillBlanks.DataBind(); DLExamDemoTrueFalse.DataSource = QuizNode; DLExamDemoTrueFalse.DataBind(); MPE1.Show(); }