VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
Begin VB.Form Form1 
   AutoRedraw      =   -1  'True
   BackColor       =   &H00008000&
   Caption         =   "Компьютер"
   ClientHeight    =   9300
   ClientLeft      =   1200
   ClientTop       =   2595
   ClientWidth     =   12360
   FillColor       =   &H00C00000&
   BeginProperty Font 
      Name            =   "MS Sans Serif"
      Size            =   9.75
      Charset         =   204
      Weight          =   700
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   ForeColor       =   &H00FFFF00&
   Icon            =   "Компьютер.frx":0000
   LinkTopic       =   "Form1"
   Picture         =   "Компьютер.frx":0442
   ScaleHeight     =   9300
   ScaleWidth      =   12360
   StartUpPosition =   2  'CenterScreen
   WindowState     =   2  'Maximized
   Begin MSComDlg.CommonDialog Dlg7 
      Left            =   10200
      Top             =   4440
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      CancelError     =   -1  'True
      DialogTitle     =   "Загрузить рисунок"
      Filter          =   "*.jpg, *.bmp"
      Flags           =   2
      MaxFileSize     =   26000
   End
   Begin MSComDlg.CommonDialog Dlg6 
      Left            =   10200
      Top             =   3840
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      CancelError     =   -1  'True
      Color           =   127
      DialogTitle     =   "Шрифт таблицы"
      Flags           =   2
      FontBold        =   -1  'True
      FontItalic      =   -1  'True
      FontStrikeThru  =   -1  'True
      FontUnderLine   =   -1  'True
      Max             =   20
      Min             =   6
   End
   Begin MSComDlg.CommonDialog Dlg5 
      Left            =   10200
      Top             =   3240
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      CancelError     =   -1  'True
      DialogTitle     =   "Сохранить результаты "
      FileName        =   "Результат.txt"
      Filter          =   "*.txt"
      Flags           =   2
      InitDir         =   "C:\Комп\"
      Max             =   16
      Min             =   8
   End
   Begin MSComDlg.CommonDialog Dlg4 
      Left            =   10200
      Top             =   2640
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      CancelError     =   -1  'True
      DialogTitle     =   "Открыть результаты "
      FileName        =   "Результат.txt"
      Filter          =   "*.txt"
      Flags           =   2
      InitDir         =   "C:\Комп\"
      Max             =   16
      Min             =   8
   End
   Begin MSComDlg.CommonDialog Dlg3 
      Left            =   10200
      Top             =   2040
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      CancelError     =   -1  'True
      DialogTitle     =   "Загрузка ответов "
      Filter          =   "*.txt"
      Flags           =   2
      Max             =   16
      Min             =   8
   End
   Begin MSComDlg.CommonDialog Dlg2 
      Left            =   10200
      Top             =   1440
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      CancelError     =   -1  'True
      DialogTitle     =   "Загрузка вопросов"
      Filter          =   "*.txt"
      Flags           =   2
      Max             =   16
      Min             =   8
   End
   Begin MSComDlg.CommonDialog Dlg1 
      Left            =   10200
      Top             =   840
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      CancelError     =   -1  'True
      Color           =   127
      DialogTitle     =   "Шрифт Формы"
      Flags           =   2
      FontBold        =   -1  'True
      FontItalic      =   -1  'True
      FontSize        =   12
      FontStrikeThru  =   -1  'True
      FontUnderLine   =   -1  'True
      Max             =   36
      Min             =   8
   End
   Begin VB.Frame Frame2 
      BackColor       =   &H00008000&
      Caption         =   "Выберите тест"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   975
      Left            =   7560
      TabIndex        =   14
      Top             =   720
      Width           =   2175
      Begin VB.OptionButton Option6 
         BackColor       =   &H00008000&
         Caption         =   "выбор"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FFFFFF&
         Height          =   495
         Left            =   360
         TabIndex        =   15
         Top             =   360
         Width           =   1215
      End
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00008000&
      Caption         =   "Показ"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   204
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   495
      Left            =   3960
      TabIndex        =   11
      Top             =   6360
      Width           =   3375
      Begin VB.OptionButton Option5 
         BackColor       =   &H00008000&
         Caption         =   "Выкл"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   13.5
            Charset         =   204
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FFFFFF&
         Height          =   360
         Left            =   2160
         TabIndex        =   13
         Top             =   120
         Width           =   1095
      End
      Begin VB.OptionButton Option4 
         BackColor       =   &H00008000&
         Caption         =   "Вкл"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   13.5
            Charset         =   204
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FFFFFF&
         Height          =   360
         Left            =   1080
         TabIndex        =   12
         Top             =   120
         Width           =   1095
      End
   End
   Begin VB.CommandButton Command6 
      Caption         =   "Новый участник"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   204
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   9360
      MaskColor       =   &H000000FF&
      OLEDropMode     =   1  'Manual
      Style           =   1  'Graphical
      TabIndex        =   9
      Top             =   4920
      UseMaskColor    =   -1  'True
      Width           =   1215
   End
   Begin VB.CommandButton Command5 
      Appearance      =   0  'Flat
      Caption         =   "Ф.И.О."
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   14.25
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   9000
      Style           =   1  'Graphical
      TabIndex        =   10
      Top             =   4920
      UseMaskColor    =   -1  'True
      Width           =   1215
   End
   Begin VB.OptionButton Option3 
      BackColor       =   &H00008000&
      Caption         =   "Мастер"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   204
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   375
      Left            =   2640
      TabIndex        =   8
      Top             =   6600
      Width           =   1215
   End
   Begin VB.OptionButton Option2 
      BackColor       =   &H00008000&
      Caption         =   "Опытный"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   204
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   255
      Left            =   2640
      TabIndex        =   7
      Top             =   6240
      Width           =   1215
   End
   Begin VB.OptionButton Option1 
      BackColor       =   &H00008000&
      Caption         =   "Новичок"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   204
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   375
      Left            =   2640
      MaskColor       =   &H00FFFFFF&
      TabIndex        =   6
      Top             =   5760
      Width           =   1215
   End
   Begin VB.CommandButton Command4 
      Appearance      =   0  'Flat
      Caption         =   "Выход"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   465
      Left            =   9120
      Style           =   1  'Graphical
      TabIndex        =   5
      Top             =   5880
      UseMaskColor    =   -1  'True
      Width           =   1215
   End
   Begin VB.CommandButton Command3 
      Caption         =   "Результат"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   204
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   7320
      Style           =   1  'Graphical
      TabIndex        =   4
      Top             =   5880
      Width           =   1335
   End
   Begin VB.CommandButton Command1 
      Appearance      =   0  'Flat
      Caption         =   "Обучение"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   204
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   3960
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   5880
      Width           =   1215
   End
   Begin VB.TextBox Text1 
      BackColor       =   &H00008000&
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C0FFFF&
      Height          =   1095
      Left            =   120
      MultiLine       =   -1  'True
      TabIndex        =   1
      Top             =   5760
      Width           =   2415
   End
   Begin VB.Timer Timer1 
      Interval        =   1
      Left            =   10200
      Top             =   240
   End
   Begin MSFlexGridLib.MSFlexGrid Grid2 
      Height          =   3975
      Left            =   0
      TabIndex        =   0
      Top             =   1800
      Width           =   1935
      _ExtentX        =   3413
      _ExtentY        =   7011
      _Version        =   393216
      Rows            =   22
      Cols            =   1
      FixedCols       =   0
      BackColor       =   32768
      ForeColor       =   12648447
      BackColorFixed  =   32896
      ForeColorFixed  =   14737632
      ForeColorSel    =   16777215
      BackColorBkg    =   32768
      GridColor       =   16384
      ScrollTrack     =   -1  'True
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   204
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.CommandButton Command2 
      Caption         =   "Тест"
      Height          =   495
      Left            =   5640
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   5880
      Width           =   1215
   End
   Begin VB.Menu Компьютер4 
      Caption         =   "Файл"
      Index           =   4
      Begin VB.Menu Компьютер41 
         Caption         =   "Открыть результат"
         Index           =   41
      End
      Begin VB.Menu Компьютер42 
         Caption         =   "Сохранить результат"
         Index           =   42
      End
   End
   Begin VB.Menu Компьютер1 
      Caption         =   "Список"
      Index           =   1
      Begin VB.Menu Компьютер11 
         Caption         =   "Список"
         Index           =   11
      End
      Begin VB.Menu Компьютер52 
         Caption         =   "Редактор, просмотр рез."
         Index           =   52
      End
   End
   Begin VB.Menu Компьютер5 
      Caption         =   "Редактор"
      Index           =   5
      Begin VB.Menu Компьютер51 
         Caption         =   "В..."
         Index           =   51
         Shortcut        =   ^B
      End
   End
   Begin VB.Menu Компьютер2 
      Caption         =   "Справка"
      Index           =   2
   End
   Begin VB.Menu Компьютер3 
      Caption         =   "Автор"
      Index           =   3
      NegotiatePosition=   3  'Right
   End
   Begin VB.Menu Компьютер6 
      Caption         =   "Шрифт"
      Index           =   6
      Begin VB.Menu Компьютер61 
         Caption         =   "Форма"
         Index           =   61
         Begin VB.Menu Компьютер611 
            Caption         =   "Шрифт"
            Index           =   611
         End
         Begin VB.Menu Компьютер612 
            Caption         =   "Цвет шрифта"
            Index           =   612
         End
         Begin VB.Menu Компьютер613 
            Caption         =   "Цвет фона"
            Index           =   613
         End
         Begin VB.Menu Компьютер615 
            Caption         =   "Удалить Рисунок"
            Index           =   615
         End
         Begin VB.Menu Компьютер614 
            Caption         =   "Вставить Рисунок"
            Index           =   614
         End
      End
      Begin VB.Menu Компьютер62 
         Caption         =   "Таблица"
         Index           =   62
         Begin VB.Menu Компьютер621 
            Caption         =   "Шрифт"
            Index           =   621
         End
         Begin VB.Menu Компьютер622 
            Caption         =   "Цвет шрифта"
            Index           =   622
         End
         Begin VB.Menu Компьютер623 
            Caption         =   "Цвет фона"
            Index           =   623
         End
      End
   End
   Begin VB.Menu Просмотр_фото7 
      Caption         =   "Просмотр фото"
      Index           =   7
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim zvezda(0 To 50) As String, метка As String, vfiles, ofiles, rfiles, info As String, inf, sozv(0 To 50) As String, infvr As String, oz(0 To 100) As String, file1 As String
Dim i As Integer, j As Integer, t As Integer, covp As Integer, osh As Integer, itogo As Integer, r As Integer, kk As Integer, ttt As Integer
Dim byta As Integer, CancelError As Boolean, fl3  As Boolean, fl1 As Boolean, fl2 As Boolean, rez As Single, fo As Single
Dim cw As Long, uch(0 To 20) As Integer, um1(0 To 20) As Integer, um2(0 To 20) As Integer, old(0 To 50) As Integer
Dim vr As Single, fl As Boolean, f As Boolean, k, pr, nr, tt, zr, rz, g, imy(0 To 100) As String, nom(0 To 100), ball(0 To 100), bad(0 To 100), oc(0 To 100) As Integer, nc, nc1, al(1 To 17, 1 To 20), vopr(1 To 50), otv(1 To 50) As String, tc, tm As Integer, vm(0 To 100) As String, vrm(0 To 100), vrs(0 To 100) As String, nomstr(1 To 17) As Integer, nomstol(1 To 20) As Integer
Dim oldX As Single, oldY As Single, kt As Single
Private Sub Command1_Click()
  Grid2.Visible = True
  Grid2.Enabled = True
  Command6.Visible = False
  Command5.Visible = False
  Command3.Visible = False
  Frame2.Visible = False
  fo = Time
  fl = True
  Form1.Cls
  nr = nr + 1
  проверка

 For i = 1 To rz
  Grid2.Row = i
  Grid2.Text = sozv(Grid2.Row)
  Grid2.Text = sozv(Grid2.Row)
 Next

  info = zvezda(nr) 'vopr()
  nc = zvezda(nr)
  prvivod
  If Option4.Value = True Then
   показ 'показ
  End If
 Command2.Visible = False
