📄 test_on.frm
字号:
VERSION 5.00
Begin VB.Form test_in
Caption = "单词测试"
ClientHeight = 5070
ClientLeft = 60
ClientTop = 345
ClientWidth = 5520
LinkTopic = "Form1"
ScaleHeight = 5070
ScaleWidth = 5520
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "返回"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2880
TabIndex = 4
Top = 3600
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "确定"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 840
TabIndex = 3
Top = 3600
Width = 1455
End
Begin VB.Frame Frame1
Caption = "选项"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1335
Left = 240
TabIndex = 2
Top = 1680
Width = 4215
Begin VB.OptionButton Option1
Caption = "Option4"
Height = 255
Index = 3
Left = 2160
TabIndex = 8
Top = 840
Width = 255
End
Begin VB.OptionButton Option1
Caption = "Option3"
Height = 180
Index = 2
Left = 240
TabIndex = 7
Top = 840
Width = 255
End
Begin VB.OptionButton Option1
Caption = "Option2"
Height = 255
Index = 1
Left = 2160
TabIndex = 6
Top = 360
Width = 255
End
Begin VB.OptionButton Option1
Caption = "Option1"
Height = 180
Index = 0
Left = 240
TabIndex = 5
Top = 360
Width = 255
End
Begin VB.Label Label
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 3
Left = 2760
TabIndex = 16
Top = 840
Width = 1215
End
Begin VB.Label Label
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 1
Left = 2760
TabIndex = 15
Top = 360
Width = 1215
End
Begin VB.Label Label
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 2
Left = 840
TabIndex = 14
Top = 840
Width = 1095
End
Begin VB.Label Label
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 0
Left = 840
TabIndex = 13
Top = 360
Width = 1095
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "D."
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 2520
TabIndex = 12
Top = 840
Width = 210
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "B."
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 2520
TabIndex = 11
Top = 360
Width = 210
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "C."
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 600
TabIndex = 10
Top = 840
Width = 210
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "A."
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 600
TabIndex = 9
Top = 360
Width = 210
End
End
Begin VB.Label Label3
Caption = "请选择正确的翻译"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 17
Top = 960
Width = 2655
End
Begin VB.Label Label2
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1320
TabIndex = 1
Top = 360
Width = 1095
End
Begin VB.Label Label1
Caption = "单词:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 0
Top = 360
Width = 735
End
End
Attribute VB_Name = "test_in"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public right As Integer
Dim db As DAO.Database
Dim rec As DAO.Recordset
Dim i As Integer
Dim cnt As Integer
Dim crt As Integer
Dim mark As Integer
Private Sub Command1_Click()
Call judge
If i = test.sum Then
Command1.Caption = "交卷"
Else
Call ask
End If
If Command1.Caption = "交卷" Then
score = mark / test.sum * 100
MsgBox ("你的得分是" & score & "分")
Unload Me
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Set db = OpenDatabase(App.Path & "\sourse.mdb")
Set rec = db.OpenRecordset("select * from word where 级别 ='" & test.level1 & "'")
rec.MoveLast
cnt = rec.RecordCount
rec.MoveFirst
i = 0
mark = 0
Call ask
End Sub
Private Sub ask()
i = i + 1
Command1.Caption = "下一题"
For j = 0 To 3
Label(j).Caption = ""
Next
temp = Int(Rnd() * 10)
rec.MoveFirst
rec.Move (temp Mod cnt)
Label2.Caption = rec!单词 '正确单词和翻译进入
Label(temp Mod 4).Caption = rec!翻译
crt = temp Mod 4
For j = 1 To 3
k = j - 1
rec.MoveFirst
temp = Int(Rnd() * 10)
rec.Move (temp Mod cnt) '找一个错翻译
Do While rec!翻译 = test_in.Label(crt).Caption
temp = Int(Rnd() * 10)
rec.MoveFirst
rec.Move (temp Mod cnt)
Loop
Do While Not Label(k).Caption = "" '放到一个空行上去
k = k + 1
Loop
test_in.Label(k).Caption = rec!翻译
Next
End Sub
Private Sub judge()
If Option1(crt).Value Then
mark = mark + 1
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -