Написание программы с использованием команд void prepod_see(int n), void admin_see(), void students_see(), void not_see2(bool t), страница 8

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

#pragma package(smart_init)

#pragma resource "*.dfm"

TForm4 *Form4;

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

__fastcall TForm4::TForm4(TComponent* Owner)

        : TForm(Owner)

{randomize();

 nomer_v=1;v_true=0;

 Form4->Label13->Caption=nomer_v;

}

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

void not_see4()

{Form4->Label1->Visible=false;

Form4->Label2->Visible=false;

Form4->Label3->Visible=false;

Form4->Label4->Visible=false;

Form4->Label5->Visible=false;

Form4->Label6->Visible=false;

Form4->Label7->Visible=false;

Form4->Label8->Visible=false;

Form4->Label9->Visible=false;

Form4->Label10->Visible=false;

Form4->RadioButton1->Visible=false;

Form4->RadioButton2->Visible=false;

Form4->RadioButton3->Visible=false;

Form4->RadioButton4->Visible=false;

Form4->RadioButton5->Visible=false;

Form4->RadioButton6->Visible=false;

Form4->RadioButton7->Visible=false;

Form4->RadioButton8->Visible=false;

Form4->RadioButton9->Visible=false;

Form4->RadioButton10->Visible=false;

}

int What_RB_Enable()

{//Возвращает порядковый номера выбранного

         //варианта ответа или 0 если не выбран.

if(Form4->RadioButton1->Checked==true){Form4->RadioButton1->Checked=false; return 1;}

if(Form4->RadioButton2->Checked==true){Form4->RadioButton2->Checked=false;return 2;}

if(Form4->RadioButton3->Checked==true){Form4->RadioButton3->Checked=false;return 3;}

if(Form4->RadioButton4->Checked==true){Form4->RadioButton4->Checked=false;return 4; }

if(Form4->RadioButton5->Checked==true){Form4->RadioButton5->Checked=false;return 5; }

if(Form4->RadioButton6->Checked==true){Form4->RadioButton6->Checked=false;return 6;}

if(Form4->RadioButton7->Checked==true){Form4->RadioButton7->Checked=false;return 7;}

if(Form4->RadioButton8->Checked==true){Form4->RadioButton8->Checked=false;return 8;}

if(Form4->RadioButton9->Checked==true){Form4->RadioButton9->Checked=false;return 9;}

if(Form4->RadioButton10->Checked==true){Form4->RadioButton10->Checked=false;return 10;}

return 0;

}

void itog()

{//На форме Form6 выводит результаты студента

 AnsiString t2,s;

 int z;

 Form4->Close();

 Form5->Close();

 Form7->Close();

 Form6->Memo1->Lines->Strings[2]=Form7->Edit1->Text+' '+Form7->Edit2->Text+' '+Form7->Edit3->Text+"  группы  "+Form7->Edit4->Text;

 Form6->Memo1->Lines->Strings[5]=vop;

 Form6->Memo1->Lines->Strings[8]=v_true;

 z=v_true*100/vop;

 Form6->Memo1->Lines->Strings[11]=z;

 Form6->Show();

 s=Form7->ListBox1->Items->Strings[Form7->ListBox1->ItemIndex];

 t2=GetDir();t2=t2+"БД\\s_"+s+".txt";

 Form3->Memo2->Lines->SaveToFile(t2);

}

void show_true(int t)

{//показывает правильный вариант ответа преподавателю

 if(t==1){Form3->RadioButton1->Checked=true;return;}

 if(t==2){Form3->RadioButton2->Checked=true;return;}

 if(t==3){Form3->RadioButton3->Checked=true;return;}

 if(t==4){Form3->RadioButton4->Checked=true;return;}

 if(t==5){Form3->RadioButton5->Checked=true;return;}

 if(t==6){Form3->RadioButton6->Checked=true;return;}

 if(t==7){Form3->RadioButton7->Checked=true;return;}

 if(t==8){Form3->RadioButton8->Checked=true;return;}

 if(t==9){Form3->RadioButton9->Checked=true;return;}

 if(t==10){Form3->RadioButton10->Checked=true;return;}

}

void where_show(AnsiString v,int f,int n_v)

{if(f==2){Form3->Memo3->Lines->Add(v);Form3->Edit23->Text=n_v;}

 if(f==3){Form4->Memo1->Lines->Clear();Form4->Memo1->Lines->Add(v);}

}

void v_a_see(AnsiString v_a,int n,int f)

{//показывает варианты ответа преподавателю и студенту

 if(n==1){if(f==2){Form3->Edit1->Text=v_a;Form3->Edit1->Visible=true;Form3->Label1->Visible=true;Form3->RadioButton1->Visible=true;}

          if(f==3){Form4->RadioButton1->Caption=v_a;Form4->RadioButton1->Visible=true;Form4->Label1->Visible=true;}}

 if(n==2){if(f==2){Form3->Edit2->Text=v_a;Form3->Edit2->Visible=true;Form3->Label2->Visible=true;Form3->RadioButton2->Visible=true;}

          if(f==3){Form4->RadioButton2->Caption=v_a;Form4->RadioButton2->Visible=true;Form4->Label2->Visible=true;}}

 if(n==3){if(f==2){Form3->Edit3->Text=v_a;Form3->Edit3->Visible=true;Form3->Label3->Visible=true;Form3->RadioButton3->Visible=true;}

          if(f==3){Form4->RadioButton3->Caption=v_a;Form4->RadioButton3->Visible=true;Form4->Label3->Visible=true;}}

 if(n==4){if(f==2){Form3->Edit4->Text=v_a;Form3->Edit4->Visible=true;Form3->Label4->Visible=true;Form3->RadioButton4->Visible=true;}

          if(f==3){Form4->RadioButton4->Caption=v_a;Form4->RadioButton4->Visible=true;Form4->Label4->Visible=true;}}

 if(n==5){if(f==2){Form3->Edit5->Text=v_a;Form3->Edit5->Visible=true;Form3->Label5->Visible=true;Form3->RadioButton5->Visible=true;}

          if(f==3){Form4->RadioButton5->Caption=v_a;Form4->RadioButton5->Visible=true;Form4->Label5->Visible=true;}}

 if(n==6){if(f==2){Form3->Edit6->Text=v_a;Form3->Edit6->Visible=true;Form3->Label6->Visible=true;Form3->RadioButton6->Visible=true;}