Автоматизация проверки знаний и навыков студентов в области прикладной математики и информатики
Дипломная работа - Компьютеры, программирование
Другие дипломы по предмету Компьютеры, программирование
r(255)
/* ERwin Builtin 2 февраля 2009 г. 2:18:54 */
/* Users R/14 User_results on parent delete no action */
/* ERWIN_RELATION:CHECKSUM="00023254", PARENT_OWNER="", PARENT_TABLE="Users"_OWNER="", CHILD_TABLE="User_results"C_VERB_PHRASE="R/14", C2P_VERB_PHRASE="R/14", _CONSTRAINT="R_14", FK_COLUMNS="User_result_User_id" */EXISTS (* FROM deleted,User_results
/* %JoinFKPK(User_results,deleted," = "," AND") */_results.User_result_User_id = deleted.User_id
)@errno = 30001,
@errmsg = Cannot delete Users because User_results exists.ERROR
/* ERwin Builtin 2 февраля 2009 г. 2:18:54 */
/* Groups R/7 Users on child delete no action */
/* ERWIN_RELATION:CHECKSUM="00000000", PARENT_OWNER="", PARENT_TABLE="Groups"_OWNER="", CHILD_TABLE="Users"C_VERB_PHRASE="R/7", C2P_VERB_PHRASE="R/7", _CONSTRAINT="R_7", FK_COLUMNS="User_group_id" */EXISTS (SELECT * FROM deleted,Groups
/* %JoinFKPK(deleted,Groups," = "," AND") */.User_group_id = Groups.Groupe_id ANDEXISTS (* FROM Users
/* %JoinFKPK(Users,Groups," = "," AND") */.User_group_id = Groups.Groupe_id
)
)@errno = 30010,
@errmsg = Cannot delete last Users because Groups exists.ERROR
/* ERwin Builtin 2 февраля 2009 г. 2:18:54 */:@errno @errmsgtransactionTRIGGER tU_Users ON Users FOR UPDATE AS
/* ERwin Builtin 2 февраля 2009 г. 2:18:54 */
/* UPDATE trigger on Users */@NUMROWS int,
@nullcnt int,
@validcnt int,
@insUser_id int,
@errno int,
@errmsg varchar(255)@NUMROWS = @@rowcount
/* ERwin Builtin 2 февраля 2009 г. 2:18:54 */
/* Users R/14 User_results on parent update no action */
/* ERWIN_RELATION:CHECKSUM="00026ae8", PARENT_OWNER="", PARENT_TABLE="Users"_OWNER="", CHILD_TABLE="User_results"C_VERB_PHRASE="R/14", C2P_VERB_PHRASE="R/14", _CONSTRAINT="R_14", FK_COLUMNS="User_result_User_id" */
/* %ParentPK(" OR",UPDATE) */(User_id)EXISTS (* FROM deleted,User_results
/* %JoinFKPK(User_results,deleted," = "," AND") */_results.User_result_User_id = deleted.User_id
)@errno = 30005,
@errmsg = Cannot update Users because User_results exists.ERROR
/* ERwin Builtin 2 февраля 2009 г. 2:18:54 */
/* Groups R/7 Users on child update no action */
/* ERWIN_RELATION:CHECKSUM="00000000", PARENT_OWNER="", PARENT_TABLE="Groups"_OWNER="", CHILD_TABLE="Users"C_VERB_PHRASE="R/7", C2P_VERB_PHRASE="R/7", _CONSTRAINT="R_7", FK_COLUMNS="User_group_id" */
/* %ChildFK(" OR",UPDATE) */(User_group_id)@nullcnt = 0@validcnt = count(*)inserted,Groups
/* %JoinFKPK(inserted,Groups) */.User_group_id = Groups.Groupe_id
/* %NotnullFK(inserted," IS NULL","select @nullcnt = count(*) from inserted where"," AND") */
@validcnt + @nullcnt != @NUMROWS@errno = 30007,
@errmsg = Cannot update Users because Groups does not exist.ERROR
/* ERwin Builtin 2 февраля 2009 г. 2:18:54 */:@errno @errmsgtransaction
go
ПРИЛОЖЕНИЕ Б
Образцы экранных форм
Рисунок Б.1 - Главная форма редактора тестов
Рисунок Б.2 - Реакция системы на потенциальную логическую ошибку
Рисунок Б.3 - Главная форма модуля администрирования пользователей
Рисунок Б.4 - Окно аутентификации пользователя модуля тестирования
Рисунок Б.5 - Окно выбора теста модуля тестирования
Приложение В
Текст программных модулей
Модуль редактора тестов
unit uEditorDataModule;
, Windows, Dialogs, Messages, Classes, DB, ADODB;= class(TDataModule): TADOConnection;: TADOTable;: TADOTable;: TADOTable;: TADOTable;: TDataSource;: TDataSource;: TDataSource;: TDataSource;_ID: TAutoIncField;_section_ID: TIntegerField;_name: TStringField;_description: TStringField;_author: TStringField;_type: TIntegerField;_question_count: TIntegerField;_question_limit: TIntegerField;_is_random_answers: TBooleanField;_is_time_limit: TBooleanField;_time_limit: TStringField;_is_back: TBooleanField;: TADOQuery;: TADOQuery;: TDataSource;: TADOQuery;: TDataSource;dsSectionsDataChange(Sender: TObject; Field: TField);dsTestsDataChange(Sender: TObject; Field: TField);dsQuestionsDataChange(Sender: TObject; Field: TField);dsQuestionsStateChange(Sender: TObject);
{ Private declarations }
{ Public declarations };
: TDataModule1;
uEditorMain, StdCtrls, Controls;
{$R *.dfm}
TDataModule1.dsSectionsDataChange(Sender: TObject;: TField);(@currentSection, sizeof(TSection));.ID := tabelSections.FieldByName(Section_ID).AsInteger;.Name := tabelSections.FieldByName(Section_name).AsString;;
TDataModule1.dsTestsDataChange(Sender: TObject; Field: TField);tabelTests.State = dsBrowse then.testTypeCB.ItemIndex := tabelTests.FieldByName(Test_type).AsInteger;.timeLimitEdit.Text := tabelTests.FieldByName(Test_Time_limit).AsString;;;
TDataModule1.dsQuestionsDataChange(Sender: TObject;: TField);tabelQuestions.State = dsBrowse then.questionTypeCB.ItemIndex := tabelQuestions.FieldByName(Question_type).AsInteger;.questionTimLimitEdit.Text := tabelQuestions.FieldByName(Question_time).AsString;;teacherForm doquestionTypeCB.ItemIndex in [0, 1, 4] then.Visible := false;.Visible := false;.Visible := false;.Visible := false;.Visible := false;.Visible := false;
//--------------------------------.Visible := true;.Left := answerPanel.Left + 5;.Left :=answerDBCtrlGrid.Left + 5;.Width := answerDBCtrlGrid.Width - 80;.Refresh;if questionTypeCB.ItemIndex = 2 then.Visible := false;.Visible := false;.Visible := false;.Visible := false;
//---------------------------------------.Visible := true;.Left := answerDBCtrlGrid.Left + 5;.Left :=answerDBCtrlGrid.Left + 5;.Width := (answerDBCtrlGrid.Width - 80) div 2;.Visible := true;.Left := answerDBCtrlGrid.Left + answerTextMemo.Width + 20;.Visible := true;.Left := answerCorrespLabel.Left;.Width := answerTextMemo.Width - 30;.Refresh;if questionTypeCB.ItemIndex = 3 then.Visible := false;.Visible := false;.Visible := false;.Visible := false;
//---------------------------------.Visible := true;.Visible := true;.Left := answerDBCtrlGrid.Left + 5;.Left := answerNumberLabel.Left;.Left := answerDBCtrlGrid.Left + 70;.Left := answerTextLabel.Left;.Width := answerDBCtrlGrid.Width - answerTextMemo.Left - 80;.Refresh;;;
TDataModule1.dsQuestionsStateChange(Sender: TObject);tabelQuestions.State = dsEdit then.answerPanel.Enabled := false.answerPanel.Enabled := true;;.
uEditorAutentification;
, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,, StdCtrls, Buttons;
= class(TForm): TEdit;: TEdit;: TLabel;: TLabel;: TBitBtn;: TBitBtn;FormCloseQuery(Sender: TObject; var CanClose: Boolean);
{ Private declarations }
{ Public declarations };
: TautentificationForm;
uEditorDataModule, uEditorMain;
{$R *.dfm}
TautentificationForm.FormCloseQuery(Sender: TObject;CanClose: Boolean);: string; begin(Sender as TautentificationForm).ModalResult = mrOk then((loginEdit.Text = ) and (passwordEdit.Text = )) then(Handle,Введите имя учетной записи и пароль,Ошибка!!!,MB_OK or MB_ICONERROR);:= false;.ADOConnection.Open;:= SELECT * from Users Where (User_group_id=1 or User_group_id=2) +
and (User_name= + loginEdit.Text + and User_password= +.Text + );
//ShowMessage(sqlStr);.ADOConnection.Open;.groupQuery.Open;.userQuery.Close;.userQuery.SQL.Text := sqlStr;.userQuery.Open;;DataModule1.userQuery.RecordCount = 1 then.tabelSections.Open;.tabelTests.Open;.tabelQuestions.Open;.tabelAnswers.Open;(Handle,Доступ запрещен!!!,Ошибка!!!,MB_OK or MB_ICONERROR);.Close;;;.Close;;;
.
uEditorMain;
, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,, Menus, ToolWin, ComCtrls, ExtCtrls, StdCtrls, DBCtrls, Grids,, Mask, Buttons, dbcgrids, ActnList, XPStyleActnCtrls, ActnMan,, ExtActns, ActnCtrls, XPMan, ImgList, RxCombos, RxRichEd,, AppEvent, SpeedBar, RxLookup, ToolEdit, RXDBCtrl;
= class(TForm): TMainMenu;: TMenuItem;: TMenuItem;: TMenuItem;: TMenuItem;: TMenuItem;: TMenuItem;: TMenuItem;: TMenuItem;: TMenuItem;: TMenuItem;: TMenuItem;: TMenuItem;: TMenuItem;: TMenuItem;: TMenuItem;: TMenuItem;: TStatusBar;: TToolBar;: TXPManifest;: TImageList;: TActionList;: TColorDialog;: TRichEditBold;: TRichEditItalic;: TRichEditUnderline;: TRichEditStrikeOu