freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

java課程設(shè)計(jì)基于jsp的網(wǎng)上考試系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)-資料下載頁

2025-06-28 08:05本頁面
  

【正文】 nswer = (choiceAnswer+i)。 //計(jì)算考生得分int score=((stuAnswer))?():0。 (qid)。 (uid)。 (course)。 (score)。 (stuAnswer)。 (type)。 (tnumber)。 (test)。 } boolean success = (al)。2. 數(shù)據(jù)庫的連接建立數(shù)據(jù)庫連接和關(guān)閉數(shù)據(jù)庫連接操作方法代碼及說明如下,這些方法位于DBAccess類中,當(dāng)作工具類來用。static{//靜態(tài)代碼塊,在類被實(shí)例化時(shí)被調(diào)用,且只被調(diào)用一次 try{ ()。//注冊驅(qū)動(dòng) }catch(ClassNotFoundException e) { throw new ExceptionInInitializerError(e)。 }}//得到連接 public Connection getConnection() { try{ String url = jdbc:sqlserver://localhost:1433。databaseName=ExamOnline。 // MySQL配置時(shí)的用戶名 String user = sa。 // MySQL配置時(shí)的密碼 String password = zaq123456。 // 連續(xù)數(shù)據(jù)庫 conn = (url, user, password)。 }catch(Exception e) { ()。 (())。 } return conn。 }//關(guān)閉數(shù)據(jù)庫連接public void CloseDB(Connection conn,Statement sm,ResultSet rs) { try { if(rs!=null) { ()。 } }catch (Exception e) { ()。 (數(shù)據(jù)庫關(guān)閉失?。?。 }finally { try{ if(sm!=null) { ()。 } }catch(Exception e) { ()。 (數(shù)據(jù)庫關(guān)閉失??!)。 }finally { try{ if(conn!=null) { ()。 } }catch(Exception e) { ()。 (數(shù)據(jù)庫關(guān)閉失??!)。 } } }}3. 成績查詢public ArrayList getAll(String Uid) { ArrayList al = new ArrayList()。 Connection conn = new DBAccess().getConnection()。 PreparedStatement ps = null。 ResultSet rs = null。 try { String sql = select * from record where Uid=?。 ps = (sql)。 (1, Uid)。 rs = ()。 while(()) { Record record = new Record()。 ((1))。 ((2))。 ((3))。 ((4))。 ((5))。 ((6))。 ((7))。 ((8))。 (record)。 } }catch(Exception e) { ()。 }finally { new DBAccess().CloseDB(conn, ps, rs)。 return al。 } }4. 試題維護(hù)//獲取課程名稱,由于課程名稱可能包含有漢字,所以要對(duì)其進(jìn)行編碼,這里我們用gbk進(jìn)行編碼String kemu = (kemu).trim()。 String ch_course = course+kemu。 String course = new String((ch_course).getBytes(iso88591),gbk)。 //獲取題目類型 int type = ((type).trim())。 String ques = new String((ques).getBytes(iso88591),gbk)。 //選項(xiàng)A String keyA = null。 //選項(xiàng)B String keyB = null。 //選項(xiàng)C String keyC = null。 //選項(xiàng)D String keyD = null。 //參考答案 String answer = 。 QuestionUtil qu = new QuestionUtil()。 Question question = new Question()。 if(type==1)//單選題 { keyA = new String((keyA).getBytes(iso88591),gbk).trim()。 keyB = new String((keyB).getBytes(iso88591),gbk).trim()。 keyC = new String((keyC).getBytes(iso88591),gbk).trim()。 keyD = new String((keyD).getBytes(iso88591),gbk).trim()。 answer = (answer_sin).trim()。 }else if(type==2)//多選題 { keyA = new String((keyA).getBytes(iso88591),gbk).trim()。 keyB = new String((keyB).getBytes(iso88591),gbk).trim()。 keyC = new String((keyC).getBytes(iso88591),gbk).trim()。 keyD = new String((keyD).getBytes(iso88591),gbk).trim()。 String[] str_answer = (answer_mul)。 for(int i = 0。i 。i++) { answer = answer + str_answer[i]。 } }else if(type==3)//判斷題 { answer = (answer_jud)。 }else//簡答題,設(shè)計(jì)題 { answer = new String((answer_other).getBytes(iso88591),gbk).trim()。 } (course)。 (type)。 (ques)。 (keyA)。 (keyB)。 (keyC)。 (keyD)。 (answer)。 boolean success = (question)。 if(success) { (()+/admin/)。 }else { (()+/)。 }5. 考試設(shè)置//獲取課程名稱,同樣這里用gbk對(duì)接收到的信息進(jìn)行編碼String course = new String((course).getBytes(iso88591),gbk)。//獲取單選題總數(shù) int singleCount =((singleCount))。 //獲取單個(gè)單選題分值 int perSingle = ((perSingle))。 //獲取多選題總數(shù) int multiplyCount=((multiplyCount))。//獲取單個(gè)多選題分值 int perMultiply = ((perMultiply))。 //獲取判斷題總數(shù) int judgeCount = ((judgeCount))。//獲取單個(gè)判斷題分值 int perJudge = ((perJudge))。 //獲取簡答題總數(shù)int jdCount = ((jdCount))。 //獲取單個(gè)簡答題分值int perJd = ((perJd))。 //獲取設(shè)計(jì)題總數(shù) int programCount = ((programCount))。 //獲取單個(gè)設(shè)計(jì)題分值 int perProgram = ((perProgram))。 //獲取總考試時(shí)間int totalTime = ((totalTime))。 int flag = ((flag))。 TestSetUtil tsu = new TestSetUtil()。 TestSet ts = new TestSet()。 (course)。 (singleCount)。 (perSingle)。 (multiplyCount)。 (perMultiply)。 (judgeCount)。 (perJudge)。 (jdCount)。 (perJd)。 (programCount)。 (perProgram)。 (totalTime)。 boolean success = (ts, flag)。 if(success) { (()+/admin/TestSucces )。 }else { (()+/)。}6. 用戶更新//獲取用戶名,這里也用gbk對(duì)其進(jìn)行編碼String name=new String((name).getBytes(iso88591),gbk).trim()。//獲取用戶類型,1為學(xué)生,2為教師,3為管理員 int type=((type))。 //獲取性別,用gbk對(duì)其進(jìn)行編著碼String sex=new String((sex).getBytes(iso88591),gbk).trim()。 String password = 123456。//初始密碼設(shè)為123456 //獲取操作標(biāo)志,0為添加用戶信息,1為更新用戶信息 String flag = (flag).trim()。 UserUtil userUtil = new UserUtil()。 User user = new User()。 boolean success = false。 (Uid)。 (type)。 (name)。 (password)。 (sex)。 if(0.equals(flag))//添加用戶 { success= (user)。 }else if(1.equals(flag))//更新用戶 { success=(user)。 } if(success){ (()+/admin/)。 } else { (()+/)。
點(diǎn)擊復(fù)制文檔內(nèi)容
外語相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1