End Sub

Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If oldX > x Or oldY > y Then
Command1.BackColor = &HFFFF00
Command1.Caption = "ЖМИ"
Else
Command1.BackColor = &HFF00FF
Command1.Caption = "ЖМИ"
End If

oldX = x
oldY = y

End Sub

Private Sub Command2_Click()
 fo = Time
 fl = True
 Command6.Visible = False
 Command5.Visible = False
 Command3.Visible = False
 Command1.Visible = False
 If Command1.Visible = False Then
   Grid2.Enabled = True
 End If

Randomize (Timer) 'перетосовка ответов
 i = 0
 t = 0
 For i = 1 To rz
10 j = Int(Rnd * (rz + 1)) + 1
  fl1 = False
  For t = 1 To i
   If j = old(t) Then fl1 = True
  Next
  If fl1 = False And j <= rz Then old(i) = j Else: GoTo 10
 Next
 
 For i = 1 To rz
  Grid2.Row = i
  Grid2.Col = 0
  Grid2.Text = sozv(old(i))
 Next
  Form1.Cls
  Grid2.Visible = True
  nr = nr + 1
  info = zvezda(nr) 'vopr()
  nc = zvezda(nr)
  prvivod
  проверка 'проверка конца списка вопросов
  Command2.Enabled = False
End Sub

Private Sub Command2_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Command2.FontBold = True
If oldX > x Or oldY > y Then
Command2.BackColor = &HFFFF00
Command2.Caption = "ЖМИ"
Else
Command2.BackColor = &HFF00FF
Command2.Caption = "ЖМИ"
End If

oldX = x
oldY = y

End Sub

Private Sub Command3_Click() ' результат
  Form1.Cls
  Grid2.Visible = False
  Option1.Enabled = True
  Option2.Enabled = True
  Option3.Enabled = True
  Option1.Value = False
  Option2.Value = False
  Option3.Value = False
 
  fl = False
 If zr < ball(tt) Then ball(tt) = zr

 If nr >= 1 Then pr = Int(ball(tt) / zr * 100)
 If pr <= 10 And pr >= 1 Then oc(tt) = 1

 If pr <= 50 And pr > 10 Then oc(tt) = 2
 If pr > 50 And pr <= 70 Then oc(tt) = 3
 If pr > 70 And pr < 95 Then oc(tt) = 4
 If pr >= 95 Then oc(tt) = 5
  Form1.FontSize = 24
 If nr >= 2 Then
   ForeColor = 16776960
  If imy(tt) = "" Then
   Form1.Print nom(tt); "-й"
  Else
   Form1.Print imy(tt)
  End If
  Form1.Print " Из ";
  ForeColor = &H80C0FF
  Form1.Print zr;
  ForeColor = 16776960
  Form1.Print "баллов"
  Form1.Print " набрал баллов";
  ForeColor = &H80C0FF
  Form1.Print ball(tt)
  ForeColor = 16776960
  Form1.Print " сделали ошибок";
  ForeColor = &H80C0FF
  Form1.Print bad(tt)
  ForeColor = 16776960
  Form1.Print " Ваша оценка ";
  ForeColor = &H80C0FF
  Form1.Print oc(tt)
  ForeColor = 16776960
  Form1.Print " Затрачено времени ";
  ForeColor = &H80C0FF
  Form1.Print oz(tt)
  ForeColor = 16776960
 Else
  ForeColor = 255
  Form1.Print " Надо сделать хотя бы 1 ход!"
  Command6.Visible = True
 End If
 info = ""
 nr = 0
 Form1.FontSize = Dlg1.FontSize
 Command3.Visible = False
 Command6.Visible = True
 Command2.Enabled = True
 Command2.Visible = False
End Sub

