【正文】
)實現(xiàn)頁面的初始化過程, 函數(shù)代碼如下: private void BindQuestionData() { ArrayList QuestionIDList = new ArrayList()。//從 Session中 取一套試卷 if(Session[+Session[UserName]]!=null) 第 21 頁 共 25頁 { QuestionIDList=(ArrayList)Session[+Session[UserName]]。 } List questionList = (IList)(QuestionIDList)。 //創(chuàng)建問題的數(shù)據(jù)源 = questionList。 = QuestionID。 // 設置控件的試題索引 ()。ShowPageStatus()。 } 問題 DataGrid控件綁定數(shù)據(jù)時 ,采用 IList接口對象作為數(shù)據(jù)源。此數(shù)據(jù)源由類 QuestionDB的函數(shù) GetQuestion()函數(shù)創(chuàng)建,該函數(shù)的參數(shù)為 ArrayList類型的對象 QuestionList,它包含整套試卷的所有試題 ID,函 數(shù) GetQuestions()使用 for語句從表中獲取每個試題的詳細信息。函數(shù) GetQustions()的代碼如下: public ArrayList GetQuestions(ArrayList QuestionList) { for(int i = 0。 i 。 i++) { SqlDataReader recq = (QuestionID)。 if(()) { QuestionDetails questionDetail = new QuestionDetails()。 =recq[Title].ToString()。 =recq[PictureUrl].ToString()。 =i+1。 (questionDetail)。 } return(NewQuestionList)。 ///返回 問題的詳細信息 } 在此循環(huán)中使用 GetSingleQuestion()從 Questions表中獲取單個問題的詳細信息 ,然后把詳細信息保存 到 QuestionDetails對象中 ,最后函數(shù)把所有的題目的詳細信息構建為一個 ArrayList對象。并在函數(shù)的最后返回此對象 。 函數(shù) GetQuestions()僅僅綁定試卷的問題,沒有綁定每個試題的選擇答案,函數(shù) GetAnswers()和函數(shù) BindAnswerList()實現(xiàn)該功能。函數(shù) GetAnswers()屬于數(shù)據(jù)訪問層函數(shù),它需要參數(shù) QustionID從 Answers表取到屬于 QuestionID的問題答案,并把試題答案傳遞到應用程序的頁面呈現(xiàn)層。 在函數(shù) GetAnswers()基礎上 ,應用程序的頁面呈現(xiàn)就可以使用該函數(shù)從數(shù)據(jù)庫獲取試題答案,并把試題綁定到每個相應的問題,綁定試題答案函數(shù)BindAnswer()實現(xiàn),它的參數(shù)為 RadioButtonList控件。函數(shù)代碼如下: private void BindAnswerList(RadioButtonList radioList,int nQuestionID) { SqlDataReader reca = (nQuestionID)。 = reca。 = Body。 第 22 頁 共 25頁 = AnswerID。 ()。 if( 0) { = 0。 =null。}} 在數(shù)據(jù)綁定時,問題 DataGrid控件觸發(fā)事件 QuestionList_ItemDataBound(),并在事件中調用函數(shù) BindAnswerList()綁定問題答案數(shù)據(jù)。綁定數(shù)據(jù)如下: 通過參數(shù) e的函數(shù) FindControl()找到需要綁定數(shù)據(jù)的 RadioButtonList控件,命名為 answerList。 判斷 answerList控件是否為空,若為空,則中止函數(shù)。若 answerList控件不為空,則調用函數(shù) BindAnserList()綁定控件的答案數(shù)據(jù)。 5. 8自動閱卷 單擊“上一題”或“下一題”按鈕 觸發(fā)事件 QuestionList_ItemCommand(),該事件實現(xiàn)了跳轉到下一題,自動獲取上一題的選項,并判斷該選項是否正確。以此類推,有多少道試題就執(zhí)行多少次,直到做完為止。最后統(tǒng)計考生成績,并保存到數(shù)據(jù)庫中,以方便考生在交卷時就能看到自己的考試成績。事件代碼如下: private void QuestionList_ItemCommand(object source,DataGridArgs e) { if( 1) { Choose = 。 } AnswerDB answerbody = new AnswerDB()。 SqlDataReader body = ()。 if(()){(userId,mark)} } } 考生單擊“交卷”觸發(fā)事件 refer_click(),該事件跳轉到考試結果頁面。并顯示考生的相關信息。 5. 9考試結果 考試結果由頁面 現(xiàn),該頁面實現(xiàn)了考試結果,考生在交卷后就能看到自己當前的考試成績。系統(tǒng)自動判斷此次考試是否合格。考試結果如圖12所示: 圖 12 考試結果 第 23 頁 共 25頁 結 論 在通過幾月的認真學習 Microsoft Visual 程序設計,使用 .NET開發(fā)技術和 SQL 數(shù)據(jù)庫知識,并對其有一定了解的情況下,作者完成了基于 .NET的駕校理論考試模擬系統(tǒng)(主要負責用戶管理,題庫的管理,試卷管理,模擬考試)的研究與開發(fā)。在此次編程中, 我 查閱了大量的書籍,在網(wǎng)上也查了不少資料, 我的 編程水平 也 有了大幅度的 提高。同時,充分了 解到了理論聯(lián)系實際和提高學習新知識新技術能力的重要性,并開始嘗試把大學四年所學的相關理論知識運用于本次開發(fā)過程當中,并額外學習了很多課堂上沒有涉及的知識。 由于時間和能力有限, 此駕校理論考試模擬系統(tǒng) 功能模塊還很不完善,已經(jīng)完成的 模塊也有很多不足之處。在頁面安全性等地方還有很多需要改進的地方,需要今后進一步完善。 參考文獻 [1] 東方人華 ,孫永強 ,王喬 .VisualC.NET Web應用程序設計入門與提高 [M].北京: 清華大學出版社 ,。 [2] 王華杰 ,李律松 ,孫一波 .精通 C數(shù)據(jù)庫開發(fā) [M].北京: 清華大學出版社 ,。 [3] 方睿 ,刁仁宏 ,吳四九 .網(wǎng)絡數(shù)據(jù)庫原理及應用 [M].成都: 四川大學出版社 ,。 [4] 啟明工作室 .+SQL Server網(wǎng)絡應用系統(tǒng)開發(fā)與實例 [M].北京: 人民郵電出版社。 [5] 傅雯彬 ,蔡承書 .JavaScript動態(tài)網(wǎng)頁設計實務 [M].北京: 中國鐵道出版社 ,。 [6] Karli Watson,Maroc 入門經(jīng)典 [M].北京: 清華大學出版社 ,。 [6] Karli Watson,Maroc 入門經(jīng)典 [M].北京: 清華大學出版社 ,。 [7] 章立民 .用實例學 — 使用 C與 [M].北京: 電子工業(yè)出版社 ,。 [8] 羅斌 .Visual C.NET精彩編程實例集錦 [M].北京:中國水利水電出版社 ,2021。 第 24 頁 共 25頁 致 謝 本文是在閆麗麗老師的熱情關心和指導下完成的,她淵博的知識和嚴謹?shù)闹螌W作風使我受益匪淺,對順利完成本課題起到了極大的作用。在此向她表示我最衷心的感謝! 感謝閆老師在課 題研究初期給予的幫助,在閆老師的幫助下課題才得以很好的展開,有了一個很好的開端!感謝 張仕斌、閆麗麗、王翔、索望、林宏剛老師和周俊同學在問卷調查中給予的幫助,因為他們的協(xié)助,才得以高效率的完成了所有問卷調查,獲取了珍貴的數(shù)據(jù)資料! 在論文完成過程中,本人還得到了其他老師和許多同學的熱心幫助,本人向他們表示深深的謝意! 最后向在百忙之中評審本文的各位專家、老師表示衷心的感謝! 作者簡介: 姓 名:后斌 性別: 男 出生年月: 民族: 漢 Email:第 25 頁 共 25頁 聲 明 本論文的工作是 2021年 2月至 2021年 6 月在成都信息工程學院網(wǎng)絡工程系完成的。文中除了特別加以標注地方外,不包含他人已經(jīng)發(fā)表或撰寫過的研究成果,也不包含為獲得成都信息工程學院或其他教學機構的學位或證書而使用過的材料。除非另有說明,本文的工作是原始性工作。 關于學位論文使用權和研究成果知識產(chǎn)權的說明: 本人完全了解成都信息工程學院有關保管使用學 位論文的規(guī)定,其中包括: ( 1)學校有權保管并向有關部門遞交學位論文的原件與復印件。 ( 2)學??梢圆捎糜坝 ⒖s印或其他復制方式保存學位論文。 ( 3)學??梢詫W術交流為目的復制、贈送和交換學位論文。 ( 4)學校可允許學位論文被查閱或借閱。 ( 5)學??梢怨紝W位論文的全部或部分內容(保密學位論文在解密后遵守此規(guī)定)。 除非另有科研合同和其他法律文書的制約,本論文的科研成果屬于成都信息工程學院。 特此聲明! 作者簽名: 2021 年 月 日 第 26 頁 共 25頁 Are you hungry now? No, I am tired and lazy now。 if I pursue you I will not catch you, and if I catch youthrough your own slowness and clumsinessI will not kill you, and if I kill you I will not eat you. Nicholas had begun to back away, and at the last。 words, realizing that they were a signal, he turned and began to run, splashing through the shallow water. Ignacio ran after him, much helped by his longer legs, his hair flying behind his dark young face, his square teetheach white as a bone and as big as Nicholas39。s thumbnailshowing like spectators who lined the railings of his lips. Don39。t run, N icholas, Dr. Island said with the voice of a wave. It only makes him angry that you run. N icholas did not answer, but cut to his left, up the beach and among the trunks of the palms, sprinting all the way because he had no way of knowing Ignacio was not right behind him, about to grab him by the neck. When he stopped it was in the thick jungle, among the boles of the hardwoods, where he leaned,.。 out of breath, the thumping of his own heart the only39。 . sound in an atmosphere silent and unwa ked as Earth39。s long, prehuman day. For a time he listened for any sound Ignacio might m ake searching for him。 there was none. He drew a deep breath then and said, Well, that39。s over, expecting Dr. Island to answer from somewhere。 there was only the green hush. The light was still bright and strong and nearly, shadowless, but some interior sense told him the day, was nearly over, and he noticed that such faint shades as he could see stretched long, hor izontal disto