⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit13.pas

📁 试卷自动生成系统
💻 PAS
📖 第 1 页 / 共 3 页
字号:
      Memo5.Text:=DataModule4.Table_procedure.FieldByName('tigan').AsString;
       choosedtno:=DataModule4.Table_procedure.fieldbyname('tno').AsInteger;
       end;
     end;
     end;
   end;

   case button of
    nbNext:
    begin
      with DataModule4.Table_procedure do
      begin
      if active<>true then open;
        begin
    Memo5.Text:=DataModule4.Table_procedure.FieldByName('tigan').AsString;
     choosedtno:=DataModule4.Table_procedure.fieldbyname('tno').AsInteger;
     end;
     end;
     end;
   end;


    case button of
    nbPrior:
    begin
      with DataModule4.Table_procedure do
      begin
      if active<>true then open;
    begin
    Memo5.Text:=DataModule4.Table_procedure.FieldByName('tigan').AsString;
     choosedtno:=DataModule4.Table_procedure.fieldbyname('tno').AsInteger;
     end;
     end;
     end;
   end;
end;

procedure Tchoosepaperform.TabSheet1Show(Sender: TObject);
begin
GroupBox1.Visible:=true;
GroupBox2.Visible:=false;
GroupBox3.Visible:=false;
GroupBox4.Visible:=false;
GroupBox5.Visible:=false;

BitBtn1.Enabled:=true;
BitBtn2.Enabled:=true;
BitBtn4.Enabled:=false;
BitBtn5.Enabled:=false;
BitBtn6.Enabled:=false;
BitBtn7.Enabled:=false;
BitBtn8.Enabled:=false;
BitBtn9.Enabled:=false;
BitBtn10.Enabled:=false;
BitBtn11.Enabled:=false;
//showmessage(inttostr(Form10.choosenum));
//Label1.Caption:='试卷共需要'+inttostr(Form10.choosenum)+'题.          ';
with DataModule4.Table_choose do
   begin
   if active<>true then open;
     first;
   //  while  not eof do
     begin
     Memo1.Text:=DataModule4.Table_choose.FieldByName('tigan').AsString+sLineBreak+DataModule4.Table_choose.FieldByName('xa').AsString+sLineBreak+DataModule4.Table_choose.FieldByName('xb').AsString+sLineBreak+DataModule4.Table_choose.FieldByName('xc').AsString+sLineBreak+DataModule4.Table_choose.FieldByName('xd').AsString;
     choosedtno:=DataModule4.Table_choose.fieldbyname('tno').AsInteger;
     tempstring:=Memo1.Text;
   //   DBListBox3.Items.Append(fieldbyname('tigan').AsString);
  //   Next;
     end;
  // end;
end;
end;

procedure Tchoosepaperform.TabSheet2Show(Sender: TObject);
begin
GroupBox1.Visible:=false;
GroupBox2.Visible:=true;
GroupBox3.Visible:=false;
GroupBox4.Visible:=false;
GroupBox5.Visible:=false;


BitBtn4.Enabled:=true;
BitBtn5.Enabled:=true;
BitBtn1.Enabled:=false;
BitBtn2.Enabled:=false;
BitBtn6.Enabled:=false;
BitBtn7.Enabled:=false;
BitBtn8.Enabled:=false;
BitBtn9.Enabled:=false;
BitBtn10.Enabled:=false;
BitBtn11.Enabled:=false;
    with DataModule4.Table_judge do
   begin
   if active<>true then open;
     first;
   //  while  not eof do
     begin
     Memo2.Text:=DataModule4.Table_judge.fieldbyname('tigan').AsString+sLineBreak+DataModule4.Table_judge.fieldbyname('answer').AsString;
    choosedtno:=DataModule4.Table_judge.fieldbyname('tno').AsInteger;
   //   DBListBox3.Items.Append(fieldbyname('tigan').AsString);
  //   Next;
     end;
  // end;
end;
end;

procedure Tchoosepaperform.TabSheet3Show(Sender: TObject);
begin
GroupBox1.Visible:=false;
GroupBox2.Visible:=false;
GroupBox3.Visible:=true;
GroupBox4.Visible:=false;
GroupBox5.Visible:=false;


BitBtn6.Enabled:=true;
BitBtn7.Enabled:=true;
BitBtn4.Enabled:=false;
BitBtn5.Enabled:=false;
BitBtn1.Enabled:=false;
BitBtn2.Enabled:=false;
BitBtn8.Enabled:=false;
BitBtn9.Enabled:=false;
BitBtn10.Enabled:=false;
BitBtn11.Enabled:=false;
   with DataModule4.Table_filltext do
   begin
   if active<>true then open;
     first;
   //  while  not eof do
     begin
     Memo3.Text:=DataModule4.Table_filltext.FieldByName('tigan').AsString;
      choosedtno:=DataModule4.Table_filltext.fieldbyname('tno').AsInteger;
  //   Next;
     end;
 //  end;
end;

end;

procedure Tchoosepaperform.TabSheet4Show(Sender: TObject);
begin
GroupBox1.Visible:=false;
GroupBox2.Visible:=false;
GroupBox3.Visible:=false;
GroupBox4.Visible:=true;
GroupBox5.Visible:=false;



BitBtn8.Enabled:=true;
BitBtn9.Enabled:=true;
BitBtn4.Enabled:=false;
BitBtn5.Enabled:=false;
BitBtn6.Enabled:=false;
BitBtn7.Enabled:=false;
BitBtn1.Enabled:=false;
BitBtn2.Enabled:=false;
BitBtn10.Enabled:=false;
BitBtn11.Enabled:=false;
   with DataModule4.Table_readpro do
   begin
   if active<>true then open;
     first;
   //  while  not eof do
     begin
     Memo4.Text:=DataModule4.Table_readpro.FieldByName('tigan').AsString+sLineBreak+DataModule4.Table_readpro.FieldByName('ctigan1').AsString+sLineBreak+DataModule4.Table_readpro.FieldByName('ctigan2').AsString+sLineBreak+DataModule4.Table_readpro.FieldByName('ctigan3').AsString;
       choosedtno:=DataModule4.Table_readpro.fieldbyname('tno').AsInteger;
   //   DBListBox3.Items.Append(fieldbyname('tigan').AsString);
  //   Next;
     end;
  // end;
end;
end;

procedure Tchoosepaperform.TabSheet5Show(Sender: TObject);
begin
GroupBox1.Visible:=false;
GroupBox2.Visible:=false;
GroupBox3.Visible:=false;
GroupBox4.Visible:=false;
GroupBox5.Visible:=true;


BitBtn10.Enabled:=true;
BitBtn11.Enabled:=true;
BitBtn4.Enabled:=false;
BitBtn5.Enabled:=false;
BitBtn6.Enabled:=false;
BitBtn7.Enabled:=false;
BitBtn8.Enabled:=false;
BitBtn9.Enabled:=false;
BitBtn1.Enabled:=false;
BitBtn2.Enabled:=false;

with DataModule4.Table_procedure do
   begin
   if active<>true then open;
     first;
   //  while  not eof do
     begin
     Memo5.Text:=DataModule4.Table_procedure.FieldByName('tigan').AsString;
     choosedtno:=DataModule4.Table_procedure.fieldbyname('tno').AsInteger;
     
     end;
  end;
end;

procedure Tchoosepaperform.BitBtn1Click(Sender: TObject);
var
i:integer;
temp:boolean;
 //j:string;
begin
temp:=true;


//if (ListBox6.Items[i]=inttostr(choosedtno)) or(ListBox1.Items.Count=form10.choosenum) then

         if ListBox1.Items.Count=definepaperform.choosenum then
         begin
        //choosefull:=true;
         showmessage('选择题已选择完毕!');

       temp:=false   ;
      end
      else
      begin
            
      for i:=0 to ListBox6.Items.Count-1  do
        if (strtoint(ListBox6.Items[i]) div 10)=(choosedtno div 10) then
        begin
       
        showmessage('本知识点已选!');
        temp:=false ;
        end;
      end;
      if temp then
      begin
       ListBox1.Items.Append(inttostr(choosedtno));
       ListBox6.Items.Append(inttostr(choosedtno));
       Label2.Caption:='已选择 '+inttostr(ListBox1.Items.count)+'  题.          ';
        Label3.Caption:='还剩余 '+inttostr(definepaperform.choosenum-ListBox1.Items.count)+'  题.          ';
   //    showmessage(tempstring);
    //   j:=inttostr(choosedtno);
 //       with Query1 do
   //   begin
   //     close;
   //     sql.Clear;
    //    sql.Text:='insert into ti_choose_long(tno) values('''+j+''')' ;
    //    prepare;
    //    execsql;
   //   end;
           end;
      DBNavigator1.BtnClick(nbNext);
end;

