⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmkaojuan.frm

📁 vb试卷生成系统!能够生成8开vb考试试卷
💻 FRM
📖 第 1 页 / 共 5 页
字号:
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   645
      Index           =   3
      Left            =   1170
      TabIndex        =   36
      Top             =   3900
      Width           =   495
   End
   Begin VB.Label Label6 
      BackStyle       =   0  'Transparent
      Caption         =   "{"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   24
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   645
      Index           =   2
      Left            =   1140
      TabIndex        =   35
      Top             =   2970
      Width           =   495
   End
   Begin VB.Label Label7 
      BackStyle       =   0  'Transparent
      Caption         =   "难度1:"
      Height          =   255
      Index           =   3
      Left            =   1620
      TabIndex        =   26
      Top             =   1770
      Width           =   615
   End
   Begin VB.Label Label7 
      BackStyle       =   0  'Transparent
      Caption         =   "难度2:"
      Height          =   255
      Index           =   2
      Left            =   1590
      TabIndex        =   25
      Top             =   2220
      Width           =   615
   End
   Begin VB.Label Label4 
      BackStyle       =   0  'Transparent
      Caption         =   "程序设计填空"
      Height          =   345
      Index           =   1
      Left            =   270
      TabIndex        =   22
      Top             =   2010
      Width           =   1095
   End
   Begin VB.Label Label7 
      BackStyle       =   0  'Transparent
      Caption         =   "难度2:"
      Height          =   255
      Index           =   1
      Left            =   1560
      TabIndex        =   19
      Top             =   1290
      Width           =   615
   End
   Begin VB.Label Label7 
      BackStyle       =   0  'Transparent
      Caption         =   "难度1:"
      Height          =   255
      Index           =   0
      Left            =   1590
      TabIndex        =   18
      Top             =   840
      Width           =   615
   End
   Begin VB.Label Label4 
      BackStyle       =   0  'Transparent
      Caption         =   "基础填空"
      Height          =   345
      Index           =   0
      Left            =   300
      TabIndex        =   17
      Top             =   1080
      Width           =   735
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "随机选择"
      Height          =   255
      Left            =   300
      TabIndex        =   16
      Top             =   300
      Width           =   795
   End
   Begin VB.Label Label6 
      BackStyle       =   0  'Transparent
      Caption         =   "{"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   24
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   645
      Index           =   0
      Left            =   1140
      TabIndex        =   23
      Top             =   930
      Width           =   495
   End
   Begin VB.Label Label6 
      BackStyle       =   0  'Transparent
      Caption         =   "{"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   24
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   645
      Index           =   1
      Left            =   1170
      TabIndex        =   24
      Top             =   1860
      Width           =   495
   End
End
Attribute VB_Name = "Frmkaojuan"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click(Index As Integer)
Dim biao As String
biao = "zaixuanze" + Trim(Str(Index + 1))
adodc1.RecordSource = biao
adodc1.Refresh
While adodc1.Recordset.RecordCount <> 0
    adodc1.Recordset.Delete
    adodc1.Recordset.Update
    adodc1.Refresh
Wend
If Index < 4 Then
    biao = "tiankongti" + Trim(Str(Index + 1))
ElseIf Index < 8 Then
    biao = "xuanze" + Trim(Str(Index - 3))
Else
    biao = "jiandati" + Trim(Str(Index - 7))
End If
Adodc2.RecordSource = biao
Adodc2.Refresh
For i = 1 To Adodc2.Recordset.RecordCount
    Adodc3.RecordSource = "select * from yxuanze" + Trim(Str(Index + 1)) + " where neirong='" + Adodc2.Recordset.Fields(0) + "'"
    Adodc3.Refresh
    If Adodc3.Recordset.RecordCount = 0 Then
        adodc1.Recordset.AddNew
        If Index > 3 And Index < 8 Then
            adodc1.Recordset.Fields(0) = Adodc2.Recordset.Fields(0)
            adodc1.Recordset.Fields(1) = Adodc2.Recordset.Fields(1)
            adodc1.Recordset.Fields(2) = Adodc2.Recordset.Fields(2)
            adodc1.Recordset.Fields(3) = Adodc2.Recordset.Fields(3)
            adodc1.Recordset.Fields(4) = Adodc2.Recordset.Fields(4)
            adodc1.Recordset.Fields(5) = Adodc2.Recordset.Fields(5)
            If Index > 5 Then
                adodc1.Recordset.Fields(6) = Adodc2.Recordset.Fields(6)
            End If
        Else
            adodc1.Recordset.Fields(0) = Adodc2.Recordset.Fields(0)
            adodc1.Recordset.Fields(1) = Adodc2.Recordset.Fields(1)
            If Index > 1 And Index < 4 Then
                adodc1.Recordset.Fields(2) = Adodc2.Recordset.Fields(2)
            End If
        End If
        adodc1.Recordset.Update
    End If
    Adodc2.Recordset.MoveNext
