在线考试系统毕业论文(软件工程完整版) 下载本文

sender,EventArgs e) {

if(TreeView1.SelectedNode.Text==\退出系统\) {

Response.Write(\

language=javascript>window.close();location=\)'\); } } }

B类试题添加模块

选择完考试试题所属专业、课程及套题后 ,进入试题添加页面。设计效果将如下所示:

代码为:

using System.Data.SqlClient:

public partial class HouAdmin_InsertShiTi:System.Web.UI.Page {

Datacon dataconn=new Dataconn();

protected void Page_Load(object sender,EventArgs e) {

if(ddlType.SelectedIndex==0) {

Panel.Visible=true; Pane2.Visible=false;

32

} else {

Panel.Visible=false; Panel.Visible=true; } }

protected void btnAdd_Click(object sender,EventArgs e) {

string sstr1=Session[\].ToString(); string sstr2=Session[\].ToString(); string sstr3=Session[\].ToString(); if(ddlType.SelectedIndex==0) {

dataconn.eccom(\

\ ,optionB,optionC,optionD,que_answer,note)\

+\+sstr1+\+sstr2+\+sstr3+\+this.txtExamTitle.Text

+\+ddlType.Text+\+this.txtExamA.Text+\+this.txtExamB.Text +\+this.txtExamC.Text+\+this.txtExamD.Text+\ +ddlAnswer.Text+\+txtInstructon.Text+\);

//Response.Write(\添加成功!‘)

:location=’kaoshi_timu.aspx'\ Response.Redirect(\ } else {

if(cb1Answer.Items[0].Selected==true&&cblAnswer.Items[1].Selected==true

&&cblAnswer.Items[2].selected==true&&cblAnswer.Item[3].Selected==true)

{

string str1=\;

dataconn.eccom(\ +

\ optionD,que_answeer,note)\

33

+\sstr1+\+sstr2+\+sstr3+\+ this.txtExamTitle.Text

+\+this.txtExamA.Text+\+this.txtExamB.Text+\

+this.txtExamC.Text+\+this.txtExamD.Text+\+str1 +\+txtInstructiobn.Text+\); Response.Redirect(\); }

if(cblAnswer.Items[0].Selected==true&&cblAnswer.Items[1].Selected==true&&

cblAnswer.Items[2].Selected==true&&cblAnswer.Items[3].Selected==false)

{

string str2=\;

dataconn.eccom(\ \,

que_lessonid,que_taotiid,que_subject,que_type,optionA,optionB,optionC,

optionD,que_answer,note)\

+\+sstr1+\+sstr2+\+sstr3+\+ this.txtExamTitle.Text

+\+ddlType.Text+\+this.txtExamA.Text+\+this.txtExamB.Text+\+this.txtExamC.Text+\

this.txtExamD.Text+\+str2+\+txtInstruction.Text+\); Response.Redirect(\); }

if(cblAnswer.Items[0].Selected==true&&cblAnswer.Items[1].Selected==true&&

cblAnswer.Items[2].Selected==false&&cblAnswer.Items[3].Selected==false)

{

string str3=\;

dataconn.eccom(\ \,

que_lessonid,que_taotiid,que_subject,que_type,optionA,optionB,optionC,

optionD,que_answer,note)\

34

+\+sstr1+\+sstr2+\+sstr3+\+ this.txtExamTitle.Text

+\+ddlType.Text+\+this.txtExamA.Text+\+this.txtExamB.Text+\+this.txtExamC.Text+\

this.txtExamD.Text+\+str3+\+txtInstruction.Text+\); Response.Redirect(\); }

if(cblAnswer.Items[0].Selected==true&&cblAnswer.Items[1].Selected==true&&

cblAnswer.Items[2].Selected==false&&cblAnswer.Items[3].Selected==false)

{ string str4=\;

dataconn.eccom(\ \,

que_lessonid,que_taotiid,que_subject,que_type,optionA,optionB,optionC,

optionD,que_answer,note)\

+\+sstr1+\+sstr2+\+sstr3+\+ this.txtExamTitle.Text

+\+ddlType.Text+\+this.txtExamA.Text+\+this.txtExamB.Text+\+this.txtExamC.Text+\

this.txtExamD.Text+\+str4+\+txtInstruction.Text+\); Response.Redirect(\); }

if(cblAnswer.Items[0].Selected==true&&cblAnswer.Items[1].Selected==true&&

cblAnswer.Items[2].Selected==false&&cblAnswer.Items[3].Selected==false)

{

string str5=\;

dataconn.eccom(\ \,

que_lessonid,que_taotiid,que_subject,que_type,optionA,optionB,optionC,

optionD,que_answer,note)\

35