readln(fil1,s2);
s:=s+s2;
end;
closefile(fil1);
s1:='';
for i:=1 to length(s) do begin
if (s[i] = '*') then begin
//showmessage(s1);
if s1=zagl.Edit1.Text then begin
j:=i+1;
s3:='';
while s[j]<>'~' do begin
if (s[j]='!')and(l=1)and(summa>StrToInt(s[j–1])) then begin
delete(s,j–1,1);
s6:=IntToStr(summa);
insert(s6,s,j–1);
end;
if (s[j]='$')and(l=2)and(summa>StrToInt(s[j–1])) then begin
delete(s,j–1,1);
s6:=IntToStr(summa);
insert(s6,s,j–1);
end;
if (s[j]='#')and(l=3)and(summa>StrToInt(s[j–1])) then begin
delete(s,j–1,1);
s6:=IntToStr(summa);
insert(s6,s,j–1);
end;
if (s[j]='%')and(l=4)and(summa>StrToInt(s[j–1])) then begin
delete(s,j–1,1);
s6:=IntToStr(summa);
insert(s6,s,j–1);
end;
if (s[j]='^')and(l=5)and(summa>StrToInt(s[j–1])) then begin
delete(s,j–1,1);
s6:=IntToStr(summa);
insert(s6,s,j–1);
end;
if (s[j]='@')and(l=6)and(summa>StrToInt(s[j–1])) then begin
delete(s,j–1,1);
s6:=IntToStr(summa);
insert(s6,s,j–1);
end;
if (s[j]='~')and(l=7)and(summa>StrToInt(s[j–1])) then begin
delete(s,j–1,1);
s6:=IntToStr(summa);
insert(s6,s,j–1);
end;
s3:=s3+s[j];
j:=j+1;
end;
end;
end;
s1:=s1+s[i];
if (s[i]='~') then s1:='';
end;
rewrite(fil1);
s4:='';
for i:=1 to length(s) do
begin
s4:=s4+s[i];
if s[i]='~' then begin
writeln(fil1,s4);
s4:='';
end;
end;
closefile(fil1);
Form1.Close;
ElektKursInf.Button1.Enabled:=true;
end;
end;
end;
// Процедура обработки события OnClick
// длякомпонентов RadioButton1–RadioButton4
procedure TForm1.RadioButtonClick(Sender: TObject);
begin
if sender = RadioButton1
then otv:=1
else if sender = RadioButton1
then otv:=2
else if sender = RadioButton3
then otv:=3
else otv:=4;
Button1.enabled:=TRUE;
end;
// обеспечиваетнастройкукомпонентов
procedure TForm1.FormCreate(Sender: TObject);
begin
Image1.AutoSize := False;
Image1.Proportional := True;
RadioButton1.Visible := False;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Gauge1.Progress:=Gauge1.Progress+1;
if Gauge1.Progress=100 then begin
ResetForm;
summa:=summa+score[otv];
Button1.caption:='Ok';
Form1.caption:='Результат';
Button1.tag:=2;
Button1.Enabled:=TRUE;
Itog; // вывестирезультат
Timer1.Enabled:=false;
end;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
ElektKursInf.Button1.Enabled:=true;
end;
procedure TForm1.FormShow(Sender: TObject);
var z:integer;s0:string;
begin
assignfile(fil,'bd\path1.txt');
reset(fil);
s0:='';
while not eof(fil) do
begin
readln(fil,s0);
break;
end;
closefile(fil);
randomize;
ResetForm;
z:=random(4)+1;
fn:=copy(s0,9,length(s0))+IntToStr(ElektKursInf.ListBox1.ItemIndex+1)+IntToStr(z)+'.txt';
assignfile(f,fn);
try
reset(f);
except
on EFOpenError do
begin
ShowMessage('Файлтеста '+fn+' ненайден.');
Button1.caption:='Ok';
Button1.tag:=2;
Button1.Enabled:=TRUE;
exit;
end;
end;
Info; // прочитать и вывести информацию о тесте
GetLevel; // прочитать информацию об уровнях оценок
end;
end.