Next i
adodc1.Refresh
Dim rndrecordnum As Long
For i = 1 To adodc1.Recordset.RecordCount - Val(Text1(Index).Text)
    adodc1.Refresh
    rndrecordnum = Int(Rnd() * adodc1.Recordset.RecordCount) + 1
    adodc1.Recordset.Move (rndrecordnum - 1)
    adodc1.Recordset.Delete
    adodc1.Recordset.Update
    adodc1.Refresh
Next i
End Sub

Private Sub Command10_Click()
For i = 0 To 1
    DataGrid1(i).left = 6720
    DataGrid1(i).top = 780
    DataGrid1(i).Height = 5940
    DataGrid1(i).Width = 5000
Next i
End Sub

Private Sub Command11_Click()
If Command11.Caption = "允许编辑" Then
    Command11.Caption = "禁止编辑"
Else
    Command11.Caption = "允许编辑"
End If
DataGrid1(0).Enabled = Not DataGrid1(0).Enabled
DataGrid1(1).Enabled = Not DataGrid1(1).Enabled
End Sub

Private Sub Command12_Click()
Unload DataEnvironment1
DataEnvironment1.Connection1.ConnectionString = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\data\模拟测试卷\CESHITI1.MDB;Persist Security Info=False"
DataEnvironment1.Command1
DataReport2.Refresh
DataReport2.Show
End Sub

Private Sub Command2_Click(Index As Integer)
If Index <= 11 Then
    adodc1.RecordSource = "yxuanze" + Trim(Str(Index + 1))
    adodc1.Refresh
Else
    adodc1.RecordSource = "zaixuanze" + Trim(Str(Index - 11))
    adodc1.Refresh
End If
DataGrid1(0).Refresh
If Index > 3 And Index < 8 Or Index > 15 And Index < 20 Then
    DataGrid1(0).Columns(0).Caption = "题目"
    DataGrid1(0).Columns(1).Caption = "选项A"
    DataGrid1(0).Columns(2).Caption = "选项B"
    DataGrid1(0).Columns(3).Caption = "选项C"
    DataGrid1(0).Columns(4).Caption = "选项D"
    DataGrid1(0).Columns(5).Caption = "答案"
    DataGrid1(0).Columns(1).Width = 2500
    DataGrid1(0).Columns(1).Width = 500
    DataGrid1(0).Columns(2).Width = 500
    DataGrid1(0).Columns(3).Width = 500
    DataGrid1(0).Columns(4).Width = 500
    DataGrid1(0).Columns(5).Width = 500
Else
    DataGrid1(0).Columns(0).Caption = "题目"
    DataGrid1(0).Columns(1).Caption = "答案"
    DataGrid1(0).Columns(1).Width = 3000
    DataGrid1(0).Columns(1).Width = 2000
End If
DataGrid1(1).Visible = False
DataGrid1(0).Visible = True
End Sub

Private Sub Command3_Click()
For i = 0 To 11
    adodc1.RecordSource = "yxuanze" + Trim(Str(i + 1))
    adodc1.Refresh
    Label8(i).Caption = "已选择:" + Str(adodc1.Recordset.RecordCount) + "道"
    If i < 4 Then
        Adodc2.RecordSource = "tiankongti" + Trim(Str(i + 1))
        Adodc2.Refresh
        VScroll1(i).Max = Adodc2.Recordset.RecordCount - adodc1.Recordset.RecordCount
        If VScroll1(i).Max < 0 Then VScroll1(i).Max = 0
    ElseIf i < 8 Then
        Adodc2.RecordSource = "xuanze" + Trim(Str(i - 3))
        Adodc2.Refresh
        VScroll1(i).Max = Adodc2.Recordset.RecordCount - adodc1.Recordset.RecordCount
        If VScroll1(i).Max < 0 Then VScroll1(i).Max = 0
    Else
        Adodc2.RecordSource = "jiandati" + Trim(Str(i - 7))
        Adodc2.Refresh
        VScroll1(i).Max = Adodc2.Recordset.RecordCount - adodc1.Recordset.RecordCount
        If VScroll1(i).Max < 0 Then VScroll1(i).Max = 0
    End If
Next i
End Sub

Private Sub Command4_Click()
Adodc4.Refresh
While Adodc4.Recordset.RecordCount <> 0
    Adodc4.Recordset.Delete
    Adodc4.Recordset.Update
    Adodc4.Refresh
Wend
Dim i As Integer
For i = 0 To 11
    adodc1.RecordSource = "zaixuanze" + Trim(Str(i + 1))
    adodc1.Refresh
    If adodc1.Recordset.RecordCount <> Val(Text1(i)) Then
        Command1_Click (i)
    End If
Next i
Dim recc As Long
recc = 0
Adodc4.Recordset.AddNew
Adodc4.Recordset.Fields(0) = "一、填空题"
Adodc4.Recordset.Update
For i = 0 To 11
    If i = 4 Then
        Adodc4.Recordset.AddNew
        Adodc4.Recordset.Fields(0) = "二、选择题"
        Adodc4.Recordset.Update
    ElseIf i = 8 Then
        Adodc4.Recordset.AddNew
        Adodc4.Recordset.Fields(0) = "三、简答、程序设计题"
        Adodc4.Recordset.Update
    End If
    adodc1.RecordSource = "yxuanze" + Trim(Str(i + 1))
    adodc1.Refresh
    If adodc1.Recordset.RecordCount <> 0 Then
        For j = 1 To adodc1.Recordset.RecordCount
        Adodc4.Refresh
        Adodc4.Recordset.AddNew
        recc = recc + 1
        If i < 8 And i > 3 Then
            Adodc4.Recordset.Fields(0) = Trim(Str(recc)) + "." + adodc1.Recordset.Fields(0)
            Adodc4.Recordset.Fields(1) = "A:" + adodc1.Recordset.Fields(1)
            Adodc4.Recordset.Fields(2) = "B:" + adodc1.Recordset.Fields(2)
            Adodc4.Recordset.Fields(3) = "C:" + adodc1.Recordset.Fields(3)
            Adodc4.Recordset.Fields(4) = "D:" + adodc1.Recordset.Fields(4)
            Adodc4.Recordset.Fields(5) = adodc1.Recordset.Fields(5)
            If i > 5 Then
                Adodc4.Recordset.Fields(6) = adodc1.Recordset.Fields(6)
            End If
        Else
            Adodc4.Recordset.Fields(0) = Trim(Str(recc)) + "." + adodc1.Recordset.Fields(0)
            Adodc4.Recordset.Fields(5) = adodc1.Recordset.Fields(1)
            If i > 1 And i < 4 Then
                Adodc4.Recordset.Fields(6) = adodc1.Recordset.Fields(2)
            End If
        End If
        Adodc4.Recordset.Update
        adodc1.Recordset.MoveNext
        Next j
    End If
    adodc1.RecordSource = "zaixuanze" + Trim(Str(i + 1))
    adodc1.Refresh
    If adodc1.Recordset.RecordCount <> 0 Then
        For j = 1 To adodc1.Recordset.RecordCount
        Adodc4.Recordset.AddNew
        recc = recc + 1
        If i < 8 And i > 3 Then
            Adodc4.Recordset.Fields(0) = Trim(Str(recc)) + "." + adodc1.Recordset.Fields(0)
            Adodc4.Recordset.Fields(1) = "A:" + adodc1.Recordset.Fields(1)
            Adodc4.Recordset.Fields(2) = "B:" + adodc1.Recordset.Fields(2)
            Adodc4.Recordset.Fields(3) = "C:" + adodc1.Recordset.Fields(3)
            Adodc4.Recordset.Fields(4) = "D:" + adodc1.Recordset.Fields(4)
            Adodc4.Recordset.Fields(5) = adodc1.Recordset.Fields(5)
            If i > 5 Then
                Adodc4.Recordset.Fields(6) = adodc1.Recordset.Fields(6)
            End If
        Else
            Adodc4.Recordset.Fields(0) = Trim(Str(recc)) + "." + adodc1.Recordset.Fields(0)
            Adodc4.Recordset.Fields(5) = adodc1.Recordset.Fields(1)
            If i > 1 And i < 4 Then
                Adodc4.Recordset.Fields(6) = adodc1.Recordset.Fields(2)
            End If
        End If
        Adodc4.Recordset.Update
        adodc1.Recordset.MoveNext
        Next j
    End If
Next i
If Adodc4.Recordset.RecordCount <> 0 Then
    Adodc4.Recordset.Update
    Adodc4.Refresh
End If

End Sub

Private Sub Command5_Click()
Adodc4.Refresh
DataGrid1(1).Visible = True
DataGrid1(0).Visible = False
End Sub

Private Sub Command6_Click()
Unload DataEnvironment1
DataEnvironment1.Connection1.ConnectionString = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\data\模拟测试卷\CESHITI1.MDB;Persist Security Info=False"
DataEnvironment1.Command1
DataReport1.Refresh
DataReport1.Show
End Sub

Private Sub Command7_Click()
On Error GoTo ss
Dim ss As Long
Dim sFile As String
With dlgCommonDialog
    .DialogTitle = "载入试卷"
    .CancelError = False
    .Filter = "试卷文件(*.mdb)|*.mdb"
    .ShowOpen
    If Len(.FileName) = 0 Then
        sFile = ""
        Exit Sub
    End If
    sFile = .FileName
End With
Adodc5.Connec

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -