Автоматизация проверки знаний и навыков студентов в области прикладной математики и информатики

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

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



DataModule1.setConformPanelActive;testingForm do.Visible := true;.Align := alClient;.Visible := False;.Visible := false;.Visible := false;.Visible := false;;;

TDataModule1.setOrderPanelActive;testingForm do.Visible := true;.Align := alClient;.Visible := False;.Visible := false;.Visible := false;.Visible := false;;;

//--Процедура форимрования понели для ответа пользователя--------

procedure setAnswer(questionType : integer);, index : integer;: array of integer;

//перемешиваем ответы если необходимоselectedTest.isRandomAnswer = true then(answerArray,DataModule1.answerQuery.RecordCount);.FillArray(answerArray);index := 0 to DataModule1.answerQuery.RecordCount - 1 do[index] := index;

0then">DataModule1.answerQuery.RecordCount > 0 then

//одиночный выбор--------------------------------------------------questionType = 0 then.SingleChoiceRG.Items.Clear;index := 0 to DataModule1.answerQuery.RecordCount - 1 do.answerQuery.RecNo := answerArray[index];.SingleChoiceRG.Items.Add(DataModule1.answerQuery.FieldByName(Answer_text).AsString);;.setSingleChoicePanelActive;

//множественный выбор----------------------------------------------if questionType = 1 then.MultiChoiceCLB.Items.Clear;index := 0 to DataModule1.answerQuery.RecordCount - 1 do.answerQuery.RecNo := answerArray[index];.MultiChoiceCLB.Items.Add(DataModule1.answerQuery.FieldByName(Answer_text).AsString);;.setMultiChoicePanelActive;

//соответствие --------------------------------------------------if questionType = 2 thenlineIndex := 0 to testingForm.conformStringGrid.RowCount - 1 do.conformStringGrid.Rows[lineIndex].Clear;

.conformStringGrid.RowCount := 1;.conformStringGrid.ColWidths[0] := 40;.conformStringGrid.ColWidths[2] := 40;.conformStringGrid.ColWidths[1] := (testingForm.PanelAnswer.Width - 100) div 2;.conformStringGrid.ColWidths[3] := (testingForm.PanelAnswer.Width - 100) div 2;

index := 0 to DataModule1.answerQuery.RecordCount - 1 do.answerQuery.RecNo := answerArray[index];.conformStringGrid.Cells[1, index] := DataModule1.answerQuery.FieldByName(Answer_text).AsString;.conformStringGrid.RowCount := (index + 1);;

.answerQuery.First;:= 0;not DataModule1.answerQuery.Eof do.conformStringGrid.Cells[2, index] := IntToStr(index + 1);.conformStringGrid.Cells[3, index] := DataModule1.answerQuery.FieldByName(Answer_corresp).AsString;.answerQuery.Next;(index);;.setConformPanelActive

//упорядоченный список-------------------------------------------if questionType = 3 thenlineIndex := 0 to testingForm.orderStringGrid.RowCount - 1 do.orderStringGrid.Rows[lineIndex].Clear;

.orderStringGrid.RowCount := 1;.orderStringGrid.ColWidths[0] := 40;.orderStringGrid.ColWidths[1] := testingForm.PanelAnswer.Width - 50;

index := 0 to DataModule1.answerQuery.RecordCount - 1 do.answerQuery.RecNo := answerArray[index];.orderStringGrid.Cells[1,index] := DataModule1.answerQuery.FieldByName(Answer_text).AsString;.orderStringGrid.RowCount := (index + 1);;.setOrderPanelActive;

//свободный ввод--------------------------------------------------if questionType = 4 then.RandomChoiceEdit.Text := ;.setRandomChoicePanelActive;;;

//---------------------------------------------------------------

//--Получаем и анализируем ответ пользователяTDataModule1.isUserAnswerRight(var answerText : string; questionType : integer) : boolean;,primaryIndex : integer;,correspIsRignt : boolean;

sqlStr : string;

//выборка правильных ответов для текущего вопроса

sqlStr := SELECT Answer_number, Answer_text, Answer_corresp From Answers Where Answer_question_id = +.questionQuery.FieldByName(Question_id).AsString + AND Answer_is_right = 1;

.universalQuery.Close;.universalQuery.SQL.Text := sqlStr;.universalQuery.Open;:= false;

-1 then:= Items.Strings[ItemIndex];((ItemIndex -1) and (Items.Strings[ItemIndex] = DataModule1.universalQuery.Fields[1].AsString)) then:= True;;

//множественный выбор----------------------------------------------if questionType = 1 then:= ;lineIndex := 0 to testingForm.MultiChoiceCLB.Items.Count - 1 dotestingForm.MultiChoiceCLB.Checked[lineIndex] then:= answerText + #10#13 + testingForm.MultiChoiceCLB.Items.Strings[lineIndex];

