8
This commit is contained in:
parent
ae277f202b
commit
096c99cd0b
74
PRAKTIKA.PAS
74
PRAKTIKA.PAS
@ -1,18 +1,21 @@
|
|||||||
program pr;
|
program pr;
|
||||||
uses crt, graph;
|
uses crt, graph, dos;
|
||||||
var tmp_d, tmp_m : integer; {screen variables}
|
var tmp_d, tmp_m : integer; {screen variables}
|
||||||
p,p1 : char; {readkey}
|
p,p1 : char; {readkey}
|
||||||
y_wlcm : integer; {Vsplivayushii text}
|
y_wlcm : integer; {Vsplivayushii text}
|
||||||
i,e : integer; {Vspomogatelnie peremennye}
|
i,e,nlect : integer; {Vspomogatelnie peremennye}
|
||||||
cur : integer; {Posicia kursora v menu}
|
cur : integer; {Posicia kursora v menu}
|
||||||
x,y, th : integer; {Peremennye dlya vyvoda teksta}
|
x,y, hgt : integer; {Peremennye dlya vyvoda teksta}
|
||||||
ch, cf, ct : integer; {Peremennye dlya chtenia teksta}
|
ch, cf, ct : integer; {Peremennye dlya chtenia teksta}
|
||||||
nolect : integer; {Nomer lekcii}
|
nolect : integer; {Nomer lekcii}
|
||||||
numtest, otv : integer; {Test}
|
numtest, otv : integer; {Test}
|
||||||
f : text; {File lekcii}
|
f : text; {File lekcii}
|
||||||
|
th,tm,ts,tms : word; {∴•}
|
||||||
|
t1,t2, tminim : longint; {∴•}
|
||||||
javame, author,
|
javame, author,
|
||||||
welcome, dtpa, s,
|
welcome, dtpa, s,
|
||||||
menustatus, tmp,
|
menustatus, tmp,
|
||||||
|
teststatus,
|
||||||
lectstatus,path,j: string;
|
lectstatus,path,j: string;
|
||||||
mainmenu : array [1..22] of string; {menu}
|
mainmenu : array [1..22] of string; {menu}
|
||||||
lines : array [1..30] of string; {readtext}
|
lines : array [1..30] of string; {readtext}
|
||||||
@ -35,6 +38,7 @@ program pr;
|
|||||||
procedure lections(var lect:integer); forward;
|
procedure lections(var lect:integer); forward;
|
||||||
procedure ui(ttitle, tbar : string; back : integer); forward;
|
procedure ui(ttitle, tbar : string; back : integer); forward;
|
||||||
procedure question(var tst:integer); forward;
|
procedure question(var tst:integer); forward;
|
||||||
|
procedure marks(var pr_otv: integer); forward;
|
||||||
|
|
||||||
{Procedura inicializacii peremennyh}
|
{Procedura inicializacii peremennyh}
|
||||||
procedure init_variables;
|
procedure init_variables;
|
||||||
@ -42,7 +46,7 @@ program pr;
|
|||||||
cf := 9;
|
cf := 9;
|
||||||
ct := 14;
|
ct := 14;
|
||||||
x := 20;
|
x := 20;
|
||||||
th := 400; {Vysota svobodnoy oblasti pri vyvode teksta}
|
hgt := 400; {Vysota svobodnoy oblasti pri vyvode teksta}
|
||||||
y_wlcm := -20;
|
y_wlcm := -20;
|
||||||
cur := 1;
|
cur := 1;
|
||||||
author := '€¢â®à: ‚¨ªâ®à aNNiMON Œ¥«ì¨ª';
|
author := '€¢â®à: ‚¨ªâ®à aNNiMON Œ¥«ì¨ª';
|
||||||
@ -50,6 +54,7 @@ program pr;
|
|||||||
welcome := '<27>ਢ¥âáâ¢ãî';
|
welcome := '<27>ਢ¥âáâ¢ãî';
|
||||||
javame := 'JavaME';
|
javame := 'JavaME';
|
||||||
lectstatus := 'F1 - <20>®¬®éì T - ’¥áâ ESC - Œ¥î';
|
lectstatus := 'F1 - <20>®¬®éì T - ’¥áâ ESC - Œ¥î';
|
||||||
|
teststatus := 'F1 - <20>®¬®éì L - ‹¥ªæ¨¨ ESC - Œ¥î';
|
||||||
menustatus := 'ESC - ‚ë室 UP,DOWN,LEFT,RIGHT - <20>¥à¥¤¢¨¦¥¨¥ ªãàá®à ENTER - <20>¥à¥å®¤';
|
menustatus := 'ESC - ‚ë室 UP,DOWN,LEFT,RIGHT - <20>¥à¥¤¢¨¦¥¨¥ ªãàá®à ENTER - <20>¥à¥å®¤';
|
||||||
path := {'Y:\SCHOOL.PAK\2PO-07\'}'C:\BP\BIN\annimon\' {'D:\TP\BIN\annimon\'};
|
path := {'Y:\SCHOOL.PAK\2PO-07\'}'C:\BP\BIN\annimon\' {'D:\TP\BIN\annimon\'};
|
||||||
{Menu Lekcii}
|
{Menu Lekcii}
|
||||||
@ -139,7 +144,7 @@ program pr;
|
|||||||
bar(0, 0, 640, 18);
|
bar(0, 0, 640, 18);
|
||||||
setcolor(13);
|
setcolor(13);
|
||||||
settextstyle(2,0,6);
|
settextstyle(2,0,6);
|
||||||
outtextxy(300, 0, ttitle);
|
outtextxy(320-TextWidth(title) div 2, 0, ttitle);
|
||||||
{Status}
|
{Status}
|
||||||
setfillstyle(1, 7);
|
setfillstyle(1, 7);
|
||||||
settextstyle(2,0,4);
|
settextstyle(2,0,4);
|
||||||
@ -158,7 +163,7 @@ program pr;
|
|||||||
repeat
|
repeat
|
||||||
readln(f, lines[numl]);
|
readln(f, lines[numl]);
|
||||||
inc(numl);
|
inc(numl);
|
||||||
until eof(f) or (numl>(th div ch)) or (numl>30);
|
until eof(f) or (numl>(hgt div ch)) or (numl>30);
|
||||||
{Ostalnie zapolnyayem probelami}
|
{Ostalnie zapolnyayem probelami}
|
||||||
for i:= numl to 30 do lines[i] := '';
|
for i:= numl to 30 do lines[i] := '';
|
||||||
end;
|
end;
|
||||||
@ -172,7 +177,7 @@ program pr;
|
|||||||
if not eof(f) then
|
if not eof(f) then
|
||||||
begin
|
begin
|
||||||
repeat
|
repeat
|
||||||
readln(f, test[numl]);
|
readln(f, test[numl]);
|
||||||
inc(numl);
|
inc(numl);
|
||||||
until eof(f) or (numl>5);
|
until eof(f) or (numl>5);
|
||||||
end;
|
end;
|
||||||
@ -232,41 +237,70 @@ program pr;
|
|||||||
|
|
||||||
{Procedura testirovania}
|
{Procedura testirovania}
|
||||||
procedure question(var tst:integer);
|
procedure question(var tst:integer);
|
||||||
|
var fff: boolean;
|
||||||
|
nt: integer; {num of questions}
|
||||||
begin
|
begin
|
||||||
init_screen;
|
init_screen;
|
||||||
nolect := tst div 2;
|
nolect := tst div 2;
|
||||||
str(nolect, tmp);
|
str(nolect, tmp);
|
||||||
assign(f, path+'test'+tmp+'.txt');
|
assign(f, path+'test'+tmp+'.txt');
|
||||||
reset(f);
|
reset(f);
|
||||||
|
readln(f, nt);
|
||||||
ch := TextHeight(tmp)+20;
|
ch := TextHeight(tmp)+20;
|
||||||
p1:= '0';
|
p1:= '0';
|
||||||
otv:=0; {Kol-vo pravilnyh otvetov}
|
otv:=0; {Kol-vo pravilnyh otvetov}
|
||||||
for i:=1 to 10 do
|
gettime (th,tm,ts,tms);
|
||||||
|
t1:=tms+ts*60+tm*3600+th*3600*60;
|
||||||
|
for i:=1 to nt do
|
||||||
begin
|
begin
|
||||||
readtlines;
|
readtlines;
|
||||||
repeat
|
repeat
|
||||||
{Obrabotka klavish upravlenia}
|
{Obrabotka klavish upravlenia}
|
||||||
if p1='b' then changebk {color background}
|
ui('’¥áâ #'+tmp+' ‚®¯à®á '+i,teststatus,cf);
|
||||||
else if p1='n' then changetxt {n - text color}
|
|
||||||
else if (p1='1') or (p1='2') or (p1='3') then {1,2,3}
|
|
||||||
begin
|
|
||||||
if(p1=test[5]) then inc(otv);
|
|
||||||
end;
|
|
||||||
ui(tmp,lectstatus,cf);
|
|
||||||
{Otrisovka teksta}
|
{Otrisovka teksta}
|
||||||
setcolor(ct);
|
setcolor(ct);
|
||||||
settextstyle(2,0,5);
|
settextstyle(2,0,5);
|
||||||
for e:=1 to 4 do
|
for e:=1 to 4 do
|
||||||
outtextxy(x,20+e*ch,test[e]);
|
outtextxy(x,20+e*ch,test[e]);
|
||||||
|
fff:=false;
|
||||||
p1:=readkey;
|
p1:=readkey;
|
||||||
until (p1=#27) or (p1='l') or (p1=#59);
|
if p1='b' then changebk {color background}
|
||||||
if(p1='l') then begin break; lections(tst); end; {L - Lecton}
|
else if p1='n' then changetxt {n - text color}
|
||||||
if(p1=#59) then begin break; help_screen; end; {F1 - Help}
|
else if (p1='1') or (p1='2') or (p1='3') then {1,2,3}
|
||||||
end;
|
begin
|
||||||
{End of test}
|
if(p1=test[5]) then inc(otv);
|
||||||
|
fff:=true;
|
||||||
|
end;
|
||||||
|
until fff or (p1=#27) or (p1='l') or (p1=#59);
|
||||||
|
if(p1=#27) then break
|
||||||
|
else if(p1='l') then lections(tst) {L - Lection}
|
||||||
|
else if(p1=#59) then help_screen; {F1 - Help}
|
||||||
|
end;
|
||||||
|
{End of test}
|
||||||
|
gettime (th,tm,ts,tms);
|
||||||
|
t2:=tms+ts*60+tm*3600+th*3600*60;
|
||||||
|
if(i=nt) then marks(otv, nt);
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{Procedura vyvoda ocenok}
|
||||||
|
procedure marks(var pr_otv, num_otv: integer);
|
||||||
|
var out: string;
|
||||||
|
mrk: integer;
|
||||||
|
begin
|
||||||
|
ui('Žæ¥ª ','',cf);
|
||||||
|
settextstyle(3,0,6);
|
||||||
|
setcolor(ct);
|
||||||
|
mrk := pr_otv * 100 div num_otv;
|
||||||
|
if(mrk<25) then out:='<27>¥ã¤®¢«¥â¢®à¨â¥«ì®'
|
||||||
|
else if(mrk<50) then out:='“¤®¢«¥â¢®à¨â¥«ì®'
|
||||||
|
else if(mrk<75) then out:='•®à®ä® =)'
|
||||||
|
else out:='<27>à ¢®. <20>ïïïïª ^_^';
|
||||||
|
outtextxy(67,320-TextWidth(out) div 2,out);
|
||||||
|
repeat p:=readkey
|
||||||
|
until (p=#27);
|
||||||
|
end;
|
||||||
|
|
||||||
{Procedura obrabotki vibrannogo punkta menu}
|
{Procedura obrabotki vibrannogo punkta menu}
|
||||||
procedure choicemenu(var cur:integer);
|
procedure choicemenu(var cur:integer);
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user