procedure Tchoosepaperform.BitBtn4Click(Sender: TObject);
var
i:integer;
temp:boolean;
begin
temp:=true;
    //   (strtoint(ListBox2.Items[i]) div 10)=(choosedtno div 10)
   if ListBox2.Items.Count=definepaperform.judgenum then
         begin
         showmessage('判断题已选择完毕!');
       //  judgefull:=true;
       temp:=false   ;
      end
      else
      begin
             for i:=0 to ListBox6.Items.Count-1  do
          if   (strtoint(ListBox6.Items[i]) div 10)=(choosedtno div 10)  then
      //  if ListBox6.Items[i]=inttostr(choosedtno) then
        begin
        showmessage('本知识点已选!');
        temp:=false   ;
        end;
      end;
      if temp then
      begin
       ListBox2.Items.Append(inttostr(choosedtno));
        ListBox6.Items.Append(inttostr(choosedtno));
             Label5.Caption:='已选择 '+inttostr(ListBox2.Items.count)+'  题.          ';
        Label6.Caption:='还剩余 '+inttostr(definepaperform.judgenum-ListBox2.Items.count)+'  题.          ';

           end;
  DBNavigator2.BtnClick(nbNext);
end;

procedure Tchoosepaperform.BitBtn6Click(Sender: TObject);
var
i:integer;
temp:boolean;
begin
temp:=true;

   if ListBox3.Items.Count=definepaperform.filltextnum then
         begin
         showmessage('填空题已选择完毕!');
       //  filltextfull:=true;
       temp:=false   ;
      end
      else
      begin
             for i:=0 to ListBox6.Items.Count-1  do
           if   (strtoint(ListBox6.Items[i]) div 10)=(choosedtno div 10) then
   //     if ListBox6.Items[i]=inttostr(choosedtno) then
        begin
        showmessage('本知识点已选!');
        temp:=false   ;
        end;
      end;
     if temp then
     begin
       ListBox3.Items.Append(inttostr(choosedtno));
       ListBox6.Items.Append(inttostr(choosedtno));
            Label8.Caption:='已选择 '+inttostr(ListBox3.Items.count)+'  题.          ';
        Label9.Caption:='还剩余 '+inttostr(definepaperform.filltextnum-ListBox3.Items.count)+'  题.          ';

          end;
         DBNavigator3.BtnClick(nbNext);
end;



procedure Tchoosepaperform.BitBtn8Click(Sender: TObject);
var
i:integer;
temp:boolean;
begin
temp:=true;

   if ListBox4.Items.Count=definepaperform.readpronum then
         begin
         showmessage('程序阅读题已选择完毕!');
      //   readprofull:=true;
       temp:=false   ;
      end
      else
      begin
             for i:=0 to ListBox6.Items.Count-1  do
           if   (strtoint(ListBox6.Items[i]) div 10)=(choosedtno div 10) then
    //    if ListBox6.Items[i]=inttostr(choosedtno) then
        begin
        showmessage('本知识点已选!');
        temp:=false   ;
        end;
      end;
      if temp then
      begin
       ListBox4.Items.Append(inttostr(choosedtno));
       ListBox6.Items.Append(inttostr(choosedtno));
            Label11.Caption:='已选择 '+inttostr(ListBox4.Items.count)+'  题.          ';
        Label12.Caption:='还剩余 '+inttostr(definepaperform.readpronum-ListBox4.Items.count)+'  题.          ';

           end;
    DBNavigator4.BtnClick(nbNext);
end;



procedure Tchoosepaperform.BitBtn10Click(Sender: TObject);
var
i:integer;
temp:boolean;
begin
temp:=true;

   if ListBox5.Items.Count=definepaperform.procedurenum then
         begin
         showmessage('编程题已选择完毕!');
     //    procedurefull:=true;
       temp:=false   ;
      end
      else
      begin
             for i:=0 to ListBox6.Items.Count-1  do
           if   (strtoint(ListBox6.Items[i]) div 10)=(choosedtno div 10) then
     //   if ListBox6.Items[i]=inttostr(choosedtno) then
        begin
        showmessage('本知识点已选!');
        temp:=false   ;
        end;
      end;
     if temp then
     begin
       ListBox5.Items.Append(inttostr(choosedtno));
       ListBox6.Items.Append(inttostr(choosedtno));
            Label14.Caption:='已选择 '+inttostr(ListBox5.Items.count)+'  题.          ';
        Label15.Caption:='还剩余 '+inttostr(definepaperform.procedurenum-ListBox5.Items.count)+'  题.          ';
  
          end;
    DBNavigator5.BtnClick(nbNext);
end;



procedure Tchoosepaperform.BitBtn2Click(Sender: TObject);
var
j,i:integer;
begin
for i:=ListBox1.Items.Count-1 downto 0 do
 if ListBox1.Selected[i] then
 begin

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -