Рефераты. Информационная система обучения по курсу "Компьютерные сети"

procedure ComboBox1Change(Sender: TObject);

procedure Button1Click(Sender: TObject);

procedure Button2Click(Sender: TObject);

procedure Button3Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

ElektKursInf: TElektKursInf;

fil1,fil:textfile;

implementation

uses Unit44, Unit1, Unit3, Unit5;

{$R *.DFM}

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

Страницы: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12



2012 © Все права защищены
При использовании материалов активная ссылка на источник обязательна.