这是一个用VB编写的在线考试系统

源代码在线查看: 题库管理.frm

软件大小: 1279 K
上传用户: dingjuan_01
关键词: 编写
下载地址: 免注册下载 普通下载 VIP

相关代码

				VERSION 5.00
				Begin VB.Form Form6 
				   Caption         =   "题库管理"
				   ClientHeight    =   6930
				   ClientLeft      =   60
				   ClientTop       =   345
				   ClientWidth     =   7740
				   LinkTopic       =   "Form6"
				   ScaleHeight     =   6930
				   ScaleWidth      =   7740
				   StartUpPosition =   2  '屏幕中心
				   Begin VB.OptionButton Option1 
				      Caption         =   "A"
				      Height          =   375
				      Index           =   0
				      Left            =   5520
				      TabIndex        =   25
				      Top             =   120
				      Visible         =   0   'False
				      Width           =   495
				   End
				   Begin VB.CheckBox Check1 
				      Caption         =   "A"
				      Height          =   375
				      Index           =   0
				      Left            =   5520
				      TabIndex        =   24
				      Top             =   120
				      Visible         =   0   'False
				      Width           =   495
				   End
				   Begin VB.OptionButton Option1 
				      Caption         =   "B"
				      Height          =   375
				      Index           =   1
				      Left            =   5520
				      TabIndex        =   23
				      Top             =   480
				      Visible         =   0   'False
				      Width           =   495
				   End
				   Begin VB.OptionButton Option1 
				      Caption         =   "C"
				      Height          =   375
				      Index           =   2
				      Left            =   5520
				      TabIndex        =   22
				      Top             =   840
				      Visible         =   0   'False
				      Width           =   495
				   End
				   Begin VB.OptionButton Option1 
				      Caption         =   "D"
				      Height          =   375
				      Index           =   3
				      Left            =   5520
				      TabIndex        =   21
				      Top             =   1200
				      Visible         =   0   'False
				      Width           =   495
				   End
				   Begin VB.CheckBox Check1 
				      Caption         =   "B"
				      Height          =   375
				      Index           =   1
				      Left            =   5520
				      TabIndex        =   20
				      Top             =   480
				      Visible         =   0   'False
				      Width           =   495
				   End
				   Begin VB.CheckBox Check1 
				      Caption         =   "C"
				      Height          =   375
				      Index           =   2
				      Left            =   5520
				      TabIndex        =   19
				      Top             =   840
				      Visible         =   0   'False
				      Width           =   495
				   End
				   Begin VB.CheckBox Check1 
				      Caption         =   "D"
				      Height          =   375
				      Index           =   3
				      Left            =   5520
				      TabIndex        =   18
				      Top             =   1200
				      Visible         =   0   'False
				      Width           =   495
				   End
				   Begin VB.OptionButton Option2 
				      Caption         =   "对"
				      Height          =   255
				      Index           =   0
				      Left            =   5520
				      TabIndex        =   17
				      Top             =   120
				      Visible         =   0   'False
				      Width           =   495
				   End
				   Begin VB.OptionButton Option2 
				      Caption         =   "错"
				      Height          =   255
				      Index           =   1
				      Left            =   5520
				      TabIndex        =   16
				      Top             =   480
				      Visible         =   0   'False
				      Width           =   495
				   End
				   Begin VB.CommandButton Command7 
				      Caption         =   "退出题库管理"
				      Height          =   615
				      Left            =   5880
				      TabIndex        =   14
				      Top             =   5760
				      Width           =   1815
				   End
				   Begin VB.CommandButton Command6 
				      Caption         =   "添加"
				      Height          =   495
				      Left            =   360
				      TabIndex        =   13
				      Top             =   5760
				      Width           =   1335
				   End
				   Begin VB.TextBox Text5 
				      Enabled         =   0   'False
				      Height          =   3255
				      Left            =   120
				      MultiLine       =   -1  'True
				      ScrollBars      =   2  'Vertical
				      TabIndex        =   12
				      Top             =   2280
				      Width           =   7455
				   End
				   Begin VB.TextBox Text4 
				      Height          =   375
				      Left            =   3120
				      TabIndex        =   10
				      Top             =   1440
				      Width           =   1695
				   End
				   Begin VB.TextBox Text3 
				      Height          =   375
				      Left            =   2520
				      MaxLength       =   4
				      TabIndex        =   9
				      Top             =   1440
				      Width           =   495
				   End
				   Begin VB.TextBox Text2 
				      Height          =   375
				      Left            =   1920
				      MaxLength       =   4
				      TabIndex        =   8
				      Top             =   1440
				      Width           =   495
				   End
				   Begin VB.TextBox Text1 
				      Height          =   375
				      Left            =   1080
				      MaxLength       =   6
				      TabIndex        =   7
				      Top             =   1440
				      Width           =   735
				   End
				   Begin VB.Frame Frame1 
				      Height          =   1215
				      Left            =   240
				      TabIndex        =   0
				      Top             =   120
				      Width           =   4575
				      Begin VB.CommandButton Command5 
				         Caption         =   "编程题"
				         Height          =   375
				         Left            =   2640
				         TabIndex        =   5
				         Top             =   240
				         Width           =   1095
				      End
				      Begin VB.CommandButton Command4 
				         Caption         =   "改错题"
				         Height          =   375
				         Left            =   1440
				         TabIndex        =   4
				         Top             =   720
				         Width           =   1095
				      End
				      Begin VB.CommandButton Command3 
				         Caption         =   "判断题"
				         Height          =   375
				         Left            =   1440
				         TabIndex        =   3
				         Top             =   240
				         Width           =   1095
				      End
				      Begin VB.CommandButton Command2 
				         Caption         =   "多选题"
				         Height          =   375
				         Left            =   240
				         TabIndex        =   2
				         Top             =   720
				         Width           =   1095
				      End
				      Begin VB.CommandButton Command1 
				         Caption         =   "单选题"
				         Height          =   375
				         Left            =   240
				         TabIndex        =   1
				         Top             =   240
				         Width           =   1095
				      End
				      Begin VB.Label Label4 
				         Height          =   375
				         Left            =   2640
				         TabIndex        =   26
				         Top             =   720
				         Width           =   1095
				      End
				   End
				   Begin VB.Label Label3 
				      Caption         =   "答案:"
				      Height          =   255
				      Left            =   4920
				      TabIndex        =   15
				      Top             =   240
				      Width           =   615
				   End
				   Begin VB.Label Label2 
				      Caption         =   "题目:"
				      Height          =   255
				      Left            =   240
				      TabIndex        =   11
				      Top             =   1920
				      Width           =   735
				   End
				   Begin VB.Label Label1 
				      Caption         =   "题号:"
				      Height          =   255
				      Left            =   240
				      TabIndex        =   6
				      Top             =   1440
				      Width           =   615
				   End
				End
				Attribute VB_Name = "Form6"
				Attribute VB_GlobalNameSpace = False
				Attribute VB_Creatable = False
				Attribute VB_PredeclaredId = True
				Attribute VB_Exposed = False
				Option Explicit
				
				Private Sub Check1_Click(Index As Integer)
				kaodsk = 0
				If Check1(0).Value = 1 Then kaodsk = kaodsk + 1
				If Check1(1).Value = 1 Then kaodsk = kaodsk + 5
				If Check1(2).Value = 1 Then kaodsk = kaodsk + 7
				If Check1(3).Value = 1 Then kaodsk = kaodsk + 9
				End Sub
				
				Private Sub Command1_Click()
				Close #12
				Close #13
				kaodskt = 1
				Open App.Path & "\..\data\ask001.dat" For Append As #12
				Open App.Path & "\..\data\dsk001.dat" For Append As #13
				Text5.Enabled = True
				Option1(0).Visible = True
				Option1(1).Visible = True
				Option1(2).Visible = True
				Option1(3).Visible = True
				Option2(0).Visible = False
				Option2(1).Visible = False
				Check1(0).Visible = False
				Check1(1).Visible = False
				Check1(2).Visible = False
				Check1(3).Visible = False
				Label4.Caption = Command1.Caption
				End Sub
				
				Private Sub Command2_Click()
				Close #12
				Close #13
				kaodskt = 1
				Open App.Path & "\..\data\ask002.dat" For Append As #12
				Open App.Path & "\..\data\dsk002.dat" For Append As #13
				Text5.Enabled = True
				Option1(0).Visible = False
				Option1(1).Visible = False
				Option1(2).Visible = False
				Option1(3).Visible = False
				Option2(0).Visible = False
				Option2(1).Visible = False
				Check1(0).Visible = True
				Check1(1).Visible = True
				Check1(2).Visible = True
				Check1(3).Visible = True
				Label4.Caption = Command2.Caption
				End Sub
				
				Private Sub Command3_Click()
				Close #12
				Close #13
				kaodskt = 1
				Open App.Path & "\..\data\ask003.dat" For Append As #12
				Open App.Path & "\..\data\dsk003.dat" For Append As #13
				Text5.Enabled = True
				Option1(0).Visible = False
				Option1(1).Visible = False
				Option1(2).Visible = False
				Option1(3).Visible = False
				Option2(0).Visible = True
				Option2(1).Visible = True
				Check1(0).Visible = False
				Check1(1).Visible = False
				Check1(2).Visible = False
				Check1(3).Visible = False
				Label4.Caption = Command3.Caption
				End Sub
				
				Private Sub Command4_Click()
				Close #12
				Close #13
				kaodskt = 0
				Open App.Path & "\..\data\ask004.dat" For Append As #12
				Text5.Enabled = True
				Option1(0).Visible = False
				Option1(1).Visible = False
				Option1(2).Visible = False
				Option1(3).Visible = False
				Option2(0).Visible = False
				Option2(1).Visible = False
				Check1(0).Visible = False
				Check1(1).Visible = False
				Check1(2).Visible = False
				Check1(3).Visible = False
				Label4.Caption = Command4.Caption
				End Sub
				
				Private Sub Command5_Click()
				Close #12
				Close #13
				kaodskt = 0
				Open App.Path & "\..\data\ask005.dat" For Append As #12
				Text5.Enabled = True
				Option1(0).Visible = False
				Option1(1).Visible = False
				Option1(2).Visible = False
				Option1(3).Visible = False
				Option2(0).Visible = False
				Option2(1).Visible = False
				Check1(0).Visible = False
				Check1(1).Visible = False
				Check1(2).Visible = False
				Check1(3).Visible = False
				Label4.Caption = Command5.Caption
				End Sub
				
				Private Sub Command6_Click()
				Print #12, Text1.Text & Text2.Text & Text3.Text; Text4.Text & Chr(16) & Chr(17)
				Print #12, Text5.Text & Chr(16) & Chr(17)
				If kaodskt = 1 Then
				Print #13, Trim(Str(kaodsk)) & Chr(16) & Chr(17)
				End If
				Text4.Text = ""
				Text5.SetFocus
				Command6.Enabled = False
				End Sub
				
				Private Sub Command7_Click()
				Form1.Visible = True
				Form1.SetFocus
				Close #12
				Unload Me
				End Sub
				
				Private Sub Form_Unload(Cancel As Integer)
				Form1.Visible = True
				Form1.SetFocus
				Close #12
				End Sub
				
				Private Sub Option1_Click(Index As Integer)
				kaodsk = Index + 1
				End Sub
				
				Private Sub Option2_Click(Index As Integer)
				kaodsk = Index + 1
				End Sub
				
				Private Sub Text1_Change()
				If Len(Text1.Text) >= 6 Then
				Text2.SetFocus
				End If
				End Sub
				
				Private Sub Text2_Change()
				If Len(Text1.Text) >= 4 Then
				Text3.SetFocus
				End If
				End Sub
				
				Private Sub Text3_Change()
				If Len(Text1.Text) >= 4 Then
				Text4.SetFocus
				End If
				End Sub
				
				Private Sub Text5_Change()
				Command6.Enabled = True
				End Sub
							

相关资源