【正文】
nor again, knowing thetruth, ought he through cowardice and unmanliness carelessly todeliver a lying judgment, with the very same lips which have justappealed to the Gods before he judged. He is sitting not as thedisciple of the theatre, but, in his proper place, as theirinstructor, and he ought to be the enemy of all pandering to thepleasure of the spectators. The ancient and mon custom of Hellas,which still prevails in Italy and Sicily, did certainly leave thejudgment to the body of spectators, w ho determined the victor byshow of hands. But this custom has been the destruction of thepoets。 ( 3)學(xué)??梢詫W(xué)術(shù)交流為目的復(fù)制、贈(zèng)送和交換學(xué)位論文。 [7] 章立民 .用實(shí)例學(xué) — 使用 C與 [M].北京: 電子工業(yè)出版社 ,。在頁(yè)面安全性等地方還有很多需要改進(jìn)的地方,需要今后進(jìn)一步完善。 if(()){(userId,mark)} } } 考生單擊“交卷”觸發(fā)事件 refer_click(),該事件跳轉(zhuǎn)到考試結(jié)果頁(yè)面。 判斷 answerList控件是否為空,若為空,則中止函數(shù)。 = reca。 (questionDetail)。此數(shù)據(jù)源由類 QuestionDB的函數(shù) GetQuestion()函數(shù)創(chuàng)建,該函數(shù)的參數(shù)為 ArrayList類型的對(duì)象 QuestionList,它包含整套試卷的所有試題 ID,函 數(shù) GetQuestions()使用 for語(yǔ)句從表中獲取每個(gè)試題的詳細(xì)信息。 } 5. 7考生在線答題 在線答題功能由頁(yè)面 ,頁(yè)面設(shè)計(jì)由 DataGrid控件和Button控件組成,界面設(shè)計(jì)如圖 11所示: 圖 11 考生考試界面 頁(yè)面 初始 化首先從 Session全局變量取到一套試卷的所有考試題目,然后由QuestionDB類的函數(shù) GetQuestions()創(chuàng)建問(wèn)題數(shù)據(jù)源 DataGrid,問(wèn)題數(shù)據(jù)源DataList為 IList接口對(duì)象,而不是 DataReader對(duì)象, DataSet對(duì)象或其它的ArrayList對(duì)象,函數(shù) BindQustionData()實(shí)現(xiàn)頁(yè)面的初始化過(guò)程, 函數(shù)代碼如下: private void BindQuestionData() { ArrayList QuestionIDList = new ArrayList()。 } return(QuestionIDList)。 if(IsExistIndex(IndexList,index) == false) { (())。 defficultParm/10 = minDefficult) { break。 }/// 添加到結(jié)果集中 } for(int k = 0。 int defficultParm = 0。 } (KindList)。 }i++。 while(()) { nPaperCount = (recpc[PaperID].ToString())。url=” 在線答題模塊中,系統(tǒng)首先按照試卷的要求,如試卷總分、試卷章節(jié)、試題的類型等,隨機(jī)從數(shù)據(jù)庫(kù)生成一套試卷。然后綁定到控件上, BindPaperListMData(( Value))函數(shù)根據(jù) BindPaperListData()獲得相應(yīng)的 PaperID,再根據(jù) PaperID獲取試卷表 Papers中的相關(guān)數(shù)據(jù)綁定到各個(gè)控件上。 單擊“確認(rèn)提交” 按鈕觸發(fā)事件 AddPaperBtn_Click(),即把設(shè)置的數(shù)據(jù)全部寫(xiě)到數(shù)據(jù)庫(kù) ,事件代碼如下: private void AddPaperBtn_Click(object sender, e) { PaperDB paper = new PaperDB()。 第 15 頁(yè) 共 25頁(yè) private void UpdateAnswer_Click(object sender, e) { AnswerDB answer = new AnswerDB()。 } 5. 4. 8試題答案修改 修改試題的答案由 ,界面同添加試題答案相似。添加試題答案頁(yè)面的初始化函數(shù) Page_Load()調(diào)用數(shù)據(jù)訪問(wèn)層的函數(shù)從表 Questions獲取試題的信息。如果已經(jīng)選擇,則跳轉(zhuǎn)到試題答案添加頁(yè)面,否 則系統(tǒng) 將 提示你沒(méi)有選擇數(shù)據(jù)。 5. 4. 6試題答案設(shè)計(jì) 試題答案和試題是不可分割的,在此系統(tǒng)中,每個(gè)試題都有三個(gè)答案與之對(duì)應(yīng),只一個(gè)正確答案。 用戶單擊“確認(rèn)提交”按鈕觸發(fā)事件 AddNewQuestion_Click(),該事件添加試題,在添加時(shí)獲取問(wèn)題 ID和圖片 ID就可以成功的添加一道新的試題。 5. 4. 2試題圖片管理 試題圖片管理由頁(yè)面 ,試題圖片管理主要實(shí)現(xiàn)圖片的添加、刪除、修改等功能。 5. 4. 1試題種類管理 試題 種類管理由頁(yè)面 ,試題種類管理實(shí) 現(xiàn)了試題種類的添加、修改、排序和刪除功能。函數(shù) BindRoleData()調(diào)用數(shù)據(jù)訪問(wèn)層的 RoleDB類的函數(shù) GetGetRoles()從 表中獲取用戶數(shù)據(jù),然后再綁定數(shù)據(jù)到角色列表控件。 單擊添加 “ /” 按鈕實(shí)現(xiàn)實(shí)現(xiàn)用戶添加功能,此按鈕為圖像按鈕,單擊此按鈕觸發(fā)事件 AddBtn_Click()。 5. 3 用戶 及其權(quán)限管理 5. 3. 1用戶管理 系統(tǒng)管理員可以對(duì) 用戶管理和 用戶 角色 分配 管理等功能,此功能的關(guān)系圖 5所示。調(diào)用加密函數(shù)時(shí),首先把加密字 符串編碼成 Uncode,然后使用系統(tǒng)的不對(duì)稱加密算法 MD5加密用戶密碼串。如果考生登錄,顯示生成等待頁(yè)面和在線答題頁(yè)面;如果管理登錄,顯示題庫(kù)頁(yè)面;如果系統(tǒng)管理員登錄,則顯示系統(tǒng)維護(hù)頁(yè)面。用戶登錄是應(yīng)用程序的主要入口,用戶只有通過(guò)該入口才能進(jìn)入系統(tǒng)。 //QuestionKinds主要是存儲(chǔ)問(wèn)題種類以及 該種類試題的數(shù)量 public class QuestionKinds 第 8 頁(yè) 共 25頁(yè) { public int KindID。角色表中的RoleID 字段決定考生使用什么類型的試卷,試卷表中的 KindID 字段標(biāo)識(shí)試卷組成的試題種類,該字段和試卷種類表相關(guān)聯(lián)。 表 4 QuestionKinds表的字段說(shuō)明 編號(hào) 字 段名稱 字段類型 字段說(shuō)明 1 UserID Int 用戶表主鍵 第 6 頁(yè) 共 25頁(yè) 2 UserName Varchar(50) 用戶名稱 6.問(wèn)題答案表 (Answers) 問(wèn)題答案表存儲(chǔ)題庫(kù)中問(wèn)題的答案信息,該表引用問(wèn)題表 Questions 的QustionID 作為表的外鍵。 駕駛理論考試模擬系統(tǒng) 用戶登錄和注冊(cè) 用戶角色管理 用戶管理 試題管理 題庫(kù)管理 在線考試 第 5 頁(yè) 共 25頁(yè) 表 1 Users表字段說(shuō)明 編號(hào) 字段名稱 字段類型 字段說(shuō)明 1 UserID Int 用戶表主鍵 2 UserName Varchar(50) 用戶名稱 3 Password Varchar(50) 用戶密碼 4 Email Varchar(50) 用戶 Email 地址 5 RoleID Int 用戶所屬的角色 2.角色表( Roles) 角色表用于存儲(chǔ)用戶的角色信息。 Public void UpdateUserState(int nUserID,int nState)更新用戶的當(dāng)前狀態(tài)。數(shù)據(jù)訪問(wèn)層一般封裝數(shù)據(jù)庫(kù)的選擇、添加、更新、刪除等操作。 駕駛理論考試系統(tǒng) 用戶登錄和注冊(cè) 用戶角色管理 用戶管理 試題管理 題庫(kù)管理 在線答題 第 3 頁(yè) 共 25頁(yè) (4)試題答案管 理,主要實(shí)現(xiàn)試題答案的添加、修改、刪除功能。其功能結(jié)構(gòu)圖如圖 1所示。 該系統(tǒng)采用 B/S 模式進(jìn)行設(shè)計(jì),異地的想學(xué)車的學(xué)員也可以使用該系統(tǒng),進(jìn)行模擬考試,從而了解自己對(duì)交通 規(guī)則了解多少。在這一條件下,我國(guó)的車輛逐漸增多,最近幾年,學(xué)車的人也是越來(lái)越多。其中 ,在線考試系統(tǒng)以方便快捷等優(yōu)點(diǎn)得到了廣泛應(yīng)用。 關(guān)鍵字: 駕駛理論 ; 考試模擬系統(tǒng) ; SQL Server2021 Theory Testing System of Driving School Based on .NET Abstract With the development of modern Inter and wide apllication of information technology, puter has been deeply used in every fileds. The online test system is widely applied thanks about its convenience and speediness. Driving theory test is a pracitcal application of online test. And now burdensome work such as the prepatation, printing, checking has been done by puter. This system has simulating function which achieves users management, test papers management, random test making and automatic checking. This system j udges user’s right when logging in and then directs the users to corresponding pages. After loging, according to the role of user, the system randomly chooses one set of exammination paper and the student finish this paper in limited time. The system finally automatically check the test paper and present the result. Thus it provides reasonable convenience for both students and teachers who check the paper. Key Words: driving theory。 駕駛模擬考試系統(tǒng)以計(jì)算機(jī)為操作工具,按照駕駛理論考試的流程,把駕駛理論考試的一些工作人員從繁瑣的數(shù)據(jù)處理中解放出來(lái),從而提高駕駛考試的工作效率。數(shù)據(jù)庫(kù)使用的是 SQL Server2021。 ? 用戶管理 添加用戶,修改用戶,刪除用戶。 系統(tǒng)功能模塊劃分 系統(tǒng)整體設(shè)計(jì)如圖 2所示,此系統(tǒng)可以劃分為業(yè)務(wù)邏輯層、數(shù)據(jù)訪問(wèn)層和數(shù)據(jù)庫(kù)。 Public SqlDataReader GetSingleUser(int nUserID)從用戶表 Users 獲取單個(gè)用戶信息。 系統(tǒng)是由六個(gè)完整的功能實(shí)現(xiàn)的,根據(jù)這些功能,可以設(shè)計(jì)出系統(tǒng)的功能模塊,各個(gè)系統(tǒng)功能模塊之間的關(guān)系如圖 3 所示。問(wèn)題表的字段說(shuō)明如表 3所示。 4. 3 表關(guān)系設(shè)計(jì) 數(shù)據(jù)庫(kù)各個(gè)表之間的關(guān)系設(shè)計(jì)如圖 4 所示。異常處理類 MyException 定義了兩個(gè)同名的函數(shù),其中參數(shù) source 表示錯(cuò)誤的類型編碼、參數(shù) message 標(biāo)識(shí)錯(cuò)誤的具體信息;參數(shù) Exception 繼承系統(tǒng)的異常參數(shù)。 函數(shù) GetCacheParameters(),該函數(shù)從 Caching對(duì)象中獲取緩存的數(shù)據(jù)庫(kù)參數(shù)。用戶登錄使用了兩個(gè)驗(yàn)證控件,它們?yōu)?RFVUserNamet和 RFVPassword,分別驗(yàn)證用戶名稱和用戶密碼是否為非空。 函數(shù) GetUserLogin()從數(shù)據(jù)庫(kù)獲取合法用戶的 ID數(shù)據(jù) ,函數(shù) GetUserLogin() 第 9 頁(yè) 共 25頁(yè) 調(diào)用存儲(chǔ)過(guò)程 Pr_GetUserLogin()訪問(wèn)數(shù)據(jù)庫(kù)。 單擊“確定”按鈕觸發(fā)事件 SureBtn_Click(),該事件調(diào)用數(shù)據(jù)訪問(wèn)層函數(shù)AddUser()提交新用戶注冊(cè)信息 到表 Users中。 單擊刪除 “ X” 按鈕實(shí)現(xiàn)刪除用戶的功能,該按鈕為圖像按鈕,單擊此按鈕觸發(fā)事件 deleteBtn_Click()。 如系統(tǒng)管理員具有該角色的用戶