Код программы. Вывод основных уведомлений, страница 4

if (Ftest->info.sr_info == 1) {

Label1->Caption = "Ваша оценка: "+IntToStr(Ftest->info.res_mark_o);

}

if (Ftest->info.sr_info == 0) {

L1:                                          Fresult->BorderStyle = bsSizeable;

Fresult->AutoScroll = true;

Label1->Caption = "Неправильные ответы даны на:";

Label1->Top = 5;

Label1->Left = 150;

int pred = -100;

cnt = 0;

for (vector<int>::iterator it = Ftest->info.f_answ.begin(); it != Ftest->info.f_answ.end(); it++) {

Ftest->testing->Close();

Ftest->testing->SQL->Clear();

Ftest->testing->SQL->Add("select * from \"Tests\" where \"Sh\" = "+IntToStr(*it));

Ftest->testing->Open();

Ftest->viewer[cnt] = new TJPEGImage;

Ftest->viewer[cnt]->Assign(Ftest->testingTest_q);

Ftest->viewert[cnt] = new TImage(this);

Ftest->viewert[cnt]->Width = 592;

Ftest->viewert[cnt]->Height = 123;

Ftest->viewert[cnt]->Left = 1;

Ftest->viewert[cnt]->Top = pred + 128;

Ftest->viewert[cnt]->Parent = Fresult;

Ftest->viewert[cnt]->Picture->Assign(Ftest->viewer[cnt]);

pred = Ftest->viewert[cnt]->Top;

cnt++;

}

RzBitBtn1->Top = pred + 125;

}

break;

}

case 3: {

if (Ftest->info.kol_true >= 24) {

Label1->Caption = "Поздравляем! Вы сдали экзамен";

}

else {

Label1->Caption = "Экзамен не сдан!";

}

Ftest->info.res_mark_o = Ftest->info.kol_true;

break;

}

default : {

Label1->Caption = "Ваша оценка: "+IntToStr(Ftest->info.res_mark_o);

break;

}

}

AnsiString wans;

for (vector<int>::iterator it = Ftest->info.f_answ.begin(); it != Ftest->info.f_answ.end(); it++) {

wans += IntToStr(*it) + "|";

}

}//---------------------------------------------------------------------------


Tem

//--------------------------------------------------------------------------#include <vcl.h>

#pragma hdrstop

#include "Tem.h"

#include "Ttest.h"

#include "Unit2.h"

//--------------------------------------------------------------------------#pragma package(smart_init)

#pragma link "RzCmboBx"

#pragma link "RzDBGrid"

#pragma link "RzLabel"

#pragma link "RzPanel"

#pragma link "RzRadGrp"

#pragma link "RzButton"

#pragma resource "*.dfm"

TFtem *Ftem;

//--------------------------------------------------------------------------__fastcall TFtem::TFtem(TComponent* Owner)

: TForm(Owner)

{

}

//--------------------------------------------------------------------------void __fastcall TFtem::RzBitBtn1Click(TObject *Sender)

{

// Выбрали тему

if (Type_SR->ItemIndex != -1) {

Ftest->id.sr_info = Type_SR->ItemIndex;

}

Ftest->id.tema_shabl = Fttest->nazv1Sh->AsInteger;

if (Ftest->id.tema_shabl == NULL) {

Application->MessageBoxA("Необходимо выбрать тему шаблона!", "Работа с шаблонами", MB_OK + MB_ICONINFORMATION);

return;

}

else {

Ftem->Hide();

Ftest->Show();

}

}

//--------------------------------------------------------------------------void __fastcall TFtem::FormCloseQuery(TObject *Sender, bool &CanClose)

{

}

//--------------------------------------------------------------------------void __fastcall TFtem::VidsSelect(TObject *Sender)

{

// Выбираем подтемы

AnsiString fil;

fil = "select * from \"Tems\" where \"Vid\" = "+Vids->Value+" and \"Kod\" = "+IntToStr(Fttest->id1.type_shabl);

Fttest->nazv1->Close();

Fttest->nazv1->SQL->Clear();

Fttest->nazv1->SQL->Add(fil);

Fttest->nazv1->Open();

Fttest->nazv1->First();

}