.


:




:

































 

 

 

 





, .

, , , . , , .

:

- ;

 

 

- , ;

- ( );

- ;

- ;

-

. () ( ).

. , . , .

( , ).
, , , .


, - .

, . , , , .

() -, , , , . . .

() - , - ( ). . , . - , , , -.

- - , . , . , .

, . , , , , , .

- - , . , -. ( ), . [1]

, .

, .

:

. dis. txt testname. txt . 1 , .

1

if ((Edit1.Text<>'') And (Edit1.Text<>' ')) then

if Res1='test' then

begin

{$I-}

Form2.ComboBox2.AddItem(Edit1.Text,Form2.ComboBox2);

Form2.ComboBox2.SelText:=Edit1.Text;

AssignFile (FileName,'testname.txt');

Append (FileName);

str:=Form2.combobox1.text;

Writeln(FileName,str);

 

str:=Edit1.Text;

WriteLn(FileName,str);

str:=ID_PREP;

Writeln(FileName,str);

CloseFile(FileName);

{$I+}

end

else

if Res1='dis' then

begin

Form2.ComboBox1.AddItem(Edit1.Text,Form2.ComboBox1);

AssignFile (FileName,'dis.txt');

Form2.combobox1.Text:=Edit1.Text;

Append (FileName);

str:=Edit1.text;

WriteLn(FileName,str);

CloseFile(FileName);

end

:

, 2.

2

type test= Record

prep:String[20]; test:String[20]; pred:String[20]; vop:String[255];

kol_otv:Integer;

otv1:String[80]; otv2:String[80]; otv3:String[80];

otv4:String[80]; otv5:String[80]; otv6:String[80];

nom_pr:Integer;

 

 

isRight1:Boolean; isRight2:Boolean; isRight3:Boolean;

isRight4:Boolean; isRight5:Boolean; isRight6:Boolean;

Set1:Boolean; Set2:Boolean; Set3:Boolean;

Set4:Boolean; Set5:Boolean; Set6:Boolean;

End;

, , , .

. ( ) ( 3).

3

procedure Saver();

with Form3 do

begin

for i:=1 To vop.Lines.Count-1 do

begin

tmp_str:=tmp_str+vop.Lines.Strings[i-1]+' ';

end;

for i:=1 To otv1.Lines.Count-1 do

tmp_str:=tmp_str+otv1.Lines.Strings[i-1]+' ';

tmp_str:=tmp_str+otv1.Lines.Strings[otv1.Lines.Count-1];

loading_test[current_test].otv1:=tmp_str;

for i:=1 To otv5.Lines.Count-1 do

tmp_str:=tmp_str+otv5.Lines.Strings[i-1]+' ';

tmp_str:=tmp_str+otv5.Lines.Strings[otv5.Lines.Count-1];

loading_test[current_test].otv5:=tmp_str;

 

 

loading_test[current_test].isRight1:=CheckBox1.Checked;

loading_test[current_test].isRight2:=CheckBox2.Checked;

loading_test[current_test].isRight3:=CheckBox3.Checked;

End;

 

( 3). , .

3

procedure showtest();

begin

with form3 do

begin

label10.Caption:=' '+IntToStr(current_test)+' '+IntToStr(test_count);

vop.Text:=loading_test[current_test].vop;

otv1.Text:=loading_test[current_test].otv1;

CheckBox1.Checked:= loading_test[current_test].isRight1;

 

: ( ) ( ).

login.txt. ( ) 4 .

4

AssignFile (FileName,'login.txt');

Rewrite (FileName);

 

i:=0;

while (i<UserCount) do

begin

inc(i);

str:=User[i];

str:=ConvertStr(str);

Writeln (FileName,str);

str:=Pass[i];

str:=ConvertStr(str);

Writeln (FileName,str);

end;

CloseFile(FileName);

 

. , . , , . 5.

5

if Res1='test' then

begin

{$I-}

AssignFile (FileName,'testname.txt');

AssignFile (NewFile,'tmp.txt');

Reset(FileName);

Rewrite(NewFile);

while (not (eof(FileName))) do

begin

ReadLn(FileName,Dis);

 

ReadLn(FileName,Test);

ReadLn(FileName,Users);

WriteLn(NewFile,Test);

WriteLn(NewFile,Users);

end;

 

end;

DeleteFile('testname.txt');

RenameFile('tmp.txt','testname.txt');

str:=ID_PREP+Form2.ComboBox1.Text+Form2.ComboBox2.Text;

DeleteFile(CURDIR+'\tests\'+str);

Form2.ComboBox2.DeleteSelected;

{$I+}

Form2.ComboBox2.Text:='';

end

else

begin

For i:=Form1.ListBox1.ItemIndex+1 to UserCount-1 do

begin

User[i]:=User[i+1];

Pass[i]:=Pass[i+1];

end;

Form1.ListBox1.DeleteSelected;

dec(UserCount);

Saver();

Form1.BitBtn3.Enabled:=False;

Form1.BitBtn4.Enabled:=False;

end;

Res1:='';

DelForm.Close;

end;

 

:

. :

1) ;

2) ;

3) ;

4) ;

5) .

:

(, , ), . . ( 6).

6

current_test:=1;

test_count:=0;

i:=1;

while ID_TEST[i]<>ComboBox2.Text do inc(i);

{$I-}

str:='tests\'+ID_PREP[i]+ComboBox1.Text+ComboBox2.Text;

AssignFile (file_name,str);

Reset(file_name);

while not(Eof(file_name)) do

begin

inc(test_count);

read(file_name,loading_test[test_count]);

AllTime:=strtoint(loading_test[test_count].time);

btn[test_count]:=TPanel.Create(form3);

btn[test_count].Parent:=Form1.Panel8;

 

 

btn[test_count].Name:='b' + inttostr(test_count);

btn[test_count].Caption:=inttostr(test_count);

btn[test_count].Visible:=true;

btn[test_count].Width:=25;

btn[test_count].Top:=0;

btn[test_count].Left:=26*(test_count-1);

btn[test_count].Height:=Form1.Panel8.Height;

btn[test_count].OnClick:= Form1.Panel8Click;

btn[test_count].Color:= clSilver;

btn[test_count].Font.Size:=10;

btn[test_count].Font.Style:=[fsBold];

 

end;

showtest;

CloseFile (file_name);

CURDIR:=GetCurrentDir;

{$I+}

AllTime:=AllTime*60;

Form1.Show;

Form5.Hide;

Form1.Timer1.Enabled:=True;

Form1.Label1.Caption:=' "'+ComboBox1.Text+'" "' +ComboBox2.Text+'"';

end;

:

:

1) ( , , , );

2) .

, ( 7).

 

 

7

with form1 do

begin

label2.Caption:=' '+IntToStr(current_test)+' '+IntToStr(test_count);

vop.Caption:=loading_test[current_test].vop;

otv1.Caption:=loading_test[current_test].otv1;

otv2.Caption:=loading_test[current_test].otv2;

otv1.OnClick(otv1);

otv2.OnClick(otv1);

otv3.OnClick(otv1);

end;

 

:

. ( 8) , .

8

var M,S:Integer;

per:Real;

str:String;

begin

Dec(AllTime);

M:= AllTime div 60;

S:= AllTime mod 60;

BitBtn1.Caption:=' ( '+IntToStr(M)+' . '

+IntToStr(S)+' .)';

 

if(AllTime=0)then

begin

Timer1.Enabled:=False;

if test_count<>0 then per:=right_count/test_count;

if per>0.85 then str:='!'

else if per>0.6 then str:='!'

else if per>0.45 then str:='!'

else str:='!';

Form4.Memo1.Lines.Clear;

Form4.Memo1.Lines.Add(' .');

Form4.Memo1.Lines.Add('');

Form4.Memo1.Lines.Add(': '+Form3.Edit1.Text+' '+Form3.Edit2.Text);

Form4.Memo1.Lines.Add(': '+Form3.Edit3.Text);

Form4.Memo1.Lines.Add(': '+Form5.ComboBox1.Text);

Form4.Memo1.Lines.Add(' : '+Form5.ComboBox2.Text);

Form4.Memo1.Lines.Add(' : '+DateToStr(SysUtils.Date));

Form4.Memo1.Lines.Add('');

Form4.Memo1.Lines.Add(' : '+inttostr(test_count));

Form4.Memo1.Lines.Add(' : '+inttostr(right_count));

Form4.Memo1.Lines.Add(' : '+str);

 

Form6.Memo1.Lines.Clear;

Form6.Memo1.Lines.Add(' .');

Form6.Memo1.Lines.Add('');

Form6.Memo1.Lines.Add(': '+Form3.Edit1.Text+' '+Form3.Edit2.Text);

Form6.Memo1.Lines.Add(': '+Form3.Edit3.Text);

Form6.Memo1.Lines.Add(': '+Form5.ComboBox1.Text);

Form6.Memo1.Lines.Add(' : '+Form5.ComboBox2.Text);

Form6.Memo1.Lines.Add(' : '+DateToStr(SysUtils.Date));

Form6.Memo1.Lines.Add('');

Form6.Memo1.Lines.Add(' : '+inttostr(test_count));

Form6.Memo1.Lines.Add(' : '+inttostr(right_count));

Form6.Memo1.Lines.Add(' : '+str);

form1.Hide;

Form2.Close;

Form4.Show;

:

Delphi SaveToFile lines Memo Print Form ( 9).

9

if SaveDialog1.Execute then

begin

Memo1.Lines.SaveToFile(SaveDialog1.FileName);

ShowMessage(' !');

end;

Form6.Print;

, () . [10]

 

12207-99 , , . , , .

, (). , . , , () . , . , .

, , , , . -.

, .

( ) . , .

, , . [11]

 

, . Borland Delphi 7. , .

 

 





:


: 2016-12-28; !; : 1127 |


:

:

- , 20 40 . - .
==> ...

1440 - | 1411 -


© 2015-2024 lektsii.org - -

: 0.099 .