Автоматизация проверки знаний и навыков студентов в области прикладной математики и информатики
Дипломная работа - Компьютеры, программирование
Другие дипломы по предмету Компьютеры, программирование
lArray(var A: array of Integer);toSQLDateTime(dateTime : TDateTime) : string;
{ Public declarations };
= record: integer;: integer;: string;: string;: string;: integer;: integer;: integer;: boolean;: boolean;: string;: boolean;
;
= record: integer;: integer;: integer;: TDateTime;: TDateTime;: integer;: integer;: integer;: integer;: integer;: real;;
= record: integer;: integer;: integer;: string;: integer;: integer;: integer;: string;;
= record: integer;: integer;: integer;: string;: integer;: boolean;: array [1..10,1..10] of integer;;
: TtestingForm;: TTest; : TUserResult;
// currentAnswer : TAnswer;
//массив случайных неповторяющихся порядковых номеров вопросов: array of integer;
//текущий индекс массиве номеров вопросов
GquestionNumber : integer;
uClinetLogin, uClientSelectTest, uClientDataModule;
{$R *.dfm}
//----функция для заполнения массива номеров вопросов--------------
procedure TtestingForm.FillArray(var A: array of Integer);, S, R: Integer;I := 0 to High(A) do[I] := I + 1;i := High(A) downto 0 do:= Random(I);:= A[R];[R] := A[I];[I] := S;;
end;
//-----------------------------------------------------------------
//Преобразуем дату и время в формат SQL Server
function TtestingForm.toSQLDateTime(dateTime : TDateTime) : string;: TFormatSettings;(0,formatSetting);.ShortDateFormat:=mm/dd/yyyy;.DateSeparator := /;:= DateTimeToStr(dateTime,formatSetting);;
toSQLFloat(realDigit : real) : string;: TFormatSettings;(0,formatSetting);.DecimalSeparator := .;:= FormatFloat(0.00,realDigit,formatSetting);;
TtestingForm.MtestLoginClick(Sender: TObject);.ShowModal;;
TtestingForm.MtestStopClick(Sender: TObject);.Close;;
TtestingForm.MtestBeginClick(Sender: TObject);.ShowModal;;
TtestingForm.MquestionNextClick(Sender: TObject);: string;
// answerText : string;
: string;: string;, isAnswered : integer;
begin
//получение ответа пользователя и занесение его в БД--
)then:=1;">answerIsRight := 0;:= 0;DataModule1.isUserAnswerRight(answerText,DataModule1.questionQuery.FieldByName(Question_type).AsInteger) = true then(userResult.userRightAnswerQuestion);:= 1;;(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_header).AsString +
, + answerText + ,00:00,+ IntToStr(answerIsRight) + ,0, + IntToStr(isAnswered) + );.userAnswerQuery.Close;.userAnswerQuery.SQL.Text := insertSql;.userAnswerQuery.ExecSQL;
//ShowMessage(insertSql);
//---------------------------------------------
GquestionNumber < selectedTest.questionCount - 1 then(GquestionNumber);(userResult.userComplitedQuestion);.Panels[2].Text := Вопрос: + IntToStr(GquestionNumber + 1) +
из + IntToStr(selectedTest.questionCount);.questionQuery.RecNo := GquestionOrderArray[GquestionNumber];.complited := 0;DataModule1.isUserAnswerRight(answerText, DataModule1.questionQuery.FieldByName(Question_type).AsInteger) = true then
//ShowMessage(pravilno);
//inc(userResult.userComplitedQuestion);(userResult.userRightAnswerQuestion);;.complited := 1;.timeEnd := now;(Тест окончен);;
.percentRight := (userResult.userRightAnswerQuestion/userResult.totalQuestion)*100;
//Заносим обновления в базу:= Update User_results Set User_result_completed_questions= + IntToStr(userResult.userComplitedQuestion) +
,User_result_right_questions= + IntToStr(userResult.userRightAnswerQuestion) +
,User_result_percent_right= + toSQLFloat(userResult.percentRight)+
,User_result_comleted= + IntToStr(userResult.complited) +
where User_result_id= + IntToStr(userResult.id);.userResultQuery.Close;.userResultQuery.SQL.Text := updateSql;.userResultQuery.ExecSQL;
userResult.complited = 1 then:= Update User_results Set User_result_time_end= +.toSQLDateTime(userResult.timeEnd) +
where User_result_id= + IntToStr(userResult.id);.userResultQuery.Close;.userResultQuery.SQL.Text := updateSql;.userResultQuery.ExecSQL;;;
0))then(GquestionNumber);(userResult.userComplitedQuestion);.Panels[2].Text:=:+IntToStr(GquestionNumber+1)+">TtestingForm.MquestionPrevClick(Sender: TObject);((selectedTest.isBack = true) and (GquestionNumber > 0)) then(GquestionNumber);(userResult.userComplitedQuestion);.Panels[2].Text := Вопрос: + IntToStr(GquestionNumber + 1) +
из + IntToStr(selectedTest.questionCount);.questionQuery.RecNo := GquestionOrderArray[GquestionNumber];(Handle,Возврат невозможен,Ошибка!,MB_OK or MB_ICONWARNING);;
TtestingForm.PanelAnswerDblClick(Sender: TObject);.Align := alClient;;
TtestingForm.FormCreate(Sender: TObject);.Visible := false;.Visible := false;.Visible := false;.Visible := false;.Visible := false;;
TtestingForm.RandomChoicePanelResize(Sender: TObject);.Left := RandomChoicePanel.Left + 5;.Top := RandomChoicePanel.Top + 20;.Width := RandomChoicePanel.Width - 13;;
TtestingForm.FormCloseQuery(Sender: TObject;CanClose: Boolean);userResult.userComplitedQuestion < userResult.totalQuestion then
beginMessageBox(handle,Вы ответили не на все вопросы. Закрыть приложение?,Внимание!!!,MB_YESNO or MB_ICONWARNING) = mrYes then
CanClose := true:= false;
end;;.