You are on page 1of 12

unit Unit10;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, ExtCtrls, Gauges, jpeg;

type

TForm10 = class(TForm)
Panel1: TPanel;

Panel2: TPanel;

Panel3: TPanel;

Panel4: TPanel;

Panel5: TPanel;

Button1: TButton;

Button2: TButton;

Button3: TButton;

Button4: TButton;

Button5: TButton;

Button6: TButton;

Button7: TButton;

Button8: TButton;

Button9: TButton;

Button10: TButton;

ComboBox1: TComboBox;

ComboBox2: TComboBox;

ComboBox3: TComboBox;

ComboBox4: TComboBox;

ComboBox5: TComboBox;

ComboBox6: TComboBox;

ComboBox7: TComboBox;

ComboBox8: TComboBox;

ComboBox9: TComboBox;

ComboBox10: TComboBox;

Button11: TButton;

Button12: TButton;
Button13: TButton;

Button14: TButton;

Gauge1: TGauge;

Shape1: TShape;

Button15: TButton;

Label1: TLabel;

Label2: TLabel;

Timer1: TTimer;

Image1: TImage;

Image2: TImage;

procedure Button1Click(Sender: TObject);

procedure Timer1Timer(Sender: TObject);

procedure Button15Click(Sender: TObject);

procedure Button12Click(Sender: TObject);

procedure Button2Click(Sender: TObject);

procedure Button3Click(Sender: TObject);

procedure Button4Click(Sender: TObject);

procedure Button5Click(Sender: TObject);

procedure Button6Click(Sender: TObject);

procedure Button7Click(Sender: TObject);

procedure Button8Click(Sender: TObject);

procedure Button9Click(Sender: TObject);

procedure Button10Click(Sender: TObject);

procedure Button11Click(Sender: TObject);

procedure Button13Click(Sender: TObject);

procedure Button14Click(Sender: TObject);

private
{ Private declarations }

public

{ Public declarations }

end;

var

Form10: TForm10;

tombol:boolean=false ;

tot:integer;

nilai:array[0..9]of integer;

jawab,kunci:array[0..9]of string;

implementation

uses Unit3;

{$R *.dfm}

procedure TForm10.Button1Click(Sender: TObject);

begin

image1.Picture.LoadFromFile('soal1.bmp');

end;

procedure TForm10.Timer1Timer(Sender: TObject);

begin

if Shape1.Brush.Color=claqua then

Shape1.Brush.Color:=clfuchsia
else

Shape1.Brush.Color:=claqua;

end;

procedure TForm10.Button15Click(Sender: TObject);

begin

combobox1.Enabled:=true;

combobox2.Enabled:=true;

combobox3.Enabled:=true;

combobox4.Enabled:=true;

combobox5.Enabled:=true;

combobox6.Enabled:=true;

combobox7.Enabled:=true;

combobox8.Enabled:=true;

combobox9.Enabled:=true;

combobox10.Enabled:=true;

button11.Enabled:=true;

button12.Enabled:=true;

button14.Enabled:=true;

end;

procedure TForm10.Button12Click(Sender: TObject);

begin
combobox1.Text:='Pilih Jawaban';

combobox2.Text:='Pilih Jawaban';

combobox3.Text:='Pilih Jawaban';

combobox4.Text:='Pilih Jawaban';

combobox5.Text:='Pilih Jawaban';

combobox6.Text:='Pilih Jawaban';

combobox7.Text:='pilih jawaban';

combobox8.text:='pilih jawaban';

combobox9.Text:='pilih jawaban';

combobox10.text:='pilih jawan';

panel4.Caption:=' ';

panel5.Caption:=' ';

button7.Enabled:=true;

button9.Enabled:=false;

gauge1.Progress:=0;

end;

procedure TForm10.Button2Click(Sender: TObject);

begin

image1.Picture.LoadFromFile('soal2.bmp');

end;

procedure TForm10.Button3Click(Sender: TObject);

begin

image1.Picture.LoadFromFile('soal3.bmp');

end;
procedure TForm10.Button4Click(Sender: TObject);

begin

image1.Picture.LoadFromFile('soal4.bmp');

end;

procedure TForm10.Button5Click(Sender: TObject);

begin

image1.Picture.LoadFromFile('soal5.bmp');

end;

procedure TForm10.Button6Click(Sender: TObject);

begin

image1.Picture.LoadFromFile('soal6.bmp');

end;

procedure TForm10.Button7Click(Sender: TObject);

begin

image1.Picture.LoadFromFile('soal7.bmp');

end;

procedure TForm10.Button8Click(Sender: TObject);

begin

image1.Picture.LoadFromFile('soal8.bmp');

end;

procedure TForm10.Button9Click(Sender: TObject);


begin

image1.Picture.LoadFromFile('soal9.bmp');

end;

procedure TForm10.Button10Click(Sender: TObject);

begin

image1.Picture.LoadFromFile('soal10.bmp');

end;

procedure TForm10.Button11Click(Sender: TObject);

var

I,J,K,l :INTEGER;

begin

kunci[0]:='A';kunci[1]:='B';kunci[2]:='B';kunci[3]:='D';

kunci[4]:='B';kunci[5]:='A'; kunci[6] :='A'; kunci[7]:='D'; kunci[8]:='E';kunci[9]:='A';

gauge1.Progress:=0;

gauge1.MinValue:=0;

gauge1.MaxValue:=100;

for i:=0 to 9 do

begin

k:=i*1000000;

for j:=k to k+1000000 do gauge1.Progress:=j;

end;
jawab[0]:=trim(combobox1.text); //soal1

if jawab[0]='_' then nilai[0] :=0 else

if jawab[0]<>kunci[0] then nilai[0]:=0 else nilai[0]:=5;

jawab[1]:=trim(combobox2.text); //soal2

if jawab[1]='_' then nilai[1]:=0 else

if jawab[1]<>kunci[1] then nilai[1]:=0 else nilai[1]:=5;

jawab[2]:=trim(combobox3.text); //soal3

if jawab[2]='_' then nilai[2]:=0 else

if jawab[2]<>kunci[2] then nilai[2]:=0 else nilai[2]:=5;

jawab[3]:=trim(combobox4.text); //soal4

if jawab[3]='_' then nilai[3]:=0 else

if jawab[3]<>kunci[3] then nilai[3]:=0 else nilai[3]:=5;

jawab[4]:=trim(combobox5.text); //soal5

if jawab[4]='_' then nilai[4]:=0 else

if jawab[4]<>kunci[4] then nilai[4]:=0 else nilai[4]:=5;

jawab[5]:=trim(combobox6.text); //soal6

if jawab[5]='_' then nilai[5]:=0 else

if jawab[5]<>kunci[5] then nilai[5]:=0 else nilai[5]:=5;

jawab[6]:=trim(combobox7.text); //soal7

if jawab[6]='_' then nilai[6]:=0 else

if jawab[6]<>kunci[6] then nilai[6]:=0 else nilai[6]:=5;

jawab[7]:=trim(combobox8.text); //soal8
if jawab[7]='_' then nilai[7]:=0 else

if jawab[7]<>kunci[7] then nilai[7]:=0 else nilai[7]:=5;

jawab[8]:=trim(combobox9.text); //soal9

if jawab[8]='_' then nilai[8]:=0 else

if jawab[8]<>kunci[8] then nilai[8]:=0 else nilai[8]:=5;

jawab[9]:=trim(combobox10.text); //soal10

if jawab[9]='_' then nilai[9]:=0 else

if jawab[9]<>kunci[9] then nilai[9]:=0 else nilai[9]:=5;

tot :=0;

for l:=0 to 9 do

tot := tot + nilai[l];

button14.Enabled:=true;

end;

procedure TForm10.Button13Click(Sender: TObject);

begin

form3.show;

form10.hide;

end;

procedure TForm10.Button14Click(Sender: TObject);

begin

button11.Enabled:=false;
Panel4.Caption:=floattostr(tot);

If tot>= 28 then

Panel5.Caption:='A'

else if tot>= 26 then

Panel5.Caption:='A-'

else if tot>=24 then

Panel5.Caption:='B+'

else if tot>=22 then

Panel5.Caption:='B'

else if tot>=20 then

Panel5.Caption:='B-'

else if tot>=18 then

Panel5.Caption:='C+'

else if tot>=16 then

Panel5.Caption:='C'

else if tot>=14 then

Panel5.Caption:='D'

else if tot<=12 then


Panel5.Caption:='E'

else

end;

end.

You might also like