【正文】
= strSQlq If 0 Then While Not。and TestScore = amp。 Trim() amp。 and TestDiff = 39。 = strSQlq If = 0 Then MsgBox (對(duì)不起,這門學(xué)科沒(méi)有輸入這類題) ElseIf Val() Then MsgBox (對(duì)不起,單選題數(shù)量不足!) = While Not (TestName) = Val() (Th) = intTh (Sth) = (Sth) 39。 Trim() amp。 and testType = 39。 Trim() amp。 where LessonName = 39。 = strSQlq If 0 Then While Not intJ = Val() intSjs = Int((Rnd * ) + 1) For intI = 0 To intSjs 1 If Then Next intI If (Pzw) = 0 Then (Sjh) = Val() (Th) = intTh (Sth) = (Sth) (Pzw) = 1 intTh = intTh + 1 intJ = intJ + 1 End If Wend Else MsgBox (對(duì)不起,這類判斷題不存在!) End If End IfintJ = 0intI = 0strSQlq = select * from QuestionEnd If39。and Fz = amp。 Trim() amp。 and Nd = 39。 39。 amp。 39。 amp。******************************判斷題**************************************If = 1 Then strSQlq = strSQlq amp。 Trim() amp。 39。 amp。 (Pzw) = 1 intTh = intTh + 1 Wend Else strSQlq = strSQlq amp。 39。 amp。 39。 amp。 **************************填空題*******************************************If = 1 Then strSQlq = strSQlq amp。 amp。填充試題信息 With rs If .BOF Then SetNull Exit Sub End If txtLessonName = .Fields(1) txtLessonGraph = .Fields(2) = .Fields(3) = .Fields(4) txtTestDot = .Fields(5) = .Fields(6) txtTestScore = .Fields(7) txtTest = .Fields(8) txtTestAnswer = .Fields(9) End WithEnd Sub 自動(dòng)組卷代碼Dim As Dim rsQ As Dim rsq1 As Dim rst As Dim strSQlq As StringDim strSQLt As StringDim intTh As IntegerDim intI As IntegerDim intJ As IntegerDim intSjs As IntegerPrivate Sub cmdAction_Click(Index As Integer)Select Case Index Case 0: ZjBegin Case 1: ZjFinish Case 2: ZjRestore Case 3: ZjExitEnd SelectEnd SubPrivate Sub Form_Load()With Me .Top = + 100 .Left = End With(1) = 請(qǐng)務(wù)必要詳細(xì)填寫組卷?xiàng)l件!??!End SubPublic Sub ZjExit()Unload Me(1) = 歡迎使用西安工程科技學(xué)院——試題庫(kù)管理系統(tǒng)End SubPublic Sub ZjBegin()strSQlq = select * from QuestionstrSQLt = select * from testintTh = 1intJ = 0Set = New Provider=。檢查記錄的完整性 Dim strMsg As String CheckValid = True If txtLessonName = Then strMsg = 學(xué)科名稱 CheckValid = False MsgBox strMsg + 不能為空!, vbInformation, 提示 Exit Function End If If txtLessonGraph = Then strMsg = 所屬章節(jié) CheckValid = False MsgBox strMsg + 不能為空!, vbInformation, 提示 Exit Function End If If = Then strMsg = 題型 CheckValid = False MsgBox strMsg + 不能為空!, vbInformation, 提示 Exit Function End If If = Then strMsg = 難度 CheckValid = False MsgBox strMsg + 不能為空!, vbInformation, 提示 Exit Function End If If txtTestDot = Then strMsg = 知識(shí)點(diǎn) CheckValid = False MsgBox strMsg + 不能為空!, vbInformation, 提示 Exit Function End If If = Then strMsg = 知識(shí)層次 CheckValid = False MsgBox strMsg + 不能為空!, vbInformation, 提示 Exit Function End If If txtTestScore = Then strMsg = 分值 CheckValid = False MsgBox strMsg + 不能為空!, vbInformation, 提示 Exit Function End If If txtTest = Then strMsg = 內(nèi)容 CheckValid = False MsgBox strMsg + 不能為空!, vbInformation, 提示 Exit Function End If If txtTestAnswer = Then strMsg = 答案 CheckValid = False MsgBox strMsg + 不能為空!, vbInformation, 提示 Exit Function End IfEnd FunctionPrivate Sub SetNull() 39。移動(dòng)滾動(dòng)條 1 CurrentPos FillInfo rs CurrentPos = 1 lblCurrentRecord = Trim(Str(CurrentPos + 1)) + / + Trim(Str())End SubPrivate Sub Text1_Change()End SubPrivate Sub Text1_KeyPress(KeyAscii As Integer)End SubPrivate Sub txtLessonGraph_KeyPress(KeyAscii As Integer)Dim strZj As StringstrZj = 0123456789If KeyAscii 26 Then If InStr(strZj, Chr(KeyAscii)) = 0 Then KeyAscii = 0 End IfEnd IfEnd SubPrivate Sub txtLGraph_KeyPress(KeyAscii As Integer)Dim strZj As StringstrZj = 0123456789If KeyAscii 26 Then If InStr(strZj, Chr(KeyAscii)) = 0 Then KeyAscii = 0 End IfEnd IfEnd SubPrivate Sub txtTestDot_KeyPress(KeyAscii As Integer)Dim strZsd As StringstrZsd = 0123456789If KeyAscii 26 Then If InStr(strZsd, Chr(KeyAscii)) = 0 Then KeyAscii = 0 End IfEnd IfEnd SubPrivate Sub txtTestScore_KeyPress(KeyAscii As Integer)Dim strFz As StringstrFz = 0123456789If KeyAscii 26 Then If InStr(strFz, Chr(KeyAscii)) = 0 Then KeyAscii = 0 End IfEnd IfEnd SubPublic Sub ADOUpdate() 39。 End IfIf Trim(strSQL) = Then MsgBox 請(qǐng)先輸入條件后再查詢, vbOKOnly + vbExclamation, 系統(tǒng)提示 Exit SubEnd If39。End IfIf Then strSQL = strSQL + And TestScore = amp。 Trim() amp。 End IfIf Then strSQL = strSQL + And TestDep = 39。End IfIf Then strSQL = strSQL + And TestDot = amp。 Trim() amp。End IfIf Then strSQL = strSQL + And TestDiff= 39。 Trim() amp。 End IfIf Then strSQL = strSQL + And TestType = 39。Else MsgBox 必須先輸入學(xué)科名稱, vbInformation, 提示 Exit SubEnd IfIf Then strSQL = strSQL + And LessonGraph = amp。 Trim() amp。查詢記錄Dim strSQL As StringstrSQL = select * from Question where If Then strSQL = strSQL + LessonName = 39。End SubPublic Sub ADORefrsh() 39。LocalErr: MsgBox ,