p align="left">procedure TElektKursInf.Exit1Click(Sender: TObject); begin ElektKursInf.Hide; zagl.close; end; procedure TElektKursInf.FormClose(Sender: TObject; var Action: TCloseAction); begin ElektKursInf.Hide; zagl.Close; end; procedure TElektKursInf.FormShow(Sender: TObject); var i,j:integer;s0,s,s2,k:string; begin assignfile(fil,'bd\path1.txt'); reset(fil); s:=''; while not eof(fil) do begin readln(fil,s); s0:=s; end; closefile(fil); assignfile(fil,'bd\path.txt'); reset(fil); Listbox1.Clear; s:=''; while not eof(fil) do begin readln(fil,s); Listbox1.Items.Add(s0+s); end; closefile(fil); assignfile(fil,'bd\themes.txt'); reset(fil); Listbox3.Clear; s:=''; while not eof(fil) do begin readln(fil,s); Listbox3.Items.Add(s); end; closefile(fil); Label3.Caption:='Здравствуйте, '+zagl.Edit1.Text+'. Вы работаете с учебным курсом "Компьютерные сети"'; //ComboBox1.ItemIndex := 0; s:=''; assignfile(fil1,'bd\result.txt'); reset(fil1); while not eof(fil1) do begin readln(fil1,s2); for i:=1 to length(s2) do begin if (s2[i] = '*') then begin if s=zagl.Edit1.Text then begin j:=i+1; while s2[j]<>'#' do begin if s2[j]='&' then k:=s2[j+1]; j:=j+1; end; end; end; s:=s+s2[i]; end; s:=''; end; closefile(fil1); {showmessage(k);} if k='1' then begin listbox2.items.Add(listbox3.Items.Strings[1]); end; if k='2' then begin listbox2.items.Add(listbox3.Items.Strings[1]); listbox2.items.Add(listbox3.Items.Strings[2]); end; if k='3' then begin listbox2.items.Add(listbox3.Items.Strings[1]); listbox2.items.Add(listbox3.Items.Strings[2]); listbox2.items.Add(listbox3.Items.Strings[3]); end; if k='4' then begin listbox2.items.Add(listbox3.Items.Strings[1]); listbox2.items.Add(listbox3.Items.Strings[2]); listbox2.items.Add(listbox3.Items.Strings[3]); listbox2.items.Add(listbox3.Items.Strings[4]); end; if k='5' then begin listbox2.items.Add(listbox3.Items.Strings[1]); listbox2.items.Add(listbox3.Items.Strings[2]); listbox2.items.Add(listbox3.Items.Strings[3]); listbox2.items.Add(listbox3.Items.Strings[4]); listbox2.items.Add(listbox3.Items.Strings[5]); end; if k='6' then begin listbox2.items.Add(listbox3.Items.Strings[1]); listbox2.items.Add(listbox3.Items.Strings[2]); listbox2.items.Add(listbox3.Items.Strings[3]); listbox2.items.Add(listbox3.Items.Strings[4]); listbox2.items.Add(listbox3.Items.Strings[5]); listbox2.items.Add(listbox3.Items.Strings[6]); end; if k='7' then begin listbox2.items.Add(listbox3.Items.Strings[1]); listbox2.items.Add(listbox3.Items.Strings[2]); listbox2.items.Add(listbox3.Items.Strings[3]); listbox2.items.Add(listbox3.Items.Strings[4]); listbox2.items.Add(listbox3.Items.Strings[5]); listbox2.items.Add(listbox3.Items.Strings[6]); listbox2.items.Add(listbox3.Items.Strings[7]); end; listbox2.ItemIndex:=0; end; procedure TElektKursInf.ComboBox1Change(Sender: TObject); begin {with ClientElektKurs do begin while not EOF do begin ListBox2.items.add(FieldByName('Kurs').AsString); next; end; end;} end; procedure TElektKursInf.Button1Click(Sender: TObject); begin ListBox1.ItemIndex:=ListBox2.ItemIndex; Form37.WebBrowser1.Navigate(ListBox1.Items.Strings[ListBox1.ItemIndex]); //Form37.ComboBox1.Text:=ListBox1.Items.Strings[ListBox1.ItemIndex]; Form37.ToolButton2.Enabled:=false; Form37.ToolButton3.Enabled:=false; Form37.Show; Button1.Enabled:=false; Label3.Caption:=''; //ElektKursInf.Hide; end; procedure TElektKursInf.Button2Click(Sender: TObject); begin Form3.Show; end; procedure TElektKursInf.Button3Click(Sender: TObject); begin Form5.Show; end; end. 3. Модули статистики по группам и индивидуально unit Unit3; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Grids; type TForm3 = class(TForm) StringGrid1: TStringGrid; procedure FormShow(Sender: TObject); procedure StringGrid1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form3: TForm3; s,s2:string; fil1:textfile; i,j:integer; implementation {$R *.dfm} procedure TForm3.FormShow(Sender: TObject); var s0:double; begin StringGrid1.Cells[0,0]:='Логин'; StringGrid1.Cells[1,0]:='Время обучения(мин.)'; StringGrid1.Cells[2,0]:='Количество пройденных тем'; StringGrid1.Cells[3,0]:='Количество баллов';assignfile(fil1,'bd\result.txt'); reset(fil1); s:=''; i:=1; while not eof(fil1) do begin readln(fil1,s2); for j:=1 to length(s2) do begin if s2[j]='*' then begin StringGrid1.Cells[0,i]:=s; s:=''; continue; end; if s2[j]='&' then begin s0:=strtofloat(s)/60000; StringGrid1.Cells[1,i]:=floattostr(s0); s:=''; continue; end; if s2[j]='$' then begin StringGrid1.Cells[2,i]:=s; s:=''; continue; end; if s2[j]='#' then begin StringGrid1.Cells[3,i]:=s; s:=''; continue; end; s:=s+s2[j]; end; i:=i+1; StringGrid1.RowCount:=i; end; closefile(fil1); end; end. unit Unit5; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Grids; type TForm5 = class(TForm) StringGrid1: TStringGrid; procedure FormShow(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form5: TForm5; s,s1,s2,s3:string; fil1:textfile; i,j:integer; implementation uses Unit1; {$R *.dfm} procedure TForm5.FormShow(Sender: TObject); begin StringGrid1.Cells[0,0]:='1 тема'; StringGrid1.Cells[1,0]:='2 тема'; StringGrid1.Cells[2,0]:='3 тема'; StringGrid1.Cells[3,0]:='4 тема'; StringGrid1.Cells[4,0]:='5 тема'; StringGrid1.Cells[5,0]:='6 тема'; StringGrid1.Cells[6,0]:='7 тема'; assignfile(fil1,'bd\result1.txt'); reset(fil1); s:=''; s3:=''; while not eof(fil1) do begin readln(fil1,s2); s:=s+s2; end; for j:=1 to length(s) do begin if s[j]='*' then begin if s1=zagl.Edit1.Text then begin i:=j+1; while s[i]<>'*' do begin if s[i]='!' then begin StringGrid1.Cells[0,1]:=s3; s3:=''; i:=i+1; continue; end; if s[i]='$' then begin StringGrid1.Cells[1,1]:=s3; s3:=''; i:=i+1; continue; end; if s[i]='#' then begin StringGrid1.Cells[2,1]:=s3; s3:=''; i:=i+1; continue; end; if s[i]='%' then begin StringGrid1.Cells[3,1]:=s3; s3:=''; i:=i+1; continue; end; if s[i]='^' then begin StringGrid1.Cells[4,1]:=s3; s3:=''; i:=i+1; continue; end; if s[i]='@' then begin StringGrid1.Cells[5,1]:=s3; s3:=''; i:=i+1; continue; end; if s[i]='~' then begin StringGrid1.Cells[6,1]:=s3; s3:=''; i:=i+1; continue; end; s3:=s3+s[i]; i:=i+1; end; end; s1:=''; end; s1:=s1+s[j]; if s[j]='~' then s1:=''; end; closefile(fil1); end; end. 4. Модуль обучения по курсу unit Unit44; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, OleCtrls, SHDocVw, ToolWin, ComCtrls, StdCtrls, ExtDlgs, ExtCtrls, Menus; const HTMLID_FIND = 1; HTMLID_VIEWSOURCE = 2; HTMLID_OPTIONS = 3; type TForm37 = class(TForm) WebBrowser1: TWebBrowser; StatusBar1: TStatusBar; ProgressBar1: TProgressBar; OpenDialog1: TOpenDialog; CoolBar1: TCoolBar; ToolBar1: TToolBar; ToolButton2: TToolButton; ToolButton3: TToolButton; ToolButton6: TToolButton; ComboBox1: TComboBox; ToolButton8: TToolButton; ToolButton1: TToolButton; Timer1: TTimer; PopupMenu1: TPopupMenu; N1: TMenuItem; procedure ComboBox1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); procedure ToolButton1Click(Sender: TObject); procedure ToolButton2Click(Sender: TObject); procedure ToolButton3Click(Sender: TObject); procedure ToolButton4Click(Sender: TObject); procedure ToolButton5Click(Sender: TObject); procedure ToolButton6Click(Sender: TObject); procedure WebBrowser1StatusTextChange(Sender: TObject; const Text: WideString); procedure WebBrowser1ProgressChange(Sender: TObject; Progress,
Страницы: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
|