:= false;.universalQuery.First;not DataModule1.universalQuery.Eof dotestingForm.MultiChoiceCLB doChecked[Items.IndexOf(DataModule1.universalQuery.FieldByName(Answer_text).AsString)] = true then:= true:= false;;.universalQuery.Next;;

//соответствие --------------------------------------------------if questionType = 2 then:= ;testingForm.conformStringGrid dolineIndex := 0 to RowCount - 1 doCells[0,lineIndex] = then:= ;;:= answerText + #10#13 + Cells[1, lineIndex] + - + Cells[3, StrToInt(Cells[0,lineIndex])];;;

:= true;.answerQuery.First;:= 0;not answerQuery.Eof dotestingForm.conformStringGrid dolineIndex := 0 to RowCount - 1 do:= false;((Cells[0, lineIndex] = Cells[2,primaryIndex])(Cells[1, lineIndex] = DataModule1.answerQuery.FieldByName(Answer_text).AsString)) then:= true;;;;;:= Result and correspIsRignt;.answerQuery.Next;(primaryIndex);;

//упорядоченный список-------------------------------------------if questionType = 3 then:= ;testingForm.orderStringGrid dolineIndex := 0 to RowCount - 1 doCells[0,lineIndex] = then:= ;;:= answerText + #10#13 + Cells[0,lineIndex] + - + Cells[1, lineIndex];;;

:= true;lineIndex := 0 to testingForm.orderStringGrid.RowCount - 1 do.answerQuery.First;testingForm.orderStringGrid donot DataModule1.answerQuery.Eof do((Cells[0,lineIndex] = DataModule1.answerQuery.FieldByName(Answer_number).AsString)

(Cells[1,lineIndex] = DataModule1.answerQuery.FieldByName(Answer_text).AsString)) then:= true;;:= false;.answerQuery.Next;;;:= Result and lineIsRight;;

//свободный ввод--------------------------------------------------if questionType = 4 then:= testingForm.RandomChoiceEdit.Text;:= false;AnsiLowerCase(testingForm.RandomChoiceEdit.Text) =(DataModule1.answerQuery.FieldByName(Answer_text).AsString) then:= true;;

//---------------------------------------------------------------

TDataModule1.questionQueryAfterScroll(DataSet: TDataSet);: string;:= SELECT * FROM Answers WHERE Answer_question_id = +.FieldByName(Question_id).AsString;answerQuery do;.Text := sqlStr;;;

(questionQuery.FieldByName(Question_type).AsInteger);;

TDataModule1.questionQueryBeforeScroll(DataSet: TDataSet);

{var: string;: string;, isAnswered : integer;}

)or(answerText )) then:= 1;

:= INSERT INTO User_answers (User_answer_user_result_id, User_answer_qnumber, +

User_answer_question, User_answer_answer, User_answer_time, User_answer_is_right, +

User_answer_score, User_answer_answered) VALUES ( + intToStr(userResult.id) +

, + IntToStr(GquestionNumber) + , + DataModule1.questionQuery.FieldByName(Question_text).AsString +

, + answerText + ,00:00,+ IntToStr(answerIsRight) + ,0, + IntToStr(isAnswered) + );(insertSql);};

TDataModule1.questionQueryAfterOpen(DataSet: TDataSet);:= 0;.questionQuery.RecNo := GquestionOrderArray[GquestionNumber];;.

uClientMain;

, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,, Menus, ComCtrls, ExtCtrls, ToolWin, StdCtrls, ImgList, CheckLst,, RxRichEd, DBRichEd, DBCtrls, RXCtrls, Grids, RXGrids;

= class(TForm): TStatusBar;: TMainMenu;: TMenuItem;: TMenuItem;: TMenuItem;: TMenuItem;: TMenuItem;: TMenuItem;: TMenuItem;: TMenuItem;: TMenuItem;: TPanel;: TPanel;: TToolBar;: TSplitter;: TPanel;: TPanel;: TPanel;: TPanel;: TPanel;: TRadioGroup;: TLabeledEdit;: TImageList;: TToolButton;: TToolButton;: TToolButton;: TToolButton;: TToolButton;: TToolButton;: TToolButton;: TMenuItem;: TToolButton;: TToolButton;: TCheckListBox;: TLabel;: TRxDBRichEdit;: TTimer;: TStringGrid;: TLabel;: TStringGrid;: TLabel;MtestLoginClick(Sender: TObject);MtestStopClick(Sender: TObject);MtestBeginClick(Sender: TObject);MquestionNextClick(Sender: TObject);PanelAnswerDblClick(Sender: TObject);FormCreate(Sender: TObject);RandomChoicePanelResize(Sender: TObject);MquestionPrevClick(Sender: TObject);FormCloseQuery(Sender: TObject; var CanClose: Boolean);

{ Private declarations }Fil