📄 paperproperty.frm
字号:
Begin VB.TextBox txtAvg
BackColor = &H80000000&
Enabled = 0 'False
Height = 300
Index = 2
Left = 2850
TabIndex = 22
Text = "2.5"
Top = 1305
Width = 855
End
Begin VB.TextBox txtCount
Height = 300
Index = 2
Left = 1935
TabIndex = 21
Text = "20"
Top = 1305
Width = 855
End
Begin VB.TextBox txtLevel2
Height = 300
Index = 1
Left = 5505
TabIndex = 20
Text = "30"
Top = 945
Width = 855
End
Begin VB.TextBox txtLevel1
Height = 300
Index = 1
Left = 4620
TabIndex = 19
Text = "50"
Top = 945
Width = 855
End
Begin VB.TextBox txtLevel0
Height = 300
Index = 1
Left = 3720
TabIndex = 18
Text = "20"
Top = 945
Width = 855
End
Begin VB.TextBox txtAvg
BackColor = &H80000000&
Enabled = 0 'False
Height = 300
Index = 1
Left = 2835
TabIndex = 17
Text = "2"
Top = 945
Width = 855
End
Begin VB.TextBox txtCount
Height = 300
Index = 1
Left = 1935
TabIndex = 16
Text = "10"
Top = 945
Width = 855
End
Begin VB.TextBox txtLevel2
Height = 300
Index = 0
Left = 5505
TabIndex = 15
Text = "30"
Top = 585
Width = 855
End
Begin VB.TextBox txtLevel1
Height = 300
Index = 0
Left = 4620
TabIndex = 14
Text = "50"
Top = 585
Width = 855
End
Begin VB.TextBox txtLevel0
Height = 300
Index = 0
Left = 3720
TabIndex = 13
Text = "20"
Top = 585
Width = 855
End
Begin VB.TextBox txtAvg
BackColor = &H80000000&
Enabled = 0 'False
Height = 300
Index = 0
Left = 2835
TabIndex = 12
Text = "1"
Top = 585
Width = 855
End
Begin VB.TextBox txtCount
Height = 300
Index = 0
Left = 1935
TabIndex = 2
Text = "10"
Top = 585
Width = 855
End
Begin VB.Label Label20
AutoSize = -1 'True
Caption = "%"
Height = 180
Left = 6405
TabIndex = 61
Top = 1725
Width = 90
End
Begin VB.Label Label19
AutoSize = -1 'True
Caption = "%"
Height = 180
Left = 6405
TabIndex = 60
Top = 1365
Width = 90
End
Begin VB.Label Label18
AutoSize = -1 'True
Caption = "%"
Height = 180
Left = 6405
TabIndex = 59
Top = 1005
Width = 90
End
Begin VB.Label Label17
AutoSize = -1 'True
Caption = "%"
Height = 180
Left = 6405
TabIndex = 58
Top = 645
Width = 90
End
Begin VB.Label lblTotal
AutoSize = -1 'True
Caption = "试卷总分:100分"
Height = 180
Left = 405
TabIndex = 35
Top = 2085
Width = 1350
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "总分"
Height = 180
Left = 1290
TabIndex = 31
Top = 360
Width = 360
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "容易"
Height = 180
Left = 5745
TabIndex = 11
Top = 360
Width = 360
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "一般"
Height = 180
Left = 4860
TabIndex = 10
Top = 360
Width = 360
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "难"
Height = 180
Left = 4065
TabIndex = 9
Top = 360
Width = 180
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "分/题"
Height = 180
Left = 3030
TabIndex = 8
Top = 360
Width = 450
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "小题数"
Height = 180
Left = 2100
TabIndex = 7
Top = 360
Width = 540
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "填空题"
Height = 180
Left = 405
TabIndex = 6
Top = 1725
Width = 540
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "多选题"
Height = 180
Left = 405
TabIndex = 5
Top = 1365
Width = 540
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "单选题"
Height = 180
Left = 405
TabIndex = 4
Top = 1005
Width = 540
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "判断题"
Height = 180
Left = 405
TabIndex = 3
Top = 645
Width = 540
End
End
End
Attribute VB_Name = "PaperProperty"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim objRsJudge As Recordset, objRsSingle As Recordset, objRsMore As Recordset
Dim objRsSpace As Recordset, objRsChapter As Recordset
Private Sub cmbChapter_Click(Index As Integer)
txtScale(Index) = cmbChapter(Index).ItemData(cmbChapter(Index).ListIndex)
End Sub
Private Sub cmdExit_Click()
Unload Me '关闭窗体
End Sub
Private Sub cmdAnalyse_Click()
On Error GoTo DealError
'分析章节中的题数分配
Dim News, i%, j%, strFilter$, Chapter%(3, 2), k%
News = Array("判断题", "单选题", "多选题", "填空题")
For i = 0 To 3
If Val(txtScore(i)) <> 0 And Val(lblRemain(i)) <> 0 Then
MsgBox News(i) & "试题剩余" & lblRemain(i) & "%未分配", vbCritical
txtScale(i).SetFocus
Exit Sub
End If
Next
'检查章节题量分配是否有效
If objRsChapter.RecordCount <= 0 Then Exit Sub
For i = 0 To 3
If Val(txtScore(i)) <> 0 Then
For j = 0 To cmbChapter(i).ListCount - 1
objRsChapter.MoveFirst
objRsChapter.Find "名称='" & cmbChapter(i).List(j) & "'"
strFilter = "章节=" & objRsChapter!编号
Select Case i
Case 0 '检查判断题题量分配是否有效
objRsJudge.Filter = strFilter
If objRsJudge.RecordCount < Int(cmbChapter(i).ItemData(j) * _
txtCount(i) / 100) Then
MsgBox "<" & News(i) & "><" & objRsChapter!名称 & ">中只有<" _
& objRsJudge.RecordCount & ">道试题,小题百分比最多<" _
& Int(objRsJudge.RecordCount / Val(txtCount(i)) * 100) _
& ">", vbCritical
cmbChapter(i).ListIndex = j
Exit Sub
End If
'小题数通过检验,统计各类难度试题数量
For k = 0 To 2
objRsJudge.Filter = strFilter & " and 难度=" & k
Chapter(i, k) = Chapter(i, k) + objRsJudge.RecordCount
Next
Case 1 '检查单选题题量分配是否有效
objRsSingle.Filter = strFilter
If objRsSingle.RecordCount < Int(cmbChapter(i).ItemData(j) * _
txtCount(i) / 100) Then
MsgBox "<" & News(i) & "><" & objRsChapter!名称 & ">中只有<" _
& objRsSingle.RecordCount & ">道试题,小题百分比最多<" _
& Int(objRsSingle.RecordCount / Val(txtCount(i)) * 100) _
& ">", vbCritical
cmbChapter(i).ListIndex = j
Exit Sub
End If
'小题数通过检验,统计各类难度试题数量
For k = 0 To 2
objRsSingle.Filter = strFilter & " and 难度=" & k
Chapter(i, k) = Chapter(i, k) + objRsSingle.RecordCount
Next
Case 2 '检查多选题题量分配是否有效
objRsMore.Filter = strFilter
If objRsMore.RecordCount < Int(cmbChapter(i).ItemData(j) * _
txtCount(i) / 100) Then
MsgBox "<" & News(i) & "><" & objRsChapter!名称 & ">中只有<" _
& objRsMore.RecordCount & ">道试题,小题百分比最多<" _
& Int(objRsMore.RecordCount / Val(txtCount(i)) * 100) _
& ">", vbCritical
cmbChapter(i).ListIndex = j
Exit Sub
End If
'小题数通过检验,统计各类难度试题数量
For k = 0 To 2
objRsMore.Filter = strFilter & " And 难度 = " & k
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -