大二下12c个人项目_第1页
大二下12c个人项目_第2页
大二下12c个人项目_第3页
大二下12c个人项目_第4页
大二下12c个人项目_第5页
已阅读5页,还剩35页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

目录绪 目录绪 课题背 课题研究现 课题研究的意 文档的内 需求分 需求陈 业务流 系统设 系统功能设 数据库设 系统实 登陆界 选择考试界 计算机考试界 后台管理界 试题管理界 结 11Interent的模拟考试系统1996美国的NTU、英国的OPENCOLLEGE都是当时十分典型的网络教育示22333-11233-11234表3-312345671234512345表3-3123456712345123453-43-53-612123456712343-43-53-6121234567123456744在线考试namespace{publicpartialclassfrmLogin:{public{}privatevoidbtnReturn_Click(objectsender,EventArgs{{publicpartialclassfrmLogin:{public{}privatevoidbtnReturn_Click(objectsender,EventArgs{}privatevoidbtnLogin_Click(objectsender,EventArgs{if(txtUserName.Text.Trim()=={}if(txtUserPwd.Text.Trim()=={}DBHelperdb=newstringQuery="select*fromexamUserInfowhere+"examUserName='"++"'andexamUserPwd='"+txtUserPwd.Text+"'";SqlDataReaderdr=db.MyQuery(Query);if{stringQuery1="selectexamUserRightfromexamUserInfo"+"examUserName='"+txtUserName.Text+"'";SqlDataReaderdr1=db.MyQuery(Query1);if{if(dr1["examUserRight"].ToString().Trim(){frmUserMainfUserMain=newfrmUserMain();fUserMain.UserName=txtUserName.Text;fUserMain.UserPwd=txtUserPwd.Text;}elseif(dr1["examUserRight"].ToString().Trim(){frmManageMainfUserMain.UserPwd=txtUserPwd.Text;}elseif(dr1["examUserRight"].ToString().Trim(){frmManageMainfManageMain=newfrmManageMain();fManageMain.UserName=txtUserName.Text;fManageMain.UserPwd=txtUserPwd.Text;}}}{}}privatevoidbtnAdd_Click(objectsender,{frmRegisterfRegister=newfrmRegister();}}}namespace{publicpartialclassfrmUserMain:{publicstringstring{}EventArgse){frmUpdatePwdpublicstringstring{}EventArgse){frmUpdatePwdfUpdate=newfrmUpdatePwd();fUpdate.UserName=this.UserName;fUpdate.UserPwd=this.UserPwd;}EventArgse){frmCompTestfCompTest=newfrmCompTest();fCompTest.UserName=this.UserName;}{frmQueryfQuery=new}privatevoidEToolStripMenuItem_Click(objectsender,EventArgs{}privatevoidEToolStripMenuItem_Click(objectsender,EventArgs{}{=}}namespace{publicpartialclass{:namespace{publicpartialclass{:{CNO=newContent=newKeyA====newuserAnswer=newintNumber=0;intScore=0;string}publicinttime=privatevoidbutton1_Click(objectsender,EventArgs{txtTimer.Text=GetTime(time);button1.Enabled=false;DBHelperdb=newDBHelper();stringdelTest="deletefromexamTestprivatevoidbutton1_Click(objectsender,EventArgs{txtTimer.Text=GetTime(time);button1.Enabled=false;DBHelperdb=newDBHelper();stringdelTest="deletefromexamTest";stringdelAnswer="deletefromexamUserAnswerselecttop*stringaddTest="insertintoexamTestexamEngRadioInfoorderbyNEWID()"; examTest.CNO,nullfromexamTeststringQueryTest="select*fromexamTestSqlDataReaderdr=db.MyQuery(QueryTest);inti=0;while{CNO[i]=dr["CNO"].ToString();Content[i]=dr["Content"].ToString();=====}i=}privatevoidtimer1_Tick(objectsender,{time-=txtTimer.Text=(time=={for(inti=0;i<=19;privatevoidtimer1_Tick(objectsender,{time-=txtTimer.Text=(time=={for(inti=0;i<=19;{if(userAnswer[i]=={Score+=}{}}DBHelperdb=newstringnow==examUserScore(examUserName,examType,examUserScore,examUserTime)"valuesUserNameScore+frmUserMainfUserMain=newfrmUserMain();}}publicstringGetTime(int{stringmm,intm/%=<intif{mm=0}{mm=}intm/%=<intif{mm=0}{mm=}if(s<{=0+}{=}mm+":"+}publicvoidShowChoose(inti)//{rrtbContent.Text=rbtnKeyA.Text===}privatevoid{sender,EventArgstxtName.Text=}privatevoidbtnFirst_Click(objectsender,EventArgs{Number=0;}privatevoidbtnLast_Click(objectsender,EventArgstxtName.Text=}privatevoidbtnFirst_Click(objectsender,EventArgs{Number=0;}privatevoidbtnLast_Click(objectsender,EventArgs{Number=19;}sender,EventArgsprivatevoid{if(Number=={}{}}sender,EventArgsprivatevoid{if(Number=={}{}}privatevoid{userAnswer[Number]="A";DBHelperdb=new}{}}privatevoid{userAnswer[Number]="A";DBHelperdb=newDBHelper();sender,EventArgs"stringupdate="updateexamUserAnswerset+"whereCNO='"+CNO[Number]+"'";}privatevoidrbtnKeyB_Click(objectsender,EventArgs{userAnswer[Number]="B";DBHelperdb=newDBHelper();stringupdate="updateexamUserAnswerset+"whereCNO='"+CNO[Number]+"'";}"privatevoidrbtnKeyC_Click(objectsender,EventArgs{userAnswer[Number]="C";DBHelperdb=newDBHelper();stringupdate="updateexamUserAnswerset"+"whereCNO='"+CNO[Number]+}privatevoidrbtnKeyD_Click(objectsender,EventArgs{userAnswer[Number]="D";DBHelperdb=newDBHelper();stringupdate="updateexamUserAnswerset+"whereCNO='"+"whereCNO='"+CNO[Number]+}privatevoidrbtnKeyD_Click(objectsender,EventArgs{userAnswer[Number]="D";DBHelperdb=newDBHelper();stringupdate="updateexamUserAnswerset+"whereCNO='"+CNO[Number]+"'";}"voidbtnSubmit_Click(object{{(inti=0;i<=19;if(userAnswer[i]=={Score+=}{}}DBHelperdb=newstringnow==examUserScore(examUserName,examType,examUserScore,examUserTime)+"values('"+UserName+"','英语',"+ScorefrmUserMainfUserMain=new+now}}}}}}usingusingnamespace{publicpartialclassfrmManageMain:{usingusingnamespace{publicpartialclassfrmManageMain:{{stringUserName;stringUserPwd;}privatevoid{}sender,EventArgsEventArgse){frmAddManagefAddManage=new}{frmDeleteUserfDeleteUser=newfrmDeleteUser();}{frmQueryUserfQueryUser=new{frmQueryUserfQueryUser=newfrmQueryUser();}privatevoidsender,{frmUpdatePwdfUpdatePwd=newfrmUpdatePwd();fUpdatePwd.UserName=this.UserName;fUpdatePwd.UserPwd=this.UserPwd;}EventArgsprivatevoidtoolStripMenuItem1_Click(object{frmManageRadiofManageRadio=newfrmManageRadio();}}}namespacenamespace{publicpartialclassfrmManageRadio:{public{}privatevoidfrmManageRadio_Load(objectsender,EventArgs{if(cbbSubject.Text{SqlConnectionconn=newSqlConnection();conn.ConnectionString=DBHelper.getConnectionString();SqlDataAdapterda=newSqlDataAdapter("selectCNOas题号,Contentas题目内容,"+"KeyAas选项A,KeyBas选项B,KeyCas选项C,KeyDas选项D,Answeras答案from"+"examCompRadioInfo",conn);DataSetds=newDataSet();dataGridView1.DataSource=}elseif(cbbSubject.Text{SqlConnectionconn=newSqlConnection();conn.ConnectionString=DBHelper.getConnectionString();SqlDataAdapterda=newSqlDataAdapter("selectCNOas题号,Contentas题目内容,"+"KeyAas选项A,KeyBas选项B,KeyCas选项C,KeyDas选项D,Answeras答案from"+"examEngRadioInfo",conn);DataSetds=newDataSet();dataGridView1.DataSource=}}DataGridViewCellEventArgs{=======}privatevoidbtnReturn_Click(objectsender,{frmManageMainfManageMain}DataGridViewCellEventArgs{=======}privatevoidbtnReturn_Click(objectsender,{frmManageMainfManageMain=newfrmManageMain();}privatevoidbtnAdd_Click(objectsender,EventArgs{(txtCNO.Text.Trim()=={}if(txtAnswer.Text.Trim()=={}{(rtbContent.Text.Trim()==}{(rtbKeyA.Text.Trim()==}{(rtbKeyB.Text.Trim()==}{(rtbKeyC.Text.Trim()==}{(rtbKeyA.Text.Trim()==}{(rtbKeyB.Text.Trim()==}{(rtbKeyC.Text.Trim()==}{(rtbKeyD.Text.Trim()==}{(cbbSubject.TextDBHelperdb=newstringQueryCno="select*fromexamCompRadioInfoSqlDataReaderdr=db.MyQuery(QueryCno);if(dr.Read()){}{where+txtCNO.TextstringQueryContent="Select*fromexamCompRadioInfowhereContent='"+rtbContent.Text+"'";dr=db.MyQuery(QueryContent);if(dr.Read()){DialogResultresultMessageBox.Show("已存在相同内容试题,是否仍要添加试题?","提示",MessageBoxButtons.YesNo,if(result=={stringaddTest="insertinto++"','"+if(result=={stringaddTest="insertinto++"','"++"','"+rtbKeyA.Text+"','"++"','"rtbKeyC.Text+"','"+rtbKeyD.Text+"','"+txtAnswer.Text+"')";frmManageRadio_Load(sender,}{}}{string= ++"','"++"','"+rtbKeyA.Text+"','"+rtbKeyB.Text"','"+rtbKeyC.Text+"','"+rtbKeyD.Text+"','"+txtAnswer.Text+}}}elseif(cbbSubject.Text{DBHelperdb=newwherestringQueryCno="select*fromexamEngRadioInfoSqlDataReaderdr=db.MyQuery(QueryCno);if(dr.Read()){}{+txtCNO.TextstringQueryContent="Select*fromexamEngRadioInfowhereContent='"+rtbContent.Text+"'";dr=db.MyQuery(QueryContent);if(dr.Read()){DialogResultresultMessageBox.Show("已存在相同内容试题,是否仍要添加试题?","提示",MessageBoxButtons.YesNo,if(result=={stringaddTest=dr=db.MyQuery(QueryContent);if(dr.Read()){DialogResultresultMessageBox.Show("已存在相同内容试题,是否仍要添加试题?","提示",MessageBoxButtons.YesNo,if(result=={stringaddTest="insertinto++"','"++"','"+rtbKeyA.Text+"','"++"','"rtbKeyC.Text+"','"+rtbKeyD.Text+"','"+txtAnswer.Text+"')";frmManageRadio_Load(sender,}{}}{ = ++"','"++"','"+rtbKeyA.Text"','"+rtbKeyB.Text"','"+rtbKeyC.Text+"','"+rtbKeyD.Text+"','"+txtAnswer.Text+}}}}privatevoidcbbSubject_SelectedValueChanged(objectsender,{if(cbbSubject.Text{SqlConnectionconn=newSqlConnection();conn.ConnectionString=DBHelper.getConnectionString();SqlDataAdapterda=new号,Contentas题目内容,"+"KeyAas选项A,KeyBasD,AnswerasfromexamCompRadioInfoDataSetds=newSqlDataAdapter("selectSqlDataAdapterda=new号,Contentas题目内容,"+"KeyAas选项A,KeyBasD,AnswerasfromexamCompRadioInfoDataSetds=newSqlDataAdapter("selectCNOas选项B,KeyCas选项C,KeyDas选项da.Fill(ds,"examCompRadioInfo");dataGridView1.DataSource=ds.Tables[0];}elseif(cbbSubject.Text{SqlConnectionconn=newSqlConnection();conn.ConnectionString=DBHelper.getConnectionString();SqlDataAdapterda=newSqlDataAdapter("selectCNOas题号,Contentas题目内容,"+"KeyAas选项A,KeyBas选项B,KeyCas选项C,KeyDas选项D,Answeras答案fromexamEngRadioInfo",conn);DataSetds=newDataSet();dataGridView1.DataSource=}}privatevoidbtnQuery_Click(objectsender,EventArgs{if(cbbSubject.Text{if(txtQueryStr.Text.Trim()=={SqlConnectionconn=newSqlConnection();conn.ConnectionString=DBHelper.getConnectionString();SqlDataAdapterda=new号,Contentas题目内容,""KeyAasA,KeyBasD,Answeras答案from"+"examCompRadioInfoSqlDataAdapter("selectCNOas题选项B,KeyCas选项C,KeyDasDataSetds=newDataSet();dataGridView1.DataSource=}{SqlConnectionconn=newconn.ConnectionString=conn.ConnectionString=DBHelper.getConnectionString();SqlDataAdapterda=newSqlDataAdapter("selectCNOas题号,Contentas题目内容,""KeyAasA,KeyBasB,KeyCasC,KeyDasD,Answeras答案from"+"examCompRadioInfowhereCNO='"+txtQueryStr.Text+DataSetds=newDataSet();dataGridView1.DataSource=}}elseif(cbbSubject.Text{if(txtQueryStr.Text.Trim()=={SqlConnectionconn=newSqlConnection();conn.ConnectionString=DBHelper.getConnectionString();SqlDataAdapterda=newSqlDataAdapter("selectCNOas题号,Contentas题目内容,""KeyAasA,KeyBasB,KeyCasC,KeyDasD,Answeras答案from"+"examEngRadioInfo",conn);DataSetds=newDataSet();dataGridView1.DataSource=}{SqlConnectionconn=newSqlConnection();conn.ConnectionString=DBHelper.getConnectionString();SqlDataAdapterda=newSqlDataAdapter("selectCNOas题号,Contentas题目内容,""KeyAasA,KeyBasB,KeyCasC,KeyDasD,Answeras答案from"+"examEngRadioInfowhereCNO='"+txtQueryStr.Text+DataSetds=newDataSet();dataGridView1.DataSource=}}privatevoidbtnDel_Click(objectsender,EventArgs{if(txtCNO.Text.Trim()=={}if(cbbSubject.Text{}}privatevoidbtnDel_Click(objectsender,EventArgs{if(txtCNO.Text.Trim()=={}if(cbbSubject.Text{DBHelperdb=newstringQuery="select*fromexamCompRadioInfowhere+txtCNO.Text+SqlDataReaderdr=db.MyQuery(Query);if(dr.Read()){DialogResultresultMessageBox.Show("是否删除该条记录的"提示",MessageBoxButtons.YesNo,if(result=={stringnonQuery="deletefrom+txtCNO.Text+"'";txtQueryStr.Text="";frmManageRadioLoad(sender,e);}{}}{}}elseif(cbbSubject.Text{DBHelperdb=newstringQuery="select*fromexamEngRadioInfowhere+txtCNO.Text+SqlDataReaderdr={DBHelperdb=newstringQuery="select*fromexamEngRadioInfowhere+txtCNO.Text+SqlDataReaderdr=db.MyQuery(Query);if(dr.Read()){DialogResultresultMessageBox.Show("是否删除该条记录的"提示",MessageBoxButtons.YesNo,if(result=={stringnonQuery="deletefrom+txtCNO.Text+"'";txtQueryStr.Text="";frmManageRadio_Load(sender,e);}{}}{}}}voidbtnUpdate_Click(objectsender,{if(txtCNO.Text.Trim()=={}if(txtAnswer.Text.Trim()=={}{(rtbContent.Text.Trim()==}{(rtbKeyA.Text.Trim()==}{}{(rtbContent.Text.Trim()==}{(rtbKeyA.Text.Trim()==}{(rtbKeyB.Text.Trim()==}{(cbbSubject.TextDBHelperdb=newstringQueryCno="select*fromexamCompRadioInfowhere+txtCNO.Text+SqlDataReaderdr=db.MyQuery(QueryCno);if(!dr.Read()){}{DialogResultresultMessageBox.Show("确认修改试题?","提示",MessageBoxButtons.YesNo,==if{updateContent="updatesetContent='"+rtbContent.Text+"'whereCNO='"+txtCNO.Text+stringupdateKeyA="updateexamCompRadioInfosetKeyA='"+rtbKeyA.Text+"'whereCNO='"+txtCNO.Text+"'";stringupdateKeyB="updateexamCompRadioInfowhereCNO='"+txtCNO.Text+"'";stringupdateKeyC="updateexamCompRadioInfowhereCNO='"+txtCNO.Te

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论