Автоматизированная система распределения мест и оценок качества олимпиадных заданий
begin
for j:=1 to Query1.RecordCount do
begin
parm[j]:=Query1.FieldValues['SUMMARK'];
Query1.Next;
end;
ind:=0;
for i:=1 to 6*NumI+1 do
begin
for j:=1 to Query1.RecordCount do
begin
if ind=parm[j] then per:=per+1;
end;
GrPar[i]:=ind;
GrPercent[i]:=per/Query1.RecordCount;
per:=0;
ind:=ind+1;
end;
Series1.Clear;
Chart1.BottomAxis.Title.Caption:='Суммарный балл';
Chart1.BottomAxis.Minimum:=0*NumMarks;
Chart1.BottomAxis.Maximum:=ind-1;
For i:=0 to 6*NumI+1 do
begin
Series1.AddXY(GrPar[i],GrPercent[i]);
end;
end;
Query1.First;
end;
procedure TForm5.N3Click(Sender: TObject);
begin
if ColorDialog1.Execute then
begin
Series1.SeriesColor:=ColorDialog1.Color;
end;
end;
procedure TForm5.N4Click(Sender: TObject);
begin
if ColorDialog1.Execute then
begin
Chart1.Gradient.EndColor:=ColorDialog1.Color;
Chart1.Gradient.StartColor:=clWhite;
end;
end;
end.
Модуль 6.
Код этого модуля отвечает за окно и сам процесс создания локальной базы
данных.
unit Unit6;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Forms,
Dialogs, ExtCtrls, StdCtrls, Buttons, DB, DBTables;
type
TForm6 = class(TForm)
Panel1: TPanel;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
Label1: TLabel;
Edit1: TEdit;
Label2: TLabel;
Edit2: TEdit;
Label3: TLabel;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form6: TForm6;
implementation
uses Unit1;
{$R *.dfm}
procedure TForm6.BitBtn1Click(Sender: TObject);
begin
ModalResult:=mrNo;
end;
procedure TForm6.BitBtn2Click(Sender: TObject);
var
Comm:TStringList;
begin
try
with Form1.Table1 do begin
Active := False;
DatabaseName := 'Olymp';
TableType := ttParadox;
TableName := Edit1.Text;
if not Form1.Table1.Exists then begin
with FieldDefs do begin
Clear;
with AddFieldDef do begin
Name := 'Counter';
DataType := ftInteger;
Required := True;
end;
with AddFieldDef do begin
Name := 'FIO';
DataType := ftString;
Size := 25;
end;
with AddFieldDef do begin
Name := 'MARK1';
DataType := ftFloat;
Required := True;
end;
with AddFieldDef do begin
Name := 'MARK2';
DataType := ftFloat;
Required := True;
end;
with AddFieldDef do begin
Name := 'MARK3';
DataType := ftFloat;
Required := True;
end;
with AddFieldDef do begin
Name := 'MARK4';
DataType := ftFloat;
Required := True;
end;
with AddFieldDef do begin
Name := 'MARK5';
DataType := ftFloat;
Required := True;
end;
with AddFieldDef do begin
Name := 'MARK6';
DataType := ftFloat;
Required := True;
end;
with AddFieldDef do begin
Name := 'SUMMARK';
DataType := ftFloat;
Required := True;
end;
with AddFieldDef do begin
Name := 'SCHOOL';
DataType := ftString;
Size := 35;
end;
with AddFieldDef do begin
Name := 'PARAM1';
DataType := ftFloat;
Required:=False;
end;
with AddFieldDef do begin
Name := 'PARAM2';
DataType := ftFloat;
Required:=False;
end;
with AddFieldDef do begin
Name := 'PARAM3';
DataType := ftFloat;
Required:=False;
end;
with AddFieldDef do begin
Name := 'PLACE';
DataType := ftInteger;
Required:=False;
end;
end;
with IndexDefs do begin
Clear;
with AddIndexDef do begin
Name := '';
Fields := 'COUNTER';
Options := [ixPrimary];
end;
with AddIndexDef do begin
Name := 'VAL1';
Fields := 'PARAM1';
Options := [ixDescending];
end;
with AddIndexDef do begin
Name := 'VAL2';
Fields := 'PARAM2';
Options := [ixDescending];
end;
with AddIndexDef do begin
Name := 'VAL3';
Fields := 'PARAM3';
Options := [ixDescending];
end;
end;
CreateTable;
Application.MessageBox('Локальная база данных успешно
создана!','Сообщение',mb_OK+mb_IconAsterisk);
end
else Application.MessageBox('Локальная база данных уже
существует и открыта!','Сообщение',mb_OK+mb_IconAsterisk);
end;
except
Application.MessageBox('Ошибка создания базы
данных!','Внимание',mb_OK+mb_IconHand);
Exit;
end;
Form1.Table1.Active:=True;
Form1.dsOlymp.DataSet:=Form1.Table1;
Form1.DBGrid1.DataSource:=Form1.dsOlymp;
Comm:=TStringList.Create;
Comm.Clear;
Comm.Add(Edit2.Text);
Comm.SaveToFile('Bases'+Edit1.Text+'.olp');
Comm.Free;
Form1.Label1.Caption:='Описание БД: '+Edit2.Text;
ModalResult:=mrNo;
end;
end.
Модуль 6.
Этот модуль отвечает за весь процесс оценки качества заданий. В нем
рассчитываются все параметры, и строятся необходимые диаграммы.
unit Unit7;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Forms,
Dialogs, ExtCtrls, StdCtrls, Buttons, Grids, DBGrids, TeEngine, Series,
TeeProcs, Chart, DB, DBTables, INIFiles;
type
TForm7 = class(TForm)
Panel1: TPanel;
BitBtn1: TBitBtn;
Chart1: TChart;
Series1: TBarSeries;
DataSource1: TDataSource;
Query1: TQuery;
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label4: TLabel;
Label5: TLabel;
Chart2: TChart;
Series2: TBarSeries;
Chart3: TChart;
Series3: TLineSeries;
Series4: TBarSeries;
Series5: TBarSeries;
Label3: TLabel;
Series6: TLineSeries;
procedure BitBtn1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form7: TForm7;
Cf1:TIniFile;
implementation
uses Unit1, Unit5, foxsoft;
{$R *.dfm}
procedure TForm7.BitBtn1Click(Sender: TObject);
begin
ModalResult:=mrOk;
end;
procedure TForm7.FormShow(Sender: TObject);
var
i,j,NumI,kl,kz,nz,gr:integer
| | скачать работу |
Автоматизированная система распределения мест и оценок качества олимпиадных заданий |