Private Sub Command3_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If oldX > x Or oldY > y Then
Command3.BackColor = &HFFFF00
Command3.Caption = "ЖМИ"
Else
Command3.BackColor = &HFF00FF
Command3.Caption = "ЖМИ"
End If

oldX = x
oldY = y

End Sub

Private Sub Command4_Click()
сохранить 'сохранить
End
End Sub

Private Sub Command4_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Command4.BackColor = &HFF&
End Sub

Private Sub Command5_Click()
321 imy(tt) = InputBox("Ваша Фамилия и Имя")
If imy(tt) = "" Then
byta = MsgBox("Введите свою фамилию", 48 + 1, "Напоминание")
 If byta = 1 Then GoTo 321
 End If
 
 Command6.Visible = False
 Command5.Visible = False
 Command1.Visible = False
 Command2.Enabled = True
 Command2.Visible = False
 Command3.Visible = False
 If Option6.Value = True And vfiles = "Вопросы по комп.txt" Then
  Frame1.Visible = True
 End If
 Option1.Visible = True
 Option2.Visible = True
 Option3.Visible = True
 Option1.Enabled = True
 Option2.Enabled = True
 Option3.Enabled = True
 Option1.Value = False
 Option2.Value = False
 Option3.Value = False
 
End Sub

Private Sub Command5_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If oldX > x Or oldY > y Then
Command5.BackColor = &HFFFF00
Command5.Caption = "ВВОД"
Else
Command5.BackColor = &HFF00FF
Command5.Caption = "ВВОД"
End If

oldX = x
oldY = y

End Sub

Private Sub Command6_Click()
fl = False
If fl2 = False Then
 byta = MsgBox("Новый список?", 32 + 4, "Вопрос?")
  If byta = 6 Then
    tt = 0
    fl2 = True
   Else
    fl2 = True
   End If
End If
 tt = tt + 1
 nom(tt) = tt
 Command6.Visible = False
 Command5.Visible = True
 nr = 0
 ball(tt) = 0
 bad(tt) = 0
 Form1.Cls
 Option1.Value = False
 Option2.Value = False
 Option3.Value = False
Frame2.Visible = False
End Sub

Private Sub Command6_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Command6.FontBold = True
If oldX > x Or oldY > y Then
Command6.BackColor = &HFFFF00
Command6.Caption = "НАЖМИ"
Else
Command6.BackColor = &HFF00FF
Command6.Caption = "НАЖМИ"
End If

oldX = x
oldY = y
End Sub

Private Sub Form_Click()
If Frame2.Visible = False Then
If fl3 = False And Frame2.Visible = False Then
 Command3.Visible = False
 Grid2.Visible = False
 Frame1.Visible = False
 fl3 = True
Else
 If Option6.Value = True Then
  Frame1.Visible = True
 End If
 Command3.Visible = True
 Grid2.Visible = True
 fl3 = False
End If
End If
End Sub

Private Sub Form_DblClick()
Frame2.Visible = True
Option6.Value = False
End Sub


Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
 If Len(info) >= 1 And (KeyCode = vbKeySpace Or KeyCode = vbKeyReturn) Then 'проверка
 
  If info = otv(nr) And fl = False Or info <> otv(nr) And fl = False Or info = "" And fl = True Then
   predost 'предостережение
  End If
       nr = nr + 1
  info = zvezda(nr) 'vopr()
  nc = zvezda(nr)
  prvivod 'вывод вопроса
  Grid2.Enabled = True
 End If
 
 If nr = 0 And info = "" Then
    predost 'предостережение
 End If
If KeyCode = vbKeyEscape Then End
 проверка 'проверка конца списка вопросов

End Sub

Private Sub Form_Load()
CancelError = True
fo = Time
fl = False
tt = 1
infvr = "1:00:00"
ball(tt) = 0
bad(tt) = 0
nom(tt) = tt
oz(tt) = "0"
 Command5.Visible = True
 Command1.Visible = False
 Command2.Visible = False
 Option4.Value = False
 Option5.Value = False
 Frame1.Visible = False
 Option1.Visible = False
 Option2.Visible = False
 Option3.Visible = False
 Option6.Value = False
fl3 = False
 Command3.Visible = False
Grid2.Visible = False
KомпьютерЗ.Visible = True
Form1.Visible = False
Command6.Visible = False
Command5.Visible = False
Dlg1.FontSize = 12
Dlg6.FontSize = 11
Form1.Font.Size = Dlg1.FontSize
Grid2.Font.Size = Dlg6.FontSize
Dlg1.Color = &HFFFF00
Form1.ForeColor = Dlg1.Color


End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If (Button = vbMiddleButton Or Button = vbRightButton) And Len(inf) >= 1 Then  'проверка

  nr = nr + 1
 
  info = zvezda(nr) 'vopr()
  nc = zvezda(nr)
  prvivod 'вывод вопроса
  Grid2.Enabled = True
End If
 
 If nr = 0 And info = "" Then
  predost 'предостережение
 End If
 проверка 'проверка конца списка вопросов

End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If Command5.Visible = True Or Command6.Visible = True Then
 If oldX > x Or oldY > y Then
  Command5.BackColor = &H8000&
  Command5.Caption = "Ф.И.О."
  Command6.BackColor = &HFFFF00
  Command6.FontBold = False
  Command6.Caption = "Новый участник"
 Else
  Command5.BackColor = &H8000000F
  Command5.Caption = "Ф.И.О."
  Command6.BackColor = &H8000000F
  Command6.FontBold = False
  Command6.Caption = "Новый участник"
 End If
