If Tables("试题").current("题型") = “多选题” Then
e.Form.Controls("GroupBox3").Enabled = False
e.Form.Controls("GroupBox2").Enabled = True
Dim Str As String
If e.Form.Controls("显示答案").Checked = False
If e.Form.Controls("CheckBox1").Checked = True Then
str = str & "A"
End If
If e.Form.Controls("CheckBox2").Checked = True Then
str = str & "B"
End If
If e.Form.Controls("CheckBox3").Checked = True Then
str = str & "C"
End If
If e.Form.Controls("CheckBox4").Checked = True Then
str = str & "D"
End If
If str IsNot Nothing Then
If str = dr("正确答案") Then
e.Form.Controls("提示").text = "恭喜你答对了!"
Functions.Execute("Yes")
Else
e.Form.Controls("提示").text = ""
For Each c As Char In str
If dr("正确答案").Contains(c) = False Then
e.Form.Controls("提示").text = "对不起,你答错了!"
Functions.Execute("No")
End If
Exit For
Next
End If
End If
End If
End If
蓝总:测试后,还有缺陷。假如答案是ABD,如果按顺序选择ABD,提示"恭喜你答对了!",但是选ABC,不提示报错,选ABD后再加选C,也不提示"对不起,你答错了!",只有单选C时,才提示"对不起,你答错了!"