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

DataRow[]row1=myds3.Tables[0].Select(); //计算机单选题成功

foreach(DataRow answer1 in row1) {

int_row1+=1;

if(int_row1<=3) {

RadioButton

rb1=(RadioButtonList)(DataList.Items[int_row1-1].FindControl(\ttonList1\));

if(rb1.SelectedValue==\) {

this.lblSel.Text=\; } else {

if(answer1[\].ToString().Trim()==rb1.SelectedValue.ToString().Trim())

{ int_row1Point+=40/DataList.Items.Count; this.lblSel.Text=int_row1Point.ToString(); } } } }

break;

//核对多选题答案 case 4:

SqlDataAdapter myadapter4=new SqlDataAdapter(\

+\多选题’and que_lessonid=\

+ddl+\+dd2+\desc\,con);

DataSet myds4=new DataSet(); myadapter4.Fill(myds4);

DataRow[]row2=myds4.Tables[0].Select(); //计算多选题成绩

foreach(DataRow answer2 in row2) {

28

int_row2+=1; if(int_row2<=3) {

CheckBoxList

cb1=(CheckBoxList)(DataList2.Items[int_row2-1].FindControl(\ist1\));

if(cb1.SelectValue==\) {

lbIDSel.Text=\; } else {

this.TextBox1.Text=\;

for(int q=0;q

if(cb1.Items[q].Selected==true) { this.TextBox1.Text=TextBox1.Text.Trim()+

cb1.Items[q].Value+\; } }

if(answer2[\].ToString().Trim()+\==

this.TextBox1.Text.Trim()) {

int_row2Point+=60/DataList2.Items.Count;

this.lblDsel.Text=int_row2Point.ToString(); } } } }

break; } }

//******************退出当前系统*******************// protected voidbtnExit_Click(object sender,EventArgs e) {

Response.Write(\

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

29

6.3.4试题添加模块

A类试题添加模块

在专业所对应的课程和套题下进行。先对专业、课程和套题进行条件然后添加试题

代码为:

using System.Data.SqlClient

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

Datacon dataconn=new Datacon();

protected void Page_Load(object sender,EventArgs e) {

if(!IsPostBack)//判断页面是否首次加载 {

//调用ecDropDownList方法,绑定下拉列表数据

dataconn .ecDropDownList(ddlProfession,\tb_Profession\,\,\); GetDropDownList(); }

this.Labe5.Visible=false; }

protected void btnSelect_Click(object sender,EventArgs e) {

Session[\]=ddlProfession.Text; Session[\]=ddlLesson.Text; Session[\]=ddlQueName.Text; if(this.ddlLesson.Text==\) {

30

//this.Label3.Text=\请选择考试课程“; this.Labe3.Visible=true; return; }

if(this.ddlQueName.Text==\) {

//this.Label5.Text=\请先添加考试试题!\ this.Lable5.Visible=true; return; }

Page.Response.Redirect(\); }

protected void Button2_Click(object sender,EventArgs e) {

Page.Response.Redirect(\); }

protected void ddlProfession_SelectedIndexChanged(object sender,EventArgs e) {

GetDropDownList(); }

public void GetDropDownList() {

//调用ecDropDownList方法,绑定考试专业信息 dataconn.ecDropDownList(ddlLesson,\tb_Lesson where ofProfession=\

+ddlProfession.SelectedValue.ToString()+\,\,\); dataconn.ecDropDownList(ddlQueName,\from tb_taoti as a

join tb_Lesson as b on a.LessonID=b.ID where a.LessonID=\ +ddlLesson.SelectValue.ToString()+\b.ofProfession=\

+ddlProfession_SelectedValue.ToString()+\,\,\); }

protected void ddlLesson_SelectIndexChange(object sender,EventArgs e) {

//调用公共类中的ecDropDownList方法,绑定考试课程

dataconn.ecDropDownList(ddlQueName,\ID=\

ddlLesson_SelectedValue.ToString()+\,\,\); }

protected void TreeView 1_SelectedNodeChanged(object

31