End If
If Command1.Visible = True Or Command2.Visible = True Or Command3.Visible = True Then
 If oldX > x Or oldY > y Then
  Command1.FontBold = False
  Command1.BackColor = &H8000&
  Command1.Caption = "Обучение"
  Command2.BackColor = &H8000& '&HFFFF00
  Command2.FontBold = False
  Command2.Caption = "Тест"
  Command3.BackColor = &H8000&
  Command3.FontBold = False
  Command3.Caption = "Результат"
Else
  Command1.FontBold = True
  Command1.BackColor = &H8000000F
  Command1.Caption = "Обучение"
  Command2.BackColor = &H8000000F
  Command2.FontBold = True
  Command2.Caption = "Тест"
  Command3.BackColor = &H8000000F
  Command3.FontBold = True
  Command3.Caption = "Результат"
End If
End If
Command4.BackColor = &H8000000F

oldX = x
oldY = y
End Sub

Private Sub Form_Resize()
 On Error GoTo метка

 Command1.Top = ScaleHeight - 1100
 Command2.Top = ScaleHeight - 1100
 Command3.Top = ScaleHeight - 1100
 Command4.Top = ScaleHeight - 1100
 Command4.Left = ScaleWidth - 1700
 Command5.Left = ScaleWidth - 1700
 Command6.Left = ScaleWidth - 1700
 Text1.Top = ScaleHeight - 1200
 Option1.Top = ScaleHeight - 1200
 Option2.Top = ScaleHeight - 800
 Option3.Top = ScaleHeight - 500
 Grid2.Width = ScaleWidth - 150
 Grid2.Height = ScaleHeight - 3400
 Frame1.Top = ScaleHeight - 600
 Frame2.Left = ScaleWidth - 3000
 Grid2.ColWidth(0) = ScaleWidth
If WindowState = 2 Then
  Form1.FontSize = Dlg1.FontSize
   Grid2.FontSize = Dlg6.FontSize
Else
  Form1.FontSize = Dlg1.FontSize - 1
  Grid2.FontSize = Dlg6.FontSize - 2

End If
метка:
End Sub

Private Sub Grid2_KeyDown(KeyCode As Integer, Shift As Integer)

 If Len(info) >= 1 And (KeyCode = vbKeySpace Or KeyCode = vbKeyReturn) Then 'проверка
 
  If info = otv(nr) And fl = False Or info <> otv(nr) And fl = False Or info = "" And fl = True Then
   predost 'предостережение
  End If
  
   nr = nr + 1
 
   info = zvezda(nr) 'vopr()
   nc = zvezda(nr)
   prvivod

 End If
   vrm(tt) = oz(tt)

 If nr = 0 And info = "" Then
    predost 'предостережение
 End If
If KeyCode = vbKeyEscape Then End
 проверка 'проверка конца списка вопросов

End Sub


Private Sub Option1_Click()
 fo = Time
 fl = True
 nr = 0
 infvr = "0:15:00"
 Option2.Enabled = False
 Option3.Enabled = False
 Command1.Visible = True
 Command2.Visible = True
End Sub

Private Sub Option2_Click()
 fl = True
 fo = Time
 nr = 0
 infvr = "0:10:00"
 Option1.Enabled = False
 Option3.Enabled = False
 Command1.Visible = True
 Command2.Visible = True
End Sub

Private Sub Option3_Click()
 fl = True
 fo = Time
 infvr = "0:05:00"
 kt = TimeValue(Time) ' * zr
 'Form1.Print Right(Str(Time - fo / 3.5 / zr), 5) ' для среднего
 'Form1.Print Right(Str(Time - fo / 2 / zr), 5)'для новичка
 'Form1.Print Str(Time - kt)  ' )
 nr = 0
 
 Option1.Enabled = False
 Option2.Enabled = False
 Command1.Visible = True
 Command2.Visible = True
End Sub

Private Sub Option4_Click()
 Option4.ForeColor = &H80C0FF
 Option4.Caption = "Вкл"
 Option5.ForeColor = &H8000&
 Option5.Caption = "Выкл"
End Sub

Private Sub Option5_Click()
 Option5.ForeColor = &H80C0FF
 Option5.Caption = "Выкл"
 Option4.ForeColor = &H8000&
 Option4.Caption = "Вкл"
End Sub

Private Sub Option6_Click()
 Frame2.Visible = False
 чтение 'чтение данных из текстовых файлов
 Grid2.Row = 0
 Grid2.Text = "                                ВЫБЕРИТЕ ОТВЕТ"
 Form1.Print zr
 Grid2.Rows = rz + 2
 For i = 0 To rz + 1
  Grid2.RowHeight(i) = 350
  old(i) = i
 Next
 Command6.Visible = True
 If Right(Dlg2.FileName, 8) = "комп.txt" Then
  Frame1.Visible = True
 Else
  Frame1.Visible = False
End If
End Sub


Private Sub Text1_Change()

End Sub

Private Sub Timer1_Timer()
 If fl = False Then
  Text1.Text = "Дата " + Str(Date) + "    " + "Время " + Str(Time)
 Else
  Text1.Text = "Время работы " + Str(Time - fo)
 End If
   oz(tt) = Str(Time - fo)
 If Str(Time - fo) >= infvr Then
   Form1.Cls
   Form1.Print "Ваше время истекло. Нажмите -Результат-"
   infvr = "1:00:00"
   Command1.Visible = False
   Command2.Enabled = True
   Command2.Visible = False
   Command3.Enabled = True
   Command3.Visible = True
   Grid2.Visible = False
   oz(tt) = Str(Time - fo)
 End If
