1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
| unit Unit6;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, sRichEdit, StdCtrls, sRadioButton, ExtCtrls, sPanel,
sMemo, sButton;
type
TForm6 = class(TForm)
DateTimePicker1: TDateTimePicker;
sButton1: TsButton;
sMemo1: TsMemo;
sPanel1: TsPanel;
sRadioButton1: TsRadioButton;
sRadioButton2: TsRadioButton;
sRadioButton3: TsRadioButton;
sRadioButton4: TsRadioButton;
sRichEdit2: TsRichEdit;
sRichEdit1: TsRichEdit;
procedure sButton1Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure sRadioButton1Click(Sender: TObject);
procedure sRadioButton2Click(Sender: TObject);
procedure sRadioButton3Click(Sender: TObject);
procedure sRadioButton4Click(Sender: TObject);
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form6: TForm6;
kol,oc,i,n,werno,net:integer;
v:textfile;
implementation
uses Unit5;
{$R *.dfm}
procedure TForm6.sButton1Click(Sender: TObject);
var s:string;
otw:string;
begin
sRadioButton1.Checked:=False;
sRadioButton2.Checked:=False;
sRadioButton3.Checked:=False;
sRadioButton4.Checked:=False;
sButton1.Enabled:=False;
DateTimePicker1.Date:=now;
DateTimePicker1.Time:=now;
begin
if n<>0 then begin otw:=sMemo1.Lines.Strings[n-1];
if (sRadioButton1.Checked)and(otw='À') then werno:=werno+1
else
if (sRadioButton2.Checked)and(otw='Â') then werno:=werno+1
else
if (sRadioButton3.Checked)and(otw='C') then werno:=werno+1
else
if (sRadioButton4.Checked)and(otw='D') then werno:=werno+1
else net:=net+1;
end;
sRichEdit1.Clear;
repeat
s:=sRichEdit2.Lines.Strings[i];
i:=i+1;
if pos('***************',s)<>1 then
sRichEdit1.Lines.Add(s);
until (pos('***************',s)=1)or
(i>sRichEdit2.Lines.Count);
n:=n+1;
if (i>sRichEdit2.Lines.Count)
then begin
kol:= round(25*(werno)/25);
if kol>=23 then oc:=5 else
if kol>=20 then oc:=4 else
if kol>=15 then oc:=3 else
oc:=2;
ShowMessage(Form5.sEdit1.Text+' '+Form5.sEdit2.Text+'. ' + Form5.sComboBox1.Text+'.'+#10#13+'Âû âåðíî îòâåòèëè íà '+ floattostr(kol) +'%'+#10#13+'Âàøà îöåíêà = '+inttostr(oc));
assignfile(v,ExtractFilePath(ParamStr(0))+'res.txt');
append(v);
writeln;
writeln(v,'Äàòà: '+datetostr(DateTimePicker1.Date)+' '+'Âðåìÿ: '+timetostr(DateTimePicker1.Time)+' '+Form5.sEdit1.Text+' '+Form5.sEdit2.Text+'. ' + Form5.sComboBox1.Text+' '+'Îöåíêà - '+inttostr(oc));
closefile(v);
n:=0;
Close;
end;
end;
end;
procedure TForm6.FormClose(Sender: TObject; var Action: TCloseAction);
begin
i:=0; werno:=0; net:=0;
sRadioButton1.Checked:=False;
sRadioButton2.Checked:=False;
sRadioButton3.Checked:=False;
sRadioButton4.Checked:=False;
Form5.Close;
end;
procedure TForm6.sRadioButton1Click(Sender: TObject);
begin
sButton1.Enabled:=True;
end;
procedure TForm6.sRadioButton2Click(Sender: TObject);
begin
sButton1.Enabled:=True;
end;
procedure TForm6.sRadioButton3Click(Sender: TObject);
begin
sButton1.Enabled:=True;
end;
procedure TForm6.sRadioButton4Click(Sender: TObject);
begin
sButton1.Enabled:=True;
end;
procedure TForm6.FormActivate(Sender: TObject);
begin
Form5.Visible:=False;
end;
end. |