Обучающе-контроллирующая система для подготовки студентов

Дипломная работа - Компьютеры, программирование

Другие дипломы по предмету Компьютеры, программирование

 

with DBResult do //--------- Create new local table RESULT.DB ----------

begin

Active:= False;

DatabaseName:= ;

TableName:= Result;

TableType:= ttParadox;

with FieldDefs do

begin

Clear;

Add(Answer_id, ftInteger, 0, False);

Add(Trued, ftBoolean, 0, False);

end;

with IndexDefs do

begin

Clear;

Add(Answer_ind, Answer_id, [ixPrimary, ixUnique]);

end;

CreateTable;

end; //--------- end of create -------------------------

DBAnswer.Active:= True;

DBresult.Active:= True;

i:=0; {заполнение QuestList номерами вопросов}

While not DBTicket.EOF do

begin

inc(i);

QuestList.Items.Add(IntToStr(i));

While not DBAnswer.EOF do {Fill RESULT-table}

begin

DBResult.Append;

DBResult[Answer_id]:= DBAnswer[Otvet_id];

DBResult[Trued]:= False;

DBResult.Post;

DBAnswer.Next;

end;

DBTicket.Next;

end;

RefreshAnswers;

 

WindowState:= wsNormal;

Application.OnHint:= ShowHint;

TestGauge.MaxValue:= TestTime; {Set max value of indicator }

Timer.Enabled:= True; { Activate the timer.}

 

CreateMainForm:= False;

end; { of with ClientForm}

end;

 

procedure TBeginDataDlg.FormClose(Sender: TObject;

var Action: TCloseAction);

begin

mrOkthenClientForm.Close;">If Modalresult <> mrOk then ClientForm.Close;

Action:= caFree;

end;

 

procedure TBeginDataDlg.FormShow(Sender: TObject);

Var

IniFile: TIniFile;

List: TStringList;

AliasPath: string;

begin

Application.OnHint:= ShowHint;

Session.ConfigMode:= cmAll; {Global and local aliases !!!}

try

List:= TStringList.Create;

Session.GetAliasParams(Common_base,List); // may be occurs an error

AliasPath:= List.Values[PATH];

List.Free;

except

Application.CreateForm(TPathDlg, PathDlg);

PathDlg.ShowModal;

If PathDlg.Modalresult = mrOk then

begin

AliasPath:= PathDlg.DirectoryList.Directory;

Session.AddStandardAlias(Common_base,AliasPath,PARADOX); {add NEW alias if none}

Session.SaveConfigFile;

end

else Modalresult:= mrCancel;

end;

 

IniFile:= TIniFile.Create(AliasPath+\Test.INI);

ClientForm.TestTime:= IniFile.ReadInteger(Options, TestTime, 600000{10 min});

TicketEdit.MaxValue:= IniFile.ReadInteger(Options, MaxTicket, 1);

If TicketEdit.MaxValue = 1 then TicketEdit.Increment:= 0;

IniFile.Free;

end;

 

end.

 

Текст модуля PathDialog

 

unit PathDialog;

interface

uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,

Buttons, ExtCtrls, FileCtrl;

 

type

TPathDlg = class(TForm)

OKBtn: TButton;

CancelBtn: TButton;

DirectoryList: TDirectoryListBox;

DriveBox: TDriveComboBox;

PathLabel: TEdit;

Label1: TLabel;

procedure DriveBoxChange(Sender: TObject);

procedure FormClose(Sender: TObject; var Action: TCloseAction);

procedure DirectoryListChange(Sender: TObject);

procedure FormActivate(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

 

var

PathDlg: TPathDlg;

 

implementation

 

{$R *.DFM}

 

procedure TPathDlg.DriveBoxChange(Sender: TObject);

begin

DirectoryList.Drive:= DriveBox.Drive;

end;

 

procedure TPathDlg.FormClose(Sender: TObject; var Action: TCloseAction);

begin

Action:= caFree;

end;

 

procedure TPathDlg.DirectoryListChange(Sender: TObject);

begin

PathLabel.Text:= DirectoryList.Directory;

end;

 

procedure TPathDlg.FormActivate(Sender: TObject);

begin

PathLabel.Text:= DirectoryList.Directory;

end;

 

end.