End Sub
Private Sub Grid2_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
 If Button = vbLeftButton Then
  inf = sozv(old(Grid2.Row)) 'otv()
  nc1 = sozv(old(Grid2.Row))
  prvivod1 'вывод ответа
  protv 'правилный ответ
  prosh 'Ошибка
 End If
   vrm(tt) = oz

If (Button = vbMiddleButton Or Button = vbRightButton) And Len(inf) >= 1 Then  'проверка
  nr = nr + 1
  проверка 'проверка конца списка вопросов
  info = zvezda(nr) 'vopr()
  nc = zvezda(nr)
  If nr <= zr Then
   prvivod 'вывод вопроса
  End If
End If
 If nr > zr Then
   Grid2.Enabled = True
   Grid2.Visible = False
 End If

 If nr = 0 And info = "" Then
  predost 'предостережение
 End If
  If Command2.Visible = False Then
   Grid2.Enabled = True
  Else
   Grid2.Enabled = False
  End If
End Sub

Private Sub prosh() 'Ошибка

  If sozv(nr) <> sozv(old(Grid2.Row)) Then
     Form1.FontBold = True
    ForeColor = 255
     Form1.Print "ОШИБКА"
     Form1.FontBold = False
     bad(tt) = bad(tt) + 1
     ForeColor = Dlg1.Color
  'ForeColor = &HFFFFFF
     Form1.Print "Правильно так..."
     Form1.Print sozv(nr)
     If bad(tt) > zr Then bad(tt) = zr
  End If
End Sub
Private Sub protv() 'правилный ответ
 
  If sozv(nr) = inf Then
   Form1.FontBold = True
   ForeColor = 255 '&HFFFFFF
   Form1.Print "ВЕРНО"
   Form1.FontBold = False
   ball(tt) = ball(tt) + 1
  End If
  ForeColor = Dlg1.Color

End Sub
Private Sub prcls() 'очистка
 i = 0
 j = 0
 info = ""
 inf = ""
 Form1.Cls
 pr = 0
 fl = True
End Sub
Private Sub predost() 'предостережение
  Form1.Cls
  Form1.Print " Выберите уровень или тест"
End Sub

Private Sub prvivod() 'вывод вопроса
  Form1.Cls
  ForeColor = Dlg1.Color
 If WindowState = 2 Then
   Form1.FontSize = Dlg1.FontSize
'FontSize = 12
 Else
   Form1.FontSize = Dlg1.FontSize - 1
'FontSize = 11
 End If
  Form1.FontBold = True
  Form1.Print nr; info
  Form1.FontBold = False
  ForeColor = &HE0E0E0

End Sub
Private Sub prvivod1() 'вывод  слова
  Form1.Cls
    
  Form1.FontBold = True
If WindowState = 2 Then
  Form1.FontSize = Dlg1.FontSize
'FontSize = 12
Else
  Form1.FontSize = Dlg1.FontSize - 1
'FontSize = 11
End If
  ForeColor = Dlg1.Color

  'ForeColor = &HE0E0E0
  Form1.Print nr; zvezda(nr)
 ForeColor = &HFFFF00
If WindowState = 2 Then
  Form1.FontSize = Dlg1.FontSize - 2
'FontSize = 11
Else
  Form1.FontSize = Dlg1.FontSize - 3
'FontSize = 10
End If
Form1.Print inf
  ForeColor = &HFFF000
  Form1.FontBold = False
End Sub

Private Sub чтение()
On Error GoTo метка

12 Dlg2.ShowOpen
vfiles = Dlg2.FileName
If vfiles = "" Then predost: GoTo 12
13 Dlg3.ShowOpen
ofiles = Dlg3.FileName
If ofiles = "" Then predost: GoTo 13
 Open vfiles For Input As #1
 i = 1
 Do Until EOF(1)
 Input #1, zvezda(i)
  i = i + 1
  r = i
 Loop
 Close #1

 zr = r - 1
 Open ofiles For Input As #2
 i = 1
 Do Until EOF(2)
 Input #2, sozv(i)
  i = i + 1
  rz = i
 Loop
 Close #2
 
 rz = rz - 1
 For i = 1 To rz
  old(i) = i
 Next
метка:
End Sub
Private Sub проверка()
  If nr > zr Or (ball(tt) + bad(tt)) > zr Then
   Form1.Cls
   Form1.FontSize = 20
   ForeColor = &HFFFF00
   Form1.Print "Всё. Нажмите ";
   ForeColor = &H80C0FF
   Form1.Print "-Результат-,";
   ForeColor = &HFFFF00
   Form1.Print " затем ";
   ForeColor = &H80C0FF
   Form1.Print "-Новый участник-"
   ForeColor = &HFFFF00
   fl = False
   oz(tt) = Str(Time - fo)
   Command1.Visible = False
   Command2.Visible = False
   Command3.Visible = True
   Command6.Visible = True
   Grid2.Enabled = True
   Grid2.Visible = False
   Form1.FontSize = Dlg1.FontSize
  End If
