Форум по Delphi программированию

Delphi Sources



Вернуться   Форум по Delphi программированию > Все о Delphi > [ "Начинающим" ]
Ник
Пароль
Регистрация <<         Правила форума         >> FAQ Пользователи Календарь Поиск Сообщения за сегодня Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
  #1  
Старый 18.06.2010, 20:20
Аватар для nickname
nickname nickname вне форума
Прохожий
 
Регистрация: 19.05.2010
Сообщения: 30
Репутация: 10
Плохо тестовая программа

помогите пожалуйста доделать код тестовой программы
Код:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ComCtrls;

const
  kol_vop=10;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    GroupBox1: TGroupBox;
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    RadioButton3: TRadioButton;
    RadioButton4: TRadioButton;
    Edit1: TEdit;
    Edit2: TEdit;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  verno:boolean;
  Questions:array [1..kol_vop] of string;
  right,wrong:integer;
  endl:byte;
  i:integer;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
i:=1;
right:=0;
wrong:=0;
//Здесь сам заполняешь вопросы которые тебе нужны и соответственно напиши там варианты ответов А, B, C и D
Questions[1]:='Для чего нужен Делфи?';
Questions[2]:='Структура делфи -';
Questions[3]:='';
Questions[4]:='';
Questions[5]:='';
Questions[6]:='';
Questions[7]:='';
Questions[8]:='';
Questions[9]:='';
Questions[10]:='';
Memo1.Text:=Questions[1];
end;

procedure TForm1.Button1Click(Sender: TObject);
Var j:integer;
begin
If i=kol_vop+1 then
begin
showmessage('Тест окончен');
exit;
end;
//первый вопрос
If i=1 then
//здесь вписывай нужный тебе радиобаттон, который отвечает за правильный вариант вопроса
If RadioButton1.Checked=true then begin // как написать варианты ответов для радиобаттонов
//в этом случае, чтобы обновлялись со следующим вопросом ????? помогите дописать пожалуйста
inc(right);
inc(wrong);
end;
//второй вопрос
If i=2 then
If RadioButton2.Checked=true then begin
inc(right);
inc(wrong);
end;
If i=3 then
If RadioButton2.Checked=true then begin
inc(right);
inc(wrong);
end;
If i=4 then
If RadioButton2.Checked=true then begin
inc(right);
inc(wrong);
end;
If i=5 then
If RadioButton2.Checked=true then begin
inc(right);
inc(wrong);
end;
If i=6 then
If RadioButton2.Checked=true then begin
inc(right);
inc(wrong);
end;
If i=7 then
If RadioButton2.Checked=true then begin
inc(right);
inc(wrong);
end;
If i=8 then
If RadioButton2.Checked=true then begin
inc(right);
inc(wrong);
end;
If i=9 then
If RadioButton2.Checked=true then begin
inc(right);
inc(wrong);
end;
If i=10 then
If RadioButton2.Checked=true then begin
inc(right);
inc(wrong);
end;
Edit1.Text:='Правильных ответов '+inttostr(right);
Edit2.Text:='Не правильных ответов '+inttostr(wrong);
inc(i);
If i=kol_vop+1 then
exit;
Memo1.Text:=Questions[i];

end;
end.
Ответить с цитированием
 


Delphi Sources

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать темы
Вы не можете отвечать на сообщения
Вы не можете прикреплять файлы
Вы не можете редактировать сообщения

BB-коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход


Часовой пояс GMT +3, время: 02:05.


 

Сайт

Форум

FAQ

Соглашения

Прочее

 

Copyright © Форум "Delphi Sources" by BrokenByte Software, 2004-2025