




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
IIIAbstractAbstractWiththedevelopmentofnetworkingtechnology,onlineexaminationanddistanceeducationisanaspectintheapplicationofinternet.Inrecentyearstheon-lineexaminationespecialofWeb-basedexaminationismoreandmorepopular.Thegraduationproject'ssubjectistodesignandrealizationoftheonlineexaminationsystem.Thesystemusesthebrowser/servertodevelop.Itincludeslogin,newuserregistration,on-lineexamination,examinationpaperset,examinationpapermanagement,scorestatistics,queryresultsandotherfunctional.ThesystemtakestheWindows7astheOS,TomcatasthewebServer,usesJSPtechnologyandMySQLastheDatabaseServerdevelopmenttoolstorealizethesystem.Inthispaper,therequirementanalysisabouttheonlineexaminationsystemisintroduced,andthengivethesystemdesignandimplementation.Finally,allofthefunctionsofthesystemistested.Keywords:On-lineExamination;Browse/Server;JSP;MySQL;JDBC;IIIIIII11.1系統(tǒng)開發(fā)背景11.2系統(tǒng)開發(fā)意義21.3系統(tǒng)開發(fā)工具392.1現(xiàn)狀分析92.2可行性分析102.3設(shè)計(jì)目標(biāo)112.4功能要求122.5系統(tǒng)開發(fā)環(huán)境配置14153.1數(shù)據(jù)庫設(shè)計(jì)153.2系統(tǒng)結(jié)構(gòu)設(shè)計(jì)203.3用戶界面設(shè)計(jì)21254.1數(shù)據(jù)庫連接的實(shí)現(xiàn)方法254.2登陸注冊(cè)模塊274.3考生模塊314.4教師模塊414.5管理員模塊53565.1什么是軟件測(cè)試565.2軟件測(cè)試的目標(biāo)與方法565.3測(cè)試內(nèi)容575.4系統(tǒng)的不足和展望585961JSP(JavaServerPages)是由SunMicrosystems1.3.3Tomcat介紹最新的Servlet和JSP規(guī)范總是能在Tomcat中得到體現(xiàn),Tomcat5支持最新的Servlet2.4和JSP2.0求。實(shí)際上Tomcat部分是Apache服務(wù)器的擴(kuò)展,但5.Web服務(wù)器:Tomcat6.0int否可否說明int可否說明question_idintcategory_idintsubjectintcategory_idchartest_timetest_resultintint長(zhǎng)度是否可question_numberintcontentType="text/html;charset=gb2312"%>Connectionconn=null;Statementstmt=null;ResultSetrs=null;try{Class.forName("com.mysql.jdbc.Driver");"jdbc:mysql://localhost/Myexam?user=root&pasDriverManager.getConnection(sConn);stmt=conn.createStatement();Stringquery="select*fromuser";rs=stmt.executeQuery(query);%>catch(Exceptione){System.out.println("erroroccured!!");}finally{rs.close();stmt.close();conn.close();}<scripttype="text/javascript">functioncheckForm(form){、if(form.teachername.value==""){form.teachername.focus();returnfalse;}if(form.password.value==""){form.password.focus();returnfalse;}returnture;}</script>通過JSP重定向語句response.sendRedirect()跳轉(zhuǎn)request.getParameter("username");Stringpassword=request.getParameter("password");Stringrealname=request.getParameter("realname");out.println(username);//打印出usernametry{Class.forName("com.mysql.jdbc.Driver").newInstance();");Statementstmt=conn.createStatement();ResultSetrs=null;Stringsql="select*fromuserwhereusernamelike'"+username+"'";rs=stmt.executeQuery(sql);StringStringStrings_realname=request.getParameter("realname");sql="insertinto','"+password+"','"+realname+"')";sess=(HttpSession)request.getSession(true);intcategory=(Integer)sess.getAttribute("category");request.getParameter("username");MysqlDjtDaomd=newMysqlDjtDao();//intvalid=if(valid==0){Calendarcl=Calendar.getInstance();//javautil包表提供longstarttime=cl.getTimeInMillis();//longendtime=starttime+1800000;sess.setMaxInactiveInterval(3600);//設(shè)置sess.setAttribute("username",username);sess.setAttribute("endtime",endtime);List<Integer>tmid=newArrayList<Integer>();//指定傳入的類型tmid.add(0);//設(shè)置默認(rèn)值0sess.setAttribute("tmid",tmid);intfenshu=0;sess.setAttribute("fenshu",fenshu);List<Integer>ddcount=newArrayList<Integer>();sess.setAttribute("ddcount",ddcount);List<Question>allwts=newArrayList<Question>();//建立問題question對(duì)應(yīng)List<Integer>listsId=md.selectQInfoCount(category);//某個(gè)科有多少intqnum=md.selectQNum(category);//共sess.setAttribute("qnum",qnum);Randomrand=newRandom();//Java提供的for(inta=0;a<qnum;a++){//開始抽題inthao=rand.nextInt(listsId.size()-1);//取一個(gè)隨機(jī)rand.nextInt()取一個(gè)隨for(Integervd:tmid){//去掉重復(fù)的題if(vd==hao){rand.nextInt(listsId.size()-1);//如果重復(fù)再重}}intbcid=listsId.get(hao);//根據(jù)抽到md.selectQInfoByid(bcid);//根據(jù)Id號(hào)查詢題目的}sess.setAttribute("allwts",allwts);<jsp:forwardpage="questionEnter.jsp"/>}else{request.setAttribute("errorInfo","已<jsp:forwardpage="endQDG.jsp"/>}Stringcategory=request.getParameter("category");String[]result=null;intcount=0;Class.forName("com.mysql.jdbc.Driver").newInstance();Statementstmt=conn.createStatement();ResultSetrs=null;ResultSetrr=null;Stringsqlcount="selectcount(*)fromtest_recordwhere(category_id='"+category+"'andusername='"+s+"')";rr=stmt.executeQuery(sqlcount);if(rr.next()){count=Integer.parseInt(rr.getString(1));}result=newString[count];Stringsql="select*fromtest_recordwhere(category_id='"+category+"'andusername='"+s+"')";rs=stmt.executeQuery(sql);inti=0;while(rs.next()){result[i++]=rs.getString(1)+":"+rs.getString(2)+":"+rs.getString(3)+":"+rs.getString(4)+":"+rs.getString(5);<%for(intk=0;k<result.length;k++){%><%Stringsql2="selectcategory_namefromcategorywherecategory_id='"+category+"'";rs=stmt.executeQuery(sql2);Stringrs1=null;if(rs.next()){rs1=rs.getString(1);out.println(rs1);<%out.println(rs1);%><%=result[k].split(":")[3]%><%=result[k].split(":")[4]%>Stringquestion_id=request.getParameter("question_id");通過session把question_id傳到下個(gè)頁面session.setAttribute("question_id",question_id);Stringcategory=request.getParameter("category");String[]result=null;intcount=0;Class.forName("com.mysql.jdbc.Driver").newInstance();7");Statementstmt=conn.createStatement();ResultSetrs=null;ResultSetrr=null;Stringsqlcount="selectcount(*)fromquestionwherequestion_id='"+question_id+"'";rr=stmt.executeQuery(sqlcount);if(rr.next()){Integer.parseInt(rr.getString(1));}result=newString[count];Stringsql="select*fromquestionwherequestion_id='"+question_id+"'";rs=stmt.executeQuery(sql);inti=0;while(rs.next()){result[i++]=rs.getString(1)+":"+rs.getString(2)+":"+rs.getString(3)+":"+rs.getString(4)+":"+rs.getString(5)+":"+rs.getString(6)+":"+rs.getString(7)+":"+rs.getString(8)+":"+rs.getString(9);}Strings=(String)session.getAttribute("question_id");request.getParameter("category_name");Stringchoice_a=request.getParameter("choice_a");Stringchoice_b=request.getParameter("choice_b");Stringchoice_c=request.getParameter("choice_c");Stringchoice_d=request.getParameter("choice_d");Stringanswer=request.getParameter("answer");try{Class.forName("com.mysql.jdbc.Driver").newInstance();312");Statementstmt=conn.createStatement();ResultSetrs=null;Stringsql="updatequestionsetchoice_a='"+choice_a+"',choice_b='"+choice_b+"',choice_c='"+choice_c+"',choice_d='"+choice_d+"',subject='"+subject+"',answer='"+answer+"'wherequestion_id='"+s+"'";Stringsql="deletefromquestionwherequestion_id='"+question_id+"'";Stringcategory_id=request.getParameter("category");Stringsubject=request.getParameter("subject");Stringchoice_a=request.getParameter("choice_a");Stringchoice_b=request.getParameter("choice_b");Stringchoice_c=request.getParameter("choice_c");Stringchoice_d=request.getParameter("choice_d");Stringanswer=request.getParameter("answer");try{Class.forName("com.mysql.jdbc.Driver").newInstance();312");Statementstmt=conn.createStatement();ResultSetrs=null;Stringsql="select*fromquestionwherecategory_idlike'"+category_id+"'andsubjectlike'"+subject+"'";rs=stmt.executeQuery(sql);sql="insertintoquestion(category_id,subject,choice_a,choice_b,choice_c,choice_d,level,answer)values('"+category_id+"','"+subject+"','"+choice_a+"','"+choice_b+"','"+choice_c+"','"+choice_d+"','"+level+"','"+answer+"')";inttemp=stmt.executeUpdate(sql);Stringas=request.getParameter("category");Class.forName("com.mysql.jdbc.Driver").newInstance();7");Statementstmt=conn.createStatement();ResultSetra=null;ResultSetrb=null;ResultSetrc=null;ResultSetrd=null;ResultSetre=null;ResultSetrs=null;Stringsqlcount="selectcount(*)fromtest_recordwherecategory_id='"+as+"'ANDtest_result<'60'";ra=stmt.executeQuery(sqlcount);Stringresult=null;while(ra.next()){result=ra.getString(1);}Stringsqlcount1="selectcount(*)fromtest_recordwherecategory_id='"+as+"'ANDtest_result<='69'andtest_result>='60'";rb=stmt.executeQuery(sqlcount1);Stringresult1=null;while(rb.next()){result1=rb.getString(1);}Stringsqlcount2="selectcount(*)fromtest_recordwherecategory_id='"+as+"'ANDtest_result<='85'andtest_result>='70'";rc=stmt.executeQuery(sqlcount2);Stringresult2=null;while(rc.next()){result2=rc.getString(1);}Stringsqlcount3="selectcount(*)fromtest_recordwherecategory_id='"+as+"'ANDtest_result
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- GA/T 2158-2024法庭科學(xué)資金數(shù)據(jù)獲取規(guī)程
- NB/T 11532-2024煤礦水中多種元素(鉀、鈉、鈣、鎂、鉻、銅、鋅、鋇、鍶、鐵、鋁、鎵、鎳、釩、鍺、硼、磷、鈦、錳)含量的測(cè)定電感耦合等離子體發(fā)射光譜法
- HY/T 0433-2024海洋調(diào)查船舶危化品使用安全管理規(guī)范
- 貸款汽車購車合同協(xié)議
- 貨物托運(yùn)協(xié)議書范本
- 貨車有貸款轉(zhuǎn)讓合同協(xié)議
- 解除場(chǎng)地租用合同協(xié)議
- 起重機(jī)勞務(wù)合同協(xié)議
- 購車轉(zhuǎn)賣協(xié)議書范本
- 話費(fèi)賠償協(xié)議書模板
- 《工程勘察設(shè)計(jì)收費(fèi)標(biāo)準(zhǔn)》(2002年修訂本)
- 初二八年級(jí)下物理期中考試分析
- 金蝶K3-WISE財(cái)務(wù)管理全操作手冊(cè)
- 磚砌隔油池施工方案
- 北京版小學(xué)二年級(jí)下冊(cè)期中考試數(shù)學(xué)試卷【含答案】
- 有子女離婚協(xié)議書手寫模板(2篇)
- 國(guó)家開放大學(xué)一網(wǎng)一平臺(tái)電大《建筑測(cè)量》實(shí)驗(yàn)報(bào)告1-5題庫
- 關(guān)于熊貓的資料
- GB/Z 41921-2022視障者用輔助器具盲道
- PEP-3心理教育量表-評(píng)估報(bào)告
- 斷指再植術(shù)后護(hù)理及血運(yùn)觀察課件
評(píng)論
0/150
提交評(píng)論