End Sub
Private Sub показ()
  If Command1.Value = True Then
    If nr = 1 Then
     Kомпьютер15.Visible = True
     Kомпьютер14.Visible = True
     Kомпьютер12.Visible = True
     Kомпьютер9.Visible = True
     Kомпьютер11.Visible = True
     Kомпьютер5.Visible = True
     Kомпьютер3.Visible = True
     Kомпьютер2.Visible = True
     Kомпьютер1.Visible = True
     Kомпьютер19.Visible = True
     Kомпьютер18.Visible = True
End If
    If nr = 2 Then
     Kомпьютер1.Visible = True
     Kомпьютер2.Visible = True
     Kомпьютер3.Visible = True
     Kомпьютер4.Visible = True
     Kомпьютер5.Visible = True
     Kомпьютер6.Visible = True
    End If
    If nr = 3 Then
     Kомпьютер7.Visible = True
     Kомпьютер8.Visible = True
     Kомпьютер9.Visible = True
     Kомпьютер10.Visible = True
     Kомпьютер11.Visible = True
    End If
    If nr = 4 Then
     Kомпьютер12.Visible = True
     Kомпьютер13.Visible = True
     Kомпьютер14.Visible = True
    End If
    If nr = 5 Then
     Kомпьютер15.Visible = True
     Kомпьютер16.Visible = True
    End If
    If nr = 6 Then
     Kомпьютер1.Visible = True
    End If
    If nr = 7 Then
     Kомпьютер2.Visible = True
     Kомпьютер4.Visible = True
    End If
    If nr = 8 Then
     Kомпьютер4.Visible = True
    End If
    If nr = 9 Then
     Kомпьютер3.Visible = True
    End If
    If nr = 11 Then
     Kомпьютер9.Visible = True
    End If
    If nr = 12 Then
     Kомпьютер11.Visible = True
    End If
    If nr = 14 Then
     Kомпьютер17.Visible = True
    End If
    If nr = 15 Then
     Kомпьютер18.Visible = True
    End If
    If nr = 16 Then
     Kомпьютер19.Visible = True
    End If
    If nr = 17 Then
     Kомпьютер12.Visible = True
     Kомпьютер14.Visible = True
    End If
    If nr = 18 Then
     Kомпьютер14.Visible = True
    End If
    If nr = 19 Then
     Kомпьютер12.Visible = True
    End If
    If nr = 20 Then
     Kомпьютер15.Visible = True
    End If
  End If
End Sub

Private Sub Компьютер11_Click(Index As Integer)
 Form1.Cls
 Grid2.Visible = False
 ForeColor = &HFFFF00
 Form1.FontSize = Dlg1.FontSize
 For j = 1 To tt
  If imy(j) = "" Then
    Form1.CurrentX = 200
    Form1.Print nom(j); "-й набрал ";
  Else
    Form1.CurrentX = 200
    Form1.Print imy(j); " ";
  End If
   Form1.Print ball(j); " баллов,"; bad(j); "ошибок, за "; oz(j); " c,"; " Оценка="; oc(j)
 Next
End Sub

Private Sub Компьютер2_Click(Index As Integer)
 KомпьютерС.Visible = True
End Sub

Private Sub Компьютер3_Click(Index As Integer)
 KомпьютерА.Visible = True
End Sub

Private Sub Компьютер41_Click(Index As Integer)

'If Option6.Value = True Then
On Error GoTo метка

Dlg4.ShowOpen
rfiles = Dlg4.FileName

 If ttt < 1 And tt > 1 Then
  Open rfiles For Input As #1
  i = 1
  ttt = 0
  Do Until EOF(1)
   Input #1, imy(i)
   Input #1, ball(i)
   Input #1, bad(i)
   Input #1, oz(i)
   Input #1, oc(i)
   ttt = ttt + 1
  Loop
  Close #1

  For j = ttt + 1 To ttt + tt
   i = i + 1
   imy(j) = imy(i)
   ball(j) = ball(i)
   bad(j) = bad(i)
   oc(j) = oc(i)
  Next

  i = 1
  Open rfiles For Input As #1
   Do Until EOF(1)
   Input #1, imy(i)
   Input #1, zr
   Input #1, ball(i)
   Input #1, bad(i)
   Input #1, oz(i)
   Input #1, oc(i)
   i = i + 1
  Loop
  Close #1
  tt = ttt + tt
 End If

 If ttt < 1 And tt = 1 Then
  Open rfiles For Input As #1
  i = 1
  Do Until EOF(1)
   Input #1, imy(i)
   Input #1, zr
   Input #1, ball(i)
   Input #1, bad(i)
   Input #1, oz(i)
   Input #1, oc(i)
   i = i + 1
   ttt = i - 1
  Loop
  Close #1
  tt = ttt
 End If

 Form1.Cls
 Grid2.Visible = False
 ForeColor = &HFFFF00
 Form1.FontSize = Dlg1.FontSize

 If tt > 1 Then
   For j = 1 To tt
   nom(j) = j
    If imy(j) = "" Then
     Form1.CurrentX = 200
     Form1.Print nom(j); "-й набрал ";
    Else
     Form1.CurrentX = 200
     Form1.Print imy(j); " ";
    End If
   Form1.Print ball(j); " баллов,"; bad(j); " ошибок,"; " Время "; oz(j); " оценка "; oc(j)
   Next
 Else
    Form1.CurrentX = 200
    Form1.Print " Сохранённых данных нет"
 End If
'Else
    'Form1.CurrentX = 200
    'Form1.Print " Выберите тест"
'End If
метка:
End Sub

Private Sub Компьютер42_Click(Index As Integer)
сохранить 'сохранить
End Sub

Private Sub сохранить()
byta = MsgBox("Сохранить файл?", 32 + 3, "Вопрос?")
If byta = 2 Or Option6.Value = False Then GoTo 6

If byta = 6 Then
If rfiles = "" Then
 On Error GoTo метка

 Dlg5.ShowSave
 rfiles = Dlg5.FileName
End If
If Right(rfiles, 3) <> "txt" Then
rfiles = rfiles + ".txt"
End If
Open rfiles For Output As #1
  For i = 1 To tt
   Print #1, imy(i)
   Print #1, zr
   Print #1, ball(i)
   Print #1, bad(i)
   Print #1, oz(i)
   Print #1, oc(i)

  Next
 Close #1
    Form1.CurrentY = 800
    Form1.Print " Файл сохранён"
End If
If byta = 7 Then
 Dlg5.ShowSave
 rfiles = Dlg5.FileName
 If rfiles = "" Or rfiles = "." Then GoTo 6
imy(1) = ""
ball(1) = 0
bad(1) = 0
oz(1) = ""
 oc(1) = 0
Open rfiles For Output As #1
    Print #1, imy(1)
   Print #1, zr
   Print #1, ball(1)
   Print #1, bad(1)
   Print #1, oz(1)
   Print #1, oc(1)
 Close #1
    Form1.CurrentY = 800
    Form1.Print "  Сохранён пустой Файл"
End If


6 '
метка:
End Sub

Private Sub Компьютер51_Click(Index As Integer)
On Error GoTo метка
123 imy(1) = InputBox("Введите пароль")
If imy(1) = "учитель" Then
КомпьютерВ.Visible = True

fl2 = False
Else
byta = MsgBox("Не правильный пароль. Повторить?", 48 + 4, "Сообщение")
If byta = 6 Then GoTo 123
End If

imy(1) = ""
метка:
End Sub

Private Sub Компьютер52_Click(Index As Integer)
Form3.Visible = True
End Sub

Private Sub Компьютер611_Click(Index As Integer)
On Error GoTo метка

Dlg1.ShowFont
Form1.Font.Size = Dlg1.FontSize
Form1.Font.Name = Dlg1.FontName
Form1.Font.Bold = Dlg1.FontBold
Form1.Font.Italic = Dlg1.FontItalic
Form1.Font.Underline = Dlg1.FontUnderline
prvivod
prvivod1
метка:
End Sub

Private Sub Компьютер612_Click(Index As Integer)
On Error GoTo метка

Dlg1.ShowColor
Form1.ForeColor = Dlg1.Color
prvivod
prvivod1
prosh
protv
метка:
End Sub

Private Sub Компьютер613_Click(Index As Integer)
On Error GoTo метка

Dlg1.ShowColor
Form1.BackColor = Dlg1.Color
Text1.BackColor = Dlg1.Color
Option2.BackColor = Dlg1.Color
Option1.BackColor = Dlg1.Color
Option3.BackColor = Dlg1.Color
Frame1.BackColor = Dlg1.Color
Option4.BackColor = Dlg1.Color
Option5.BackColor = Dlg1.Color
Option6.BackColor = Dlg1.Color
Frame2.BackColor = Dlg1.Color
метка:
End Sub
Private Sub Компьютер614_Click(Index As Integer)
On Error GoTo метка

Dlg7.ShowOpen
rfiles = Dlg7.FileName
Form1.Picture = LoadPicture(rfiles)
If Option6 = True Then
prvivod 'вывод вопроса
prvivod1
protv
prosh
End If
Exit Sub

метка:

End Sub

Private Sub Компьютер615_Click(Index As Integer)
Form1.Picture = LoadPicture()
  prvivod 'вывод вопроса
End Sub

Private Sub Компьютер621_Click(Index As Integer)
On Error GoTo метка

Dlg6.ShowFont
Grid2.Font.Size = Dlg6.FontSize
Grid2.Font.Name = Dlg6.FontName
Grid2.Font.Bold = Dlg6.FontBold
Grid2.Font.Italic = Dlg6.FontItalic
Grid2.Font.Underline = Dlg6.FontUnderline
 For i = 1 To rz
  Grid2.Row = i
  Grid2.Text = ""
  Grid2.Text = ""
 Next
 For i = 1 To rz
  Grid2.Row = i
  Grid2.Text = sozv(old(i))
  Grid2.Text = sozv(old(i))
 Next
метка:
End Sub

Private Sub Компьютер622_Click(Index As Integer)
On Error GoTo метка

Dlg6.ShowColor
Grid2.ForeColor = Dlg6.Color
 For i = 1 To rz
  Grid2.Row = i
  Grid2.Text = ""
  Grid2.Text = ""
 Next
 For i = 1 To rz
  Grid2.Row = i
  Grid2.Text = sozv(old(i))
  Grid2.Text = sozv(old(i))
 Next
метка:
End Sub

Private Sub Компьютер623_Click(Index As Integer)
On Error GoTo метка

Dlg6.ShowColor
Grid2.BackColor = Dlg6.Color
метка:
End Sub

Private Sub Просмотр_фото7_Click(Index As Integer)
Form2.Visible = True
End Sub
