unit Quizprojekt;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 =
class(TForm)
Label1: TLabel;
Button1: TButton;
Button3: TButton;
Edit1: TEdit;
Label2: TLabel;
Button2: TButton;
Button4: TButton;
procedure Button3Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
type Fragentype=record
Frage:
string[200];
Antwort1:
string[50];
Antwort2:
string[50];
Antwort3:
string[50];
Antwort4:
string[50];
richtig: byte;
Nummer: byte;
end;
var
Form1: TForm1;
Frage: Fragentype;
SummeFragen:
File of Fragentype;
WissenFragen:
File of Fragentype;
implementation
uses Quizprojekt2, Quizprojekt3, Quizprojekt4, Quizprojekt5, Quizprojekt6;
{$R *.dfm}
procedure TForm1.Button3Click(Sender: TObject);
begin
close
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Form1.Visible:=false;
Form2.Visible:=true;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Form1.Visible:=false;
Form4.Visible:=true;
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
Form1.Visible:=false;
Form5.Visible:=true;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
AssignFile(SummeFragen,'
Inhalt.txt');
Rewrite(SummeFragen);
Frage.Frage:='
Welche von diesen Personen ist kein Info*lehrER*?';
Frage.Antwort1:= '
bestimmt Herr Habenicht';
Frage.Antwort2:= '
bestimmt Herr Kühn';
Frage.Antwort3:= '
bestimmt Herr Krüger';
Frage.Antwort4:= '
bestimmt Frau Mantwill';
Frage.richtig:=4;
Frage.Nummer:=1;
Reset(SummeFragen);
Write(Summefragen, Frage);
Frage.Frage:='
Wie geht Case of?';
Frage.Antwort1:= '
Gar nicht.';
Frage.Antwort2:= '
keine Ahnung';
Frage.Antwort3:= '
Drück mich';
Frage.Antwort4:= '
...?*System ERROR*';
Frage.richtig:=3;
Frage.Nummer:=2;
CloseFile (Summefragen);
AssignFile(Wissenfragen,'
WissenFragen');
Rewrite(WissenFragen);
Frage.Frage:='
Was hat der schlaue Manuel in der Chemie Klausur 13/1 bekommen?';
Frage.Antwort1:= '
1 mit 14 Punkten';
Frage.Antwort2:= '
2 mit 12 Punkten';
Frage.Antwort3:= '
3 mit 7 Punkten';
Frage.Antwort4:= '
2 mit 10 Punkten';
Frage.richtig:=1;
Frage.Nummer:=1;
Write(Wissenfragen, Frage);
end;
end.
unit Quizprojekt2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm2 =
class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Button1: TButton;
Button2: TButton;
Label7: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form2: TForm2;
implementation
uses Quizprojekt3, Quizprojekt6, Quizprojekt;
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
begin
Form2.Visible:=false;
Form3.Visible:=true;
end;
procedure TForm2.Button2Click(Sender: TObject);
begin
Form2.Visible:=false;
Form6.Visible:=true;
end;
end.
unit Quizprojekt3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm3 =
class(TForm)
Label1: TLabel;
Label2: TLabel;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
Button7: TButton;
Button8: TButton;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
procedure Button8Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form3: TForm3;
Zahl: integer;
implementation
uses Quizprojekt4, Quizprojekt;
{$R *.dfm}
procedure TForm3.Button8Click(Sender: TObject);
begin
Form3.Visible:=false;
Form4.Visible:=true;
end;
procedure TForm3.FormCreate(Sender: TObject);
begin
with Form1
Do
begin
Reset (SummeFragen);
Read(SummeFragen,Frage);
end;
Edit1.text:=Frage.Frage;
Edit2.text:=Frage.Antwort1;
Edit3.text:=Frage.Antwort2;
Edit4.text:=Frage.Antwort3;
Edit5.text:=Frage.Antwort4;
end;
procedure TForm3.Button1Click(Sender: TObject);
begin
Button4.Visible:= false;
Button6.Visible:= false;
end;
procedure TForm3.Button4Click(Sender: TObject);
begin
Zahl:=1;
if
Zahl=frage.richtig
then Edit1.text:='
Richtig'
else Edit1.text:='
Falsch';
end;
procedure TForm3.Button5Click(Sender: TObject);
begin
Zahl:=2;
if
Zahl=frage.richtig
then Edit1.text:='
Richtig'
else Edit1.text:='
Falsch';
end;
procedure TForm3.Button6Click(Sender: TObject);
begin
Zahl:=3;
if
Zahl=frage.richtig
then Edit1.text:='
Richtig'
else Edit1.text:='
Falsch';
end;
procedure TForm3.Button7Click(Sender: TObject);
begin
Zahl:=4;
if
Zahl=frage.richtig
then Edit1.text:='
Richtig'
else Edit1.text:='
Falsch';
end;
end.
unit Quizprojekt4;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids;
type
TForm4 =
class(TForm)
Label1: TLabel;
Button1: TButton;
Button2: TButton;
StringGrid1: TStringGrid;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form4: TForm4;
implementation
uses Quizprojekt5, Quizprojekt;
{$R *.dfm}
procedure TForm4.Button1Click(Sender: TObject);
begin
Form4.Visible:=false;
Form5.Visible:=true;
end;
procedure TForm4.Button2Click(Sender: TObject);
begin
Form4.Visible:=false;
Form1.Visible:=true;
end;
procedure TForm4.FormCreate(Sender: TObject);
begin
with StringGrid1
do
begin
StringGrid1.Cells[0,0]:= '
Platzierung';
StringGrid1.Cells[1,0]:= '
Spielername';
StringGrid1.Cells[2,0]:= '
Punktezahl';
StringGrid1.Cells[0,1]:= '
1.Platz';
StringGrid1.Cells[0,2]:= '
2.Platz';
StringGrid1.Cells[0,3]:= '
3.Platz';
StringGrid1.Cells[0,4]:= '
4.Platz';
StringGrid1.Cells[0,5]:= '
5.Platz';
StringGrid1.Cells[0,6]:= '
6.Platz';
StringGrid1.Cells[0,7]:= '
7.Platz';
StringGrid1.Cells[0,8]:= '
8.Platz';
StringGrid1.Cells[0,9]:= '
9.Platz';
StringGrid1.Cells[0,10]:= '
10.Platz';
end;
end;
end.
unit Quizprojekt5;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids;
type
TForm5 =
class(TForm)
Label1: TLabel;
Button1: TButton;
Button2: TButton;
StringGrid1: TStringGrid;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form5: TForm5;
implementation
uses Quizprojekt4, Quizprojekt;
{$R *.dfm}
procedure TForm5.Button1Click(Sender: TObject);
begin
Form5.Visible:=false;
Form4.Visible:=true;
end;
procedure TForm5.Button2Click(Sender: TObject);
begin
Form5.Visible:=false;
Form1.Visible:=true;
end;
procedure TForm5.FormCreate(Sender: TObject);
begin
with StringGrid1
do
begin
StringGrid1.Cells[0,0]:= '
Platzierung';
StringGrid1.Cells[1,0]:= '
Spielername';
StringGrid1.Cells[2,0]:= '
Punktezahl';
StringGrid1.Cells[0,1]:= '
1.Platz';
StringGrid1.Cells[0,2]:= '
2.Platz';
StringGrid1.Cells[0,3]:= '
3.Platz';
StringGrid1.Cells[0,4]:= '
4.Platz';
StringGrid1.Cells[0,5]:= '
5.Platz';
StringGrid1.Cells[0,6]:= '
6.Platz';
StringGrid1.Cells[0,7]:= '
7.Platz';
StringGrid1.Cells[0,8]:= '
8.Platz';
StringGrid1.Cells[0,9]:= '
9.Platz';
StringGrid1.Cells[0,10]:= '
10.Platz';
end;
end;
end.
unit Quizprojekt6;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm6 =
class(TForm)
Label1: TLabel;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Label2: TLabel;
Button4: TButton;
Button5: TButton;
Button6: TButton;
Button7: TButton;
Button8: TButton;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
procedure Button8Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button4Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form6: TForm6;
implementation
uses Quizprojekt5, Quizprojekt;
{$R *.dfm}
procedure TForm6.Button8Click(Sender: TObject);
begin
Form6.Visible:=false;
Form5.Visible:=true;
end;
procedure TForm6.FormCreate(Sender: TObject);
begin
with Form1
Do
begin
Reset (Wissenfragen);
Read(Wissenfragen,Frage);
end;
Edit1.text:=Frage.Frage;
Edit2.text:=Frage.Antwort1;
Edit3.text:=Frage.Antwort2;
Edit4.text:=Frage.Antwort3;
Edit5.text:=Frage.Antwort4;
CloseFile(WissenFragen);
end;
procedure TForm6.Button4Click(Sender: TObject);
begin
Button4.Visible := True;
Button5.Visible := False;
Button6.Visible := False;
Button7.Visible := False;
Edit2.Font.Style := [fsBold];
Edit2.Text:='
Richtig!!'
end;
end.