procedure TForm1.Button1KeyPress(Sender: TObject; var Key: char);
begin
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
close
end;
procedure TForm1.ListBox1KeyPress(Sender: TObject; var Key: char);
begin
If key=#13 then Num1:=ListBox1.ItemIndex;
ListBox1.ItemIndex:=-1;ActiveControl:=ListBox2;
ListBox2.ItemIndex:=0;
end;
procedure TForm1.ListBox2KeyPress(Sender: TObject; var Key: char);
begin
If key=#13 then begin
case ListBox2.ItemIndex of 0:
Num2:=2;
1:Num2:=1;
2:Num2:=3;
3:Num2:=0;
end;
if Num1=Num2 then begin Label4.Caption:='Верно!';
CountR:=CountR+1 end
else form1.Label4.Caption:='Ошибка';
CountC:=CountC+1;
if CountC=CountN then ShowMessage('Тест окончен Баллы : '
+FloatToStr(CountR/CountN * 5)+
'(правильных ответов:'+IntToStr(CountR)+')');
ListBox2.Itemindex:=-1;ActiveControl:=Listbox1;
end;
end;