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

📄 显示分数.frm

📁 这是一个用VB编写的在线考试系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form4 
   Caption         =   "打分系统"
   ClientHeight    =   6090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   9045
   LinkTopic       =   "Form4"
   ScaleHeight     =   6090
   ScaleWidth      =   9045
   StartUpPosition =   1  '所有者中心
   Begin VB.TextBox Text2 
      Height          =   270
      Left            =   5280
      MaxLength       =   2
      TabIndex        =   7
      Top             =   100
      Width           =   735
   End
   Begin VB.CommandButton Command2 
      Caption         =   "退出打分"
      Height          =   375
      Left            =   7200
      TabIndex        =   5
      Top             =   5520
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Enabled         =   0   'False
      Height          =   375
      Left            =   840
      TabIndex        =   4
      Top             =   5520
      Width           =   1215
   End
   Begin VB.Frame Frame1 
      Caption         =   "判断题"
      Height          =   4815
      Left            =   120
      TabIndex        =   2
      Top             =   600
      Width           =   8655
      Begin VB.TextBox Text3 
         Height          =   4335
         Left            =   4440
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   8
         Top             =   360
         Width           =   3975
      End
      Begin VB.TextBox Text1 
         Enabled         =   0   'False
         Height          =   4335
         Left            =   240
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   3
         Top             =   360
         Width           =   3975
      End
   End
   Begin VB.ComboBox Combo1 
      Height          =   300
      Left            =   1200
      TabIndex        =   1
      Text            =   "Combo1"
      Top             =   120
      Width           =   2415
   End
   Begin VB.Label Label2 
      Caption         =   "得分:"
      Height          =   255
      Left            =   4680
      TabIndex        =   6
      Top             =   120
      Width           =   735
   End
   Begin VB.Label Label1 
      Caption         =   "准考证号:"
      Height          =   255
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   975
   End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Combo1_Click()
Dim ifen As Integer
Dim jfen As Integer
Dim kfen As Integer
Dim sfen As String
Dim sal As String
Dim pn As Integer
Dim tea As String
Dim teb As String
alfen = 0
Dim fnu(3) As Integer
fnu(1) = 1
fnu(2) = 2
fnu(3) = 1
Open App.Path & "\job\" & Combo1.Text & "\data\inf.dat" For Binary As #2
Open App.Path & "\job\" & Combo1.Text & "\data\result.dat" For Binary As #5
Dim p(50) As Integer
For ifen = 1 To 3
Open App.Path & "\data\dsk00" & Trim(Str(ifen)) & ".dat" For Binary As #4
sfen = readfile(0, 2, 0)
sal = ""
pn = 1
p(0) = 0
For kfen = 1 To Len(sfen)
If Mid(sfen, kfen, 1) = "\" Then
p(pn) = Val(sal)
kfen = kfen + 1
sal = ""
pn = pn + 1
End If
sal = sal & Mid(sfen, kfen, 1)
Next
For jfen = 1 To pn - 1
tea = Trim(readfile(4, 4, p(jfen) - p(jfen - 1)))
teb = Trim(readfile(0, 5, 0))
If Val(tea) = Val(teb) Then
alfen = alfen + fnu(ifen)
End If
Next
Close #4
Next
Close #5
Open App.Path & "\data\ask004.dat" For Binary As #4
Text1.Text = readfile(5, 4, Val(readfile(0, 2, 0)) - 1)
Text1.Text = readfile(0, 4, 0)
Open App.Path & "\job\" & Combo1.Text & "\data\resultb.dat" For Binary As #5
Text3.Text = readfile(0, 5, 0)
Close #5
Close #4
Frame1.Caption = "判断题"
Text2.Enabled = True
Text2.Text = ""
Combo1.Enabled = False
Text2.SetFocus
End Sub

Private Sub Command1_Click()
If Text2.Text = "" Or Text2.Text = vbNullString Then
Text2.SetFocus
Exit Sub
End If
If Frame1.Caption = "判断题" Then
alfen = alfen + Val(Trim(Text2.Text))
Open App.Path & "\data\ask005.dat" For Binary As #4
Text1.Text = readfile(5, 4, Val(readfile(0, 2, 0)) - 1)
Text1.Text = readfile(0, 4, 0)
Open App.Path & "\job\" & Combo1.Text & "\data\resultc.dat" For Binary As #5
Text3.Text = readfile(0, 5, 0)
Close #5
Close #4
Frame1.Caption = "编程题"
Text2.Text = ""
Text2.SetFocus
Command1.Enabled = False
Else
alfen = alfen + Val(Trim(Text2.Text))
Dim fenstr As String
fenstr = Trim(alfen)
If Len(fenstr) = 2 Then
fenstr = "0" & fenstr
End If
If Len(fenstr) = 1 Then
fenstr = "00" & fenstr
End If
Open App.Path & "\idend.dat" For Binary As 5
bytemp = addfen(Combo1.Text, 5, fenstr)
Combo1.RemoveItem Combo1.ListIndex
Close #2
Combo1.Enabled = True
Command1.Enabled = False
Text2.Text = ""
Text2.Enabled = False
End If
End Sub

Private Sub Command2_Click()
Close #5
Close #4
Close #2
Form1.Visible = True
Form1.Command5.Enabled = True
Form1.Command6.Enabled = True
Form1.Command10.Enabled = True
Form1.Command11.Enabled = True
Form1.addfen.Enabled = True
Form1.runfen.Enabled = True
Form1.lookfen.Enabled = True
Form1.twostud.Enabled = True
Form1.SetFocus
Unload Me
End Sub

Private Sub Form_Load()
Open App.Path & "\idend.dat" For Binary As 8
Dim sa, sb As String
Do While 1
sa = readfile(0, 8, 0)
If sa = "seek_end" Then Exit Do
sb = readfile(0, 8, 0)
sb = readfile(0, 8, 0)
If sb = "999" Then
Combo1.AddItem sa
End If
Loop
Close #8
End Sub


Private Sub Form_Unload(Cancel As Integer)
Close #5
Close #4
Close #2
Form1.Visible = True
Form1.Command5.Enabled = True
Form1.Command6.Enabled = True
Form1.Command10.Enabled = True
Form1.Command11.Enabled = True
Form1.SetFocus
End Sub

Private Sub Text2_Change()
If Text2.Text = "" Or Text2.Text = vbNullString Then Exit Sub
If Right(Text2.Text, 1) > "9" Or Right(Text2.Text, 1) < "0" Then
Text2.Text = Left(Text2.Text, Len(Text2.Text) - 1)
Text2.SelStart = Len(Text2.Text)
Exit Sub
End If
If Len(Text2.Text) >= 1 Then
Command1.Enabled = True
End If
End Sub

⌨️ 快捷键说明

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