哪位朋友帮忙给个单机版的考试系统,用vb+access开发的,有源代码,能够...

发布网友 发布时间:2022-04-24 01:23

我来回答

1个回答

热心网友 时间:2022-05-05 01:11

  去年做了一个。如果想要的话。留个邮箱吧。
  下面是部分内容。
  Option Explicit
  Dim timu() As Integer
  Dim da(), rda() As String
  Dim ts As Integer
  Dim fn As Integer

  Private Sub Command1_Click()
  Dim opt As Integer
  If ts = 1 Then
  MsgBox "已返回题目开始。"
  Exit Sub
  End If
  For opt = Option1.LBound To Option1.UBound
  If Option1(opt).Value Then Option1(opt).Value = False
  Next
  ts = ts - 1
  Data1.Recordset.Move (timu(ts) - timu(ts + 1))
  rda(ts) = Text2.Text
  Label9.Caption = ts
  End Sub

  Private Sub Command2_Click()
  Dim opt As Integer
  If ts = Label4.Caption Then
  MsgBox "题目已全部出完。"
  Exit Sub
  End If
  For opt = Option1.LBound To Option1.UBound
  If Option1(opt).Value Then Option1(opt).Value = False
  Next
  ts = ts + 1
  Data1.Recordset.Move (timu(ts) - timu(ts - 1))
  rda(ts) = Text2.Text
  Label9.Caption = ts
  End Sub

  Private Sub Command3_Click()
  Form2.Show
  Unload Form3
  End Sub

  Private Sub Command4_Click()
  Dim opt As Integer
  Dim yn As Boolean

  For opt = Option1.LBound To Option1.UBound
  If Option1(opt).Value Then yn = True
  Next

  If yn Then
  Label5.Caption = Text2.Text
  Else
  MsgBox "请你先选择答案!"
  End If

  End Sub

  Private Sub Command5_Click()
  Dim opt As Integer
  Dim dyn As Integer
  Dim vyn As Integer

  If ts <> Label4.Caption Then
  vyn = MsgBox("题目尚未答完,是否确定交卷?点击是交卷,点击否重新答题。", vbYesNo)
  If vyn = vbNo Then Exit Sub
  End If

  For opt = 1 To ts
  If da(opt) = rda(opt) Then dyn = dyn + 1
  Next opt
  MsgBox "已回答" + Str(ts) + "道问题,答对" + Str(dyn) + "道。"
  End Sub

  Private Sub Form_Activate()
  Dim cy As Integer
  Dim ccy As Integer
  Dim ccn As Boolean
  Dim drr As Integer
  ReDim timu(1 To Label4.Caption)
  ReDim da(1 To Label4.Caption)
  ReDim rda(1 To Label4.Caption)

  Data1.Recordset.MoveLast
  drr = Data1.Recordset.RecordCount
  Randomize
  timu(1) = Int(drr * Rnd + 1)
  For cy = 2 To Label4.Caption
  timu(cy) = Int(drr * Rnd + 1)
  Do
  ccy = ccy + 1
  If timu(cy) = timu(ccy) Then
  timu(cy) = Int(drr * Rnd + 1)
  ccy = 0
  End If
  If ccy = cy - 1 Then Exit Do
  Loop
  Next cy
  Data1.Recordset.MoveFirst
  ts = 1
  Data1.Recordset.Move (timu(ts) - 1)
  rda(1) = Text2.Text
  Label9.Caption = ts
  End Sub

  Private Sub Form_Unload(Cancel As Integer)
  Form3.Hide
  Form2.Show
  End Sub

  Private Sub Option1_Click(Index As Integer)
  da(ts) = Chr(Index + 65)
  End Sub

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com