unit Unit6;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Grids, DBGrids, DBCtrls, Menus, ExtCtrls;

type
  Trasp = class(TForm)
    DBMemo1: TDBMemo;
    Label1: TLabel;
    DBGrid1: TDBGrid;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Button1: TButton;
    Panel1: TPanel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    Label10: TLabel;
    Memo1: TMemo;
    Label11: TLabel;
    Button2: TButton;
    Label12: TLabel;
    Label13: TLabel;
    Button3: TButton;
    Memo2: TMemo;
    procedure Button1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  rasp: Trasp;
  punctaj:integer;
implementation

uses Unit3, Unit5,Unit7, Unit10;

{$R *.DFM}

procedure Trasp.Button1Click(Sender: TObject);
var nota:integer;
begin
rasp_inc.Memo1.Clear;

if not dm.itemi.Eof then
begin
if dm.rasp['adevarat']=true then punctaj:=punctaj+1
 else
begin
{ rasp_inc.Memo1.Text:=rasp_inc.Memo1.Text+inttostr(i)+'. '+dm.itemi['intreb'];}
 Memo2.Text:=Memo2.Text+'. '+dm.itemi['intreb'];
end;

dm.itemi.Next;
 if  dm.itemi.Eof then
  begin
if punctaj<=dm.teste['1'] then nota:=1;
if (punctaj>dm.teste['1'])and(punctaj>=dm.teste['2']) then nota:=2;
if (punctaj>dm.teste['2'])and(punctaj>=dm.teste['3']) then nota:=3;
if (punctaj>dm.teste['3'])and(punctaj>=dm.teste['4']) then nota:=4;
if (punctaj>dm.teste['4'])and(punctaj>=dm.teste['5']) then nota:=5;
if (punctaj>dm.teste['5'])and(punctaj>=dm.teste['6']) then nota:=6;
if (punctaj>dm.teste['6'])and(punctaj>=dm.teste['7']) then nota:=7;
if (punctaj>dm.teste['7'])and(punctaj>=dm.teste['8']) then nota:=8;
if (punctaj>dm.teste['8'])and(punctaj>=dm.teste['9']) then nota:=9;
if (punctaj>dm.teste['9'])and(punctaj>=dm.teste['10']) then nota:=10;
label6.Caption:=dm.elevi['elev'];
label8.Caption:=inttostr(punctaj);
label10.Caption:=inttostr(nota);
memo1.Text:=dm.teste['indicatii'];
panel1.Visible:=true;
button1.enabled:=false;
dm.rezult.Append;
dm.rezult['cod_elev']:=cod_elev;
dm.rezult['cod_test']:=dm.teste['cod'];
dm.rezult['puncte']:=punctaj;
dm.rezult['nota']:=nota;
dm.rezult.post;

end;

end;
end;

procedure Trasp.FormShow(Sender: TObject);
begin
punctaj:=0;
end;

procedure Trasp.FormClose(Sender: TObject; var Action: TCloseAction);
begin
testare.enabled:=true;
end;

procedure Trasp.Button2Click(Sender: TObject);
begin
panel1.Visible:=false;
button1.Enabled:=true;
rasp.close;
end;


procedure Trasp.Button3Click(Sender: TObject);
begin
rasp_inc.show;
end;

end.
