Unit13.pas
上传用户:szyozho
上传日期:2013-04-13
资源大小:3688k
文件大小:37k
源码类别:

教育系统应用

开发平台:

Delphi

  1. unit Unit13;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5.   Dialogs, StdCtrls, Buttons, ComCtrls, ExtCtrls, DBCtrls, DB, DBTables,
  6.   Mask;
  7. type
  8.   Tchoosepaperform = class(TForm)
  9.     Panel1: TPanel;
  10.     BitBtn1: TBitBtn;
  11.     BitBtn2: TBitBtn;
  12.     PageControl1: TPageControl;
  13.     TabSheet1: TTabSheet;
  14.     DBNavigator1: TDBNavigator;
  15.     Memo1: TMemo;
  16.     TabSheet2: TTabSheet;
  17.     Memo2: TMemo;
  18.     TabSheet3: TTabSheet;
  19.     Memo3: TMemo;
  20.     TabSheet4: TTabSheet;
  21.     Memo4: TMemo;
  22.     TabSheet5: TTabSheet;
  23.     Memo5: TMemo;
  24.     DBNavigator2: TDBNavigator;
  25.     DBNavigator3: TDBNavigator;
  26.     DBNavigator4: TDBNavigator;
  27.     DBNavigator5: TDBNavigator;
  28.     BitBtn3: TBitBtn;
  29.     ListBox1: TListBox;
  30.     GroupBox1: TGroupBox;
  31.     GroupBox2: TGroupBox;
  32.     GroupBox3: TGroupBox;
  33.     GroupBox4: TGroupBox;
  34.     GroupBox5: TGroupBox;
  35.     ListBox2: TListBox;
  36.     ListBox3: TListBox;
  37.     ListBox4: TListBox;
  38.     ListBox5: TListBox;
  39.     BitBtn4: TBitBtn;
  40.     BitBtn6: TBitBtn;
  41.     BitBtn8: TBitBtn;
  42.     BitBtn10: TBitBtn;
  43.     BitBtn5: TBitBtn;
  44.     BitBtn7: TBitBtn;
  45.     BitBtn9: TBitBtn;
  46.     BitBtn11: TBitBtn;
  47.     ListBox6: TListBox;
  48.     BitBtn12: TBitBtn;
  49.     Query1: TQuery;
  50.     Label13: TLabel;
  51.     Label14: TLabel;
  52.     Label15: TLabel;
  53.     Label10: TLabel;
  54.     Label11: TLabel;
  55.     Label12: TLabel;
  56.     Label7: TLabel;
  57.     Label8: TLabel;
  58.     Label9: TLabel;
  59.     Label4: TLabel;
  60.     Label5: TLabel;
  61.     Label6: TLabel;
  62.     Label1: TLabel;
  63.     Label2: TLabel;
  64.     Label3: TLabel;
  65.     DBEdit1: TDBEdit;
  66.     DBEdit2: TDBEdit;
  67.     DBEdit3: TDBEdit;
  68.     DBEdit4: TDBEdit;
  69.     DBEdit5: TDBEdit;
  70.  //   DBListBox1: TDBListBox;
  71.   //  DBListBox2: TDBListBox;
  72.   //  DBListBox3: TDBListBox;
  73.   //  DBListBox4: TDBListBox;
  74.   //  DBListBox5: TDBListBox;
  75.  // procedure addtonewtimu;
  76.     procedure DBNavigator1Click(Sender: TObject; Button: TNavigateBtn);
  77.     procedure DBNavigator2Click(Sender: TObject; Button: TNavigateBtn);
  78.     procedure DBNavigator3Click(Sender: TObject; Button: TNavigateBtn);
  79.     procedure DBNavigator4Click(Sender: TObject; Button: TNavigateBtn);
  80.     procedure DBNavigator5Click(Sender: TObject; Button: TNavigateBtn);
  81.     procedure TabSheet1Show(Sender: TObject);
  82.     procedure TabSheet2Show(Sender: TObject);
  83.     procedure TabSheet3Show(Sender: TObject);
  84.     procedure TabSheet4Show(Sender: TObject);
  85.     procedure TabSheet5Show(Sender: TObject);
  86.     procedure BitBtn1Click(Sender: TObject);
  87.     procedure BitBtn4Click(Sender: TObject);
  88.     procedure BitBtn6Click(Sender: TObject);
  89.     procedure BitBtn8Click(Sender: TObject);
  90.     procedure BitBtn10Click(Sender: TObject);
  91.     procedure BitBtn2Click(Sender: TObject);
  92.     procedure BitBtn5Click(Sender: TObject);
  93.     procedure BitBtn7Click(Sender: TObject);
  94.     procedure BitBtn9Click(Sender: TObject);
  95.     procedure BitBtn11Click(Sender: TObject);
  96.     procedure FormCreate(Sender: TObject);
  97.     procedure ListBox2Click(Sender: TObject);
  98.     procedure ListBox1Click(Sender: TObject);
  99.     procedure ListBox3Click(Sender: TObject);
  100.     procedure ListBox4Click(Sender: TObject);
  101.     procedure ListBox5Click(Sender: TObject);
  102.     procedure BitBtn12Click(Sender: TObject);
  103.    // procedure BitBtn4Click(Sender: TObject);
  104.   private
  105.     { Private declarations }
  106.   public
  107.     { Public declarations }
  108.   end;
  109. var
  110.   choosepaperform: Tchoosepaperform;
  111.   choosedtno:integer;
  112.   tempstring:string;
  113.   tmno: array[1..5] of string=('一、','二、','三、','四、','五、');
  114.  // choosefull,judgefull,filltextfull,readprofull,procedurefull:boolean;
  115. implementation
  116. uses Unit4, Unit10, Unit14, Unit17, Unit19;
  117. {$R *.dfm}
  118. procedure Tchoosepaperform.DBNavigator1Click(Sender: TObject; Button: TNavigateBtn);
  119. begin
  120.     case button of
  121.     nbFirst:
  122.     begin
  123.       with DataModule4.Table_choose do
  124.       begin
  125.       if active<>true then open;
  126.        begin
  127.       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;
  128.        choosedtno:=DataModule4.Table_choose.fieldbyname('tno').AsInteger;
  129.         tempstring:=Memo1.Text;
  130.      end;
  131.      end;
  132.      end;
  133.    end;
  134.    case button of
  135.     nbLast:
  136.     begin
  137.       with DataModule4.Table_choose do
  138.       begin
  139.       if active<>true then open;
  140.       begin
  141.       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;
  142.      choosedtno:=DataModule4.Table_choose.fieldbyname('tno').AsInteger;
  143.     end;
  144.      end;
  145.      end;
  146.    end;
  147.    case button of
  148.     nbNext:
  149.     begin
  150.       with DataModule4.Table_choose do
  151.       begin
  152.       if active<>true then open;
  153.      begin
  154.      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;
  155.       choosedtno:=DataModule4.Table_choose.fieldbyname('tno').AsInteger;
  156.     end;
  157.      end;
  158.      end;
  159.    end;
  160.     case button of
  161.     nbPrior:
  162.     begin
  163.       with DataModule4.Table_choose do
  164.       begin
  165.       if active<>true then open;
  166.     begin
  167.      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;
  168.          choosedtno:=DataModule4.Table_choose.fieldbyname('tno').AsInteger;
  169.      end;
  170.      end;
  171.      end;
  172.    end;
  173. end;
  174. procedure Tchoosepaperform.DBNavigator2Click(Sender: TObject; Button: TNavigateBtn);
  175. begin
  176.     case button of
  177.     nbFirst:
  178.     begin
  179.       with DataModule4.Table_judge do
  180.       begin
  181.       if active<>true then open;
  182.       begin
  183.       Memo2.Text:=DataModule4.Table_judge.FieldByName('tigan').AsString+sLineBreak+DataModule4.Table_judge.FieldByName('answer').AsString;
  184.        choosedtno:=DataModule4.Table_judge.fieldbyname('tno').AsInteger;
  185.      end;
  186.      end;
  187.      end;
  188.    end;
  189.    case button of
  190.     nbLast:
  191.     begin
  192.       with DataModule4.Table_judge do
  193.       begin
  194.       if active<>true then open;
  195.        begin
  196.       Memo2.Text:=DataModule4.Table_judge.FieldByName('tigan').AsString+sLineBreak+DataModule4.Table_judge.FieldByName('answer').AsString;
  197.     choosedtno:=DataModule4.Table_judge.fieldbyname('tno').AsInteger;
  198.     end;
  199.      end;
  200.      end;
  201.    end;
  202.    case button of
  203.     nbNext:
  204.     begin
  205.       with DataModule4.Table_judge do
  206.       begin
  207.       if active<>true then open;
  208.       begin
  209.     Memo2.Text:=DataModule4.Table_judge.FieldByName('tigan').AsString+sLineBreak+DataModule4.Table_judge.FieldByName('answer').AsString;
  210.      choosedtno:=DataModule4.Table_judge.fieldbyname('tno').AsInteger;
  211.      end;
  212.      end;
  213.      end;
  214.    end;
  215.     case button of
  216.     nbPrior:
  217.     begin
  218.       with DataModule4.Table_judge do
  219.       begin
  220.       if active<>true then open;
  221.         begin
  222.     Memo2.Text:=DataModule4.Table_judge.FieldByName('tigan').AsString+sLineBreak+DataModule4.Table_judge.FieldByName('answer').AsString;
  223.     choosedtno:=DataModule4.Table_judge.fieldbyname('tno').AsInteger;
  224.     end;
  225.      end;
  226.      end;
  227.    end;
  228. end;
  229. procedure Tchoosepaperform.DBNavigator3Click(Sender: TObject; Button: TNavigateBtn);
  230. begin
  231.     case button of
  232.     nbFirst:
  233.     begin
  234.       with DataModule4.Table_filltext do
  235.       begin
  236.       if active<>true then open;
  237.        begin
  238.       Memo3.Text:=DataModule4.Table_filltext.FieldByName('tigan').AsString;
  239.        choosedtno:=DataModule4.Table_filltext.fieldbyname('tno').AsInteger;
  240.      end;
  241.      end;
  242.      end;
  243.    end;
  244.    case button of
  245.     nbLast:
  246.     begin
  247.       with DataModule4.Table_filltext do
  248.       begin
  249.       if active<>true then open;
  250.        begin
  251.      Memo3.Text:=DataModule4.Table_filltext.FieldByName('tigan').AsString;
  252.        choosedtno:=DataModule4.Table_filltext.fieldbyname('tno').AsInteger;
  253.        end;
  254.      end;
  255.      end;
  256.    end;
  257.    case button of
  258.     nbNext:
  259.     begin
  260.       with DataModule4.Table_filltext do
  261.       begin
  262.       if active<>true then open;
  263.        begin
  264.     Memo3.Text:=DataModule4.Table_filltext.FieldByName('tigan').AsString;
  265.      choosedtno:=DataModule4.Table_filltext.fieldbyname('tno').AsInteger;
  266.      end;
  267.      end;
  268.      end;
  269.    end;
  270.     case button of
  271.     nbPrior:
  272.     begin
  273.       with DataModule4.Table_filltext do
  274.       begin
  275.       if active<>true then open;
  276.        begin
  277.     Memo3.Text:=DataModule4.Table_filltext.FieldByName('tigan').AsString;
  278.      choosedtno:=DataModule4.Table_filltext.fieldbyname('tno').AsInteger;
  279.      end;
  280.      end;
  281.      end;
  282.    end;
  283. end;
  284. procedure Tchoosepaperform.DBNavigator4Click(Sender: TObject; Button: TNavigateBtn);
  285. begin
  286.     case button of
  287.     nbFirst:
  288.     begin
  289.       with DataModule4.Table_readpro do
  290.       begin
  291.       if active<>true then open;
  292.        begin
  293.       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;
  294.       choosedtno:=DataModule4.Table_readpro.fieldbyname('tno').AsInteger;
  295.       end;
  296.      end;
  297.      end;
  298.    end;
  299.    case button of
  300.     nbLast:
  301.     begin
  302.       with DataModule4.Table_readpro do
  303.       begin
  304.       if active<>true then open;
  305.        begin
  306.       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;
  307.        choosedtno:=DataModule4.Table_readpro.fieldbyname('tno').AsInteger;
  308.        end;
  309.      end;
  310.      end;
  311.    end;
  312.    case button of
  313.     nbNext:
  314.     begin
  315.       with DataModule4.Table_readpro do
  316.       begin
  317.       if active<>true then open;
  318.      begin
  319.     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;
  320.      choosedtno:=DataModule4.Table_readpro.fieldbyname('tno').AsInteger;
  321.      end;
  322.      end;
  323.      end;
  324.    end;
  325.     case button of
  326.     nbPrior:
  327.     begin
  328.       with DataModule4.Table_readpro do
  329.       begin
  330.       if active<>true then open;
  331.      begin
  332.     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;
  333.     choosedtno:=DataModule4.Table_readpro.fieldbyname('tno').AsInteger;
  334.     end;
  335.      end;
  336.      end;
  337.    end;
  338. end;
  339. procedure Tchoosepaperform.DBNavigator5Click(Sender: TObject; Button: TNavigateBtn);
  340. begin
  341.     case button of
  342.     nbFirst:
  343.     begin
  344.       with DataModule4.Table_procedure do
  345.       begin
  346.       if active<>true then open;
  347.        begin
  348.       Memo5.Text:=DataModule4.Table_procedure.FieldByName('tigan').AsString;
  349.        choosedtno:=DataModule4.Table_procedure.fieldbyname('tno').AsInteger;
  350.        end;
  351.      end;
  352.      end;
  353.    end;
  354.    case button of
  355.     nbLast:
  356.     begin
  357.       with DataModule4.Table_procedure do
  358.       begin
  359.       if active<>true then open;
  360.        begin
  361.       Memo5.Text:=DataModule4.Table_procedure.FieldByName('tigan').AsString;
  362.        choosedtno:=DataModule4.Table_procedure.fieldbyname('tno').AsInteger;
  363.        end;
  364.      end;
  365.      end;
  366.    end;
  367.    case button of
  368.     nbNext:
  369.     begin
  370.       with DataModule4.Table_procedure do
  371.       begin
  372.       if active<>true then open;
  373.         begin
  374.     Memo5.Text:=DataModule4.Table_procedure.FieldByName('tigan').AsString;
  375.      choosedtno:=DataModule4.Table_procedure.fieldbyname('tno').AsInteger;
  376.      end;
  377.      end;
  378.      end;
  379.    end;
  380.     case button of
  381.     nbPrior:
  382.     begin
  383.       with DataModule4.Table_procedure do
  384.       begin
  385.       if active<>true then open;
  386.     begin
  387.     Memo5.Text:=DataModule4.Table_procedure.FieldByName('tigan').AsString;
  388.      choosedtno:=DataModule4.Table_procedure.fieldbyname('tno').AsInteger;
  389.      end;
  390.      end;
  391.      end;
  392.    end;
  393. end;
  394. procedure Tchoosepaperform.TabSheet1Show(Sender: TObject);
  395. begin
  396. GroupBox1.Visible:=true;
  397. GroupBox2.Visible:=false;
  398. GroupBox3.Visible:=false;
  399. GroupBox4.Visible:=false;
  400. GroupBox5.Visible:=false;
  401. BitBtn1.Enabled:=true;
  402. BitBtn2.Enabled:=true;
  403. BitBtn4.Enabled:=false;
  404. BitBtn5.Enabled:=false;
  405. BitBtn6.Enabled:=false;
  406. BitBtn7.Enabled:=false;
  407. BitBtn8.Enabled:=false;
  408. BitBtn9.Enabled:=false;
  409. BitBtn10.Enabled:=false;
  410. BitBtn11.Enabled:=false;
  411. //showmessage(inttostr(Form10.choosenum));
  412. //Label1.Caption:='试卷共需要'+inttostr(Form10.choosenum)+'题.          ';
  413. with DataModule4.Table_choose do
  414.    begin
  415.    if active<>true then open;
  416.      first;
  417.    //  while  not eof do
  418.      begin
  419.      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;
  420.      choosedtno:=DataModule4.Table_choose.fieldbyname('tno').AsInteger;
  421.      tempstring:=Memo1.Text;
  422.    //   DBListBox3.Items.Append(fieldbyname('tigan').AsString);
  423.   //   Next;
  424.      end;
  425.   // end;
  426. end;
  427. end;
  428. procedure Tchoosepaperform.TabSheet2Show(Sender: TObject);
  429. begin
  430. GroupBox1.Visible:=false;
  431. GroupBox2.Visible:=true;
  432. GroupBox3.Visible:=false;
  433. GroupBox4.Visible:=false;
  434. GroupBox5.Visible:=false;
  435. BitBtn4.Enabled:=true;
  436. BitBtn5.Enabled:=true;
  437. BitBtn1.Enabled:=false;
  438. BitBtn2.Enabled:=false;
  439. BitBtn6.Enabled:=false;
  440. BitBtn7.Enabled:=false;
  441. BitBtn8.Enabled:=false;
  442. BitBtn9.Enabled:=false;
  443. BitBtn10.Enabled:=false;
  444. BitBtn11.Enabled:=false;
  445.     with DataModule4.Table_judge do
  446.    begin
  447.    if active<>true then open;
  448.      first;
  449.    //  while  not eof do
  450.      begin
  451.      Memo2.Text:=DataModule4.Table_judge.fieldbyname('tigan').AsString+sLineBreak+DataModule4.Table_judge.fieldbyname('answer').AsString;
  452.     choosedtno:=DataModule4.Table_judge.fieldbyname('tno').AsInteger;
  453.    //   DBListBox3.Items.Append(fieldbyname('tigan').AsString);
  454.   //   Next;
  455.      end;
  456.   // end;
  457. end;
  458. end;
  459. procedure Tchoosepaperform.TabSheet3Show(Sender: TObject);
  460. begin
  461. GroupBox1.Visible:=false;
  462. GroupBox2.Visible:=false;
  463. GroupBox3.Visible:=true;
  464. GroupBox4.Visible:=false;
  465. GroupBox5.Visible:=false;
  466. BitBtn6.Enabled:=true;
  467. BitBtn7.Enabled:=true;
  468. BitBtn4.Enabled:=false;
  469. BitBtn5.Enabled:=false;
  470. BitBtn1.Enabled:=false;
  471. BitBtn2.Enabled:=false;
  472. BitBtn8.Enabled:=false;
  473. BitBtn9.Enabled:=false;
  474. BitBtn10.Enabled:=false;
  475. BitBtn11.Enabled:=false;
  476.    with DataModule4.Table_filltext do
  477.    begin
  478.    if active<>true then open;
  479.      first;
  480.    //  while  not eof do
  481.      begin
  482.      Memo3.Text:=DataModule4.Table_filltext.FieldByName('tigan').AsString;
  483.       choosedtno:=DataModule4.Table_filltext.fieldbyname('tno').AsInteger;
  484.   //   Next;
  485.      end;
  486.  //  end;
  487. end;
  488. end;
  489. procedure Tchoosepaperform.TabSheet4Show(Sender: TObject);
  490. begin
  491. GroupBox1.Visible:=false;
  492. GroupBox2.Visible:=false;
  493. GroupBox3.Visible:=false;
  494. GroupBox4.Visible:=true;
  495. GroupBox5.Visible:=false;
  496. BitBtn8.Enabled:=true;
  497. BitBtn9.Enabled:=true;
  498. BitBtn4.Enabled:=false;
  499. BitBtn5.Enabled:=false;
  500. BitBtn6.Enabled:=false;
  501. BitBtn7.Enabled:=false;
  502. BitBtn1.Enabled:=false;
  503. BitBtn2.Enabled:=false;
  504. BitBtn10.Enabled:=false;
  505. BitBtn11.Enabled:=false;
  506.    with DataModule4.Table_readpro do
  507.    begin
  508.    if active<>true then open;
  509.      first;
  510.    //  while  not eof do
  511.      begin
  512.      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;
  513.        choosedtno:=DataModule4.Table_readpro.fieldbyname('tno').AsInteger;
  514.    //   DBListBox3.Items.Append(fieldbyname('tigan').AsString);
  515.   //   Next;
  516.      end;
  517.   // end;
  518. end;
  519. end;
  520. procedure Tchoosepaperform.TabSheet5Show(Sender: TObject);
  521. begin
  522. GroupBox1.Visible:=false;
  523. GroupBox2.Visible:=false;
  524. GroupBox3.Visible:=false;
  525. GroupBox4.Visible:=false;
  526. GroupBox5.Visible:=true;
  527. BitBtn10.Enabled:=true;
  528. BitBtn11.Enabled:=true;
  529. BitBtn4.Enabled:=false;
  530. BitBtn5.Enabled:=false;
  531. BitBtn6.Enabled:=false;
  532. BitBtn7.Enabled:=false;
  533. BitBtn8.Enabled:=false;
  534. BitBtn9.Enabled:=false;
  535. BitBtn1.Enabled:=false;
  536. BitBtn2.Enabled:=false;
  537. with DataModule4.Table_procedure do
  538.    begin
  539.    if active<>true then open;
  540.      first;
  541.    //  while  not eof do
  542.      begin
  543.      Memo5.Text:=DataModule4.Table_procedure.FieldByName('tigan').AsString;
  544.      choosedtno:=DataModule4.Table_procedure.fieldbyname('tno').AsInteger;
  545.      
  546.      end;
  547.   end;
  548. end;
  549. procedure Tchoosepaperform.BitBtn1Click(Sender: TObject);
  550. var
  551. i:integer;
  552. temp:boolean;
  553.  //j:string;
  554. begin
  555. temp:=true;
  556. //if (ListBox6.Items[i]=inttostr(choosedtno)) or(ListBox1.Items.Count=form10.choosenum) then
  557.          if ListBox1.Items.Count=definepaperform.choosenum then
  558.          begin
  559.         //choosefull:=true;
  560.          showmessage('选择题已选择完毕!');
  561.        temp:=false   ;
  562.       end
  563.       else
  564.       begin
  565.             
  566.       for i:=0 to ListBox6.Items.Count-1  do
  567.         if (strtoint(ListBox6.Items[i]) div 10)=(choosedtno div 10) then
  568.         begin
  569.        
  570.         showmessage('本知识点已选!');
  571.         temp:=false ;
  572.         end;
  573.       end;
  574.       if temp then
  575.       begin
  576.        ListBox1.Items.Append(inttostr(choosedtno));
  577.        ListBox6.Items.Append(inttostr(choosedtno));
  578.        Label2.Caption:='已选择 '+inttostr(ListBox1.Items.count)+'  题.          ';
  579.         Label3.Caption:='还剩余 '+inttostr(definepaperform.choosenum-ListBox1.Items.count)+'  题.          ';
  580.    //    showmessage(tempstring);
  581.     //   j:=inttostr(choosedtno);
  582.  //       with Query1 do
  583.    //   begin
  584.    //     close;
  585.    //     sql.Clear;
  586.     //    sql.Text:='insert into ti_choose_long(tno) values('''+j+''')' ;
  587.     //    prepare;
  588.     //    execsql;
  589.    //   end;
  590.            end;
  591.       DBNavigator1.BtnClick(nbNext);
  592. end;
  593. procedure Tchoosepaperform.BitBtn4Click(Sender: TObject);
  594. var
  595. i:integer;
  596. temp:boolean;
  597. begin
  598. temp:=true;
  599.     //   (strtoint(ListBox2.Items[i]) div 10)=(choosedtno div 10)
  600.    if ListBox2.Items.Count=definepaperform.judgenum then
  601.          begin
  602.          showmessage('判断题已选择完毕!');
  603.        //  judgefull:=true;
  604.        temp:=false   ;
  605.       end
  606.       else
  607.       begin
  608.              for i:=0 to ListBox6.Items.Count-1  do
  609.           if   (strtoint(ListBox6.Items[i]) div 10)=(choosedtno div 10)  then
  610.       //  if ListBox6.Items[i]=inttostr(choosedtno) then
  611.         begin
  612.         showmessage('本知识点已选!');
  613.         temp:=false   ;
  614.         end;
  615.       end;
  616.       if temp then
  617.       begin
  618.        ListBox2.Items.Append(inttostr(choosedtno));
  619.         ListBox6.Items.Append(inttostr(choosedtno));
  620.              Label5.Caption:='已选择 '+inttostr(ListBox2.Items.count)+'  题.          ';
  621.         Label6.Caption:='还剩余 '+inttostr(definepaperform.judgenum-ListBox2.Items.count)+'  题.          ';
  622.            end;
  623.   DBNavigator2.BtnClick(nbNext);
  624. end;
  625. procedure Tchoosepaperform.BitBtn6Click(Sender: TObject);
  626. var
  627. i:integer;
  628. temp:boolean;
  629. begin
  630. temp:=true;
  631.    if ListBox3.Items.Count=definepaperform.filltextnum then
  632.          begin
  633.          showmessage('填空题已选择完毕!');
  634.        //  filltextfull:=true;
  635.        temp:=false   ;
  636.       end
  637.       else
  638.       begin
  639.              for i:=0 to ListBox6.Items.Count-1  do
  640.            if   (strtoint(ListBox6.Items[i]) div 10)=(choosedtno div 10) then
  641.    //     if ListBox6.Items[i]=inttostr(choosedtno) then
  642.         begin
  643.         showmessage('本知识点已选!');
  644.         temp:=false   ;
  645.         end;
  646.       end;
  647.      if temp then
  648.      begin
  649.        ListBox3.Items.Append(inttostr(choosedtno));
  650.        ListBox6.Items.Append(inttostr(choosedtno));
  651.             Label8.Caption:='已选择 '+inttostr(ListBox3.Items.count)+'  题.          ';
  652.         Label9.Caption:='还剩余 '+inttostr(definepaperform.filltextnum-ListBox3.Items.count)+'  题.          ';
  653.           end;
  654.          DBNavigator3.BtnClick(nbNext);
  655. end;
  656. procedure Tchoosepaperform.BitBtn8Click(Sender: TObject);
  657. var
  658. i:integer;
  659. temp:boolean;
  660. begin
  661. temp:=true;
  662.    if ListBox4.Items.Count=definepaperform.readpronum then
  663.          begin
  664.          showmessage('程序阅读题已选择完毕!');
  665.       //   readprofull:=true;
  666.        temp:=false   ;
  667.       end
  668.       else
  669.       begin
  670.              for i:=0 to ListBox6.Items.Count-1  do
  671.            if   (strtoint(ListBox6.Items[i]) div 10)=(choosedtno div 10) then
  672.     //    if ListBox6.Items[i]=inttostr(choosedtno) then
  673.         begin
  674.         showmessage('本知识点已选!');
  675.         temp:=false   ;
  676.         end;
  677.       end;
  678.       if temp then
  679.       begin
  680.        ListBox4.Items.Append(inttostr(choosedtno));
  681.        ListBox6.Items.Append(inttostr(choosedtno));
  682.             Label11.Caption:='已选择 '+inttostr(ListBox4.Items.count)+'  题.          ';
  683.         Label12.Caption:='还剩余 '+inttostr(definepaperform.readpronum-ListBox4.Items.count)+'  题.          ';
  684.            end;
  685.     DBNavigator4.BtnClick(nbNext);
  686. end;
  687. procedure Tchoosepaperform.BitBtn10Click(Sender: TObject);
  688. var
  689. i:integer;
  690. temp:boolean;
  691. begin
  692. temp:=true;
  693.    if ListBox5.Items.Count=definepaperform.procedurenum then
  694.          begin
  695.          showmessage('编程题已选择完毕!');
  696.      //    procedurefull:=true;
  697.        temp:=false   ;
  698.       end
  699.       else
  700.       begin
  701.              for i:=0 to ListBox6.Items.Count-1  do
  702.            if   (strtoint(ListBox6.Items[i]) div 10)=(choosedtno div 10) then
  703.      //   if ListBox6.Items[i]=inttostr(choosedtno) then
  704.         begin
  705.         showmessage('本知识点已选!');
  706.         temp:=false   ;
  707.         end;
  708.       end;
  709.      if temp then
  710.      begin
  711.        ListBox5.Items.Append(inttostr(choosedtno));
  712.        ListBox6.Items.Append(inttostr(choosedtno));
  713.             Label14.Caption:='已选择 '+inttostr(ListBox5.Items.count)+'  题.          ';
  714.         Label15.Caption:='还剩余 '+inttostr(definepaperform.procedurenum-ListBox5.Items.count)+'  题.          ';
  715.   
  716.           end;
  717.     DBNavigator5.BtnClick(nbNext);
  718. end;
  719. procedure Tchoosepaperform.BitBtn2Click(Sender: TObject);
  720. var
  721. j,i:integer;
  722. begin
  723. for i:=ListBox1.Items.Count-1 downto 0 do
  724.  if ListBox1.Selected[i] then
  725.  begin
  726.  
  727.    for j:=ListBox6.Items.Count-1 downto 0 do
  728.    begin
  729.     if ListBox1.Items[i]=ListBox6.Items[j] then
  730.     begin
  731.     ListBox6.Items.Delete(j);
  732.   ListBox1.Items.Delete(i);
  733.   Label2.Caption:='已选择 '+inttostr(ListBox1.Items.count)+'  题.          ';
  734.         Label3.Caption:='还剩余 '+inttostr(definepaperform.choosenum-ListBox1.Items.count)+'  题.          ';
  735.       break;
  736.    end;
  737.          end;
  738. end;
  739. end;
  740. procedure Tchoosepaperform.BitBtn5Click(Sender: TObject);
  741. var
  742. j,i:integer;
  743. begin
  744. for i:=ListBox2.Items.Count-1 downto 0 do
  745.  if ListBox2.Selected[i] then
  746.  begin
  747.      for j:=ListBox6.Items.Count-1 downto 0 do
  748.    begin
  749.     if ListBox2.Items[i]=ListBox6.Items[j] then
  750.     begin
  751.     ListBox6.Items.Delete(j);
  752.   ListBox2.Items.Delete(i);
  753.    Label5.Caption:='已选择 '+inttostr(ListBox2.Items.count)+'  题.          ';
  754.         Label6.Caption:='还剩余 '+inttostr(definepaperform.judgenum-ListBox2.Items.count)+'  题.          ';
  755.       break;
  756.    end;
  757.          end;
  758. end;
  759. end;
  760. procedure Tchoosepaperform.BitBtn7Click(Sender: TObject);
  761. var
  762. j,i:integer;
  763. begin
  764. for i:=ListBox3.Items.Count-1 downto 0 do
  765.  if ListBox3.Selected[i] then
  766.  begin
  767. for j:=ListBox6.Items.Count-1 downto 0 do
  768.    begin
  769.     if ListBox3.Items[i]=ListBox6.Items[j] then
  770.     begin
  771.     ListBox6.Items.Delete(j);
  772.   ListBox3.Items.Delete(i);
  773.    Label8.Caption:='已选择 '+inttostr(ListBox3.Items.count)+'  题.          ';
  774.         Label9.Caption:='还剩余 '+inttostr(definepaperform.filltextnum-ListBox3.Items.count)+'  题.          ';
  775.       break;
  776.    end;
  777.      end;
  778. end;
  779. end;
  780. procedure Tchoosepaperform.BitBtn9Click(Sender: TObject);
  781. var
  782. j,i:integer;
  783. begin
  784. for i:=ListBox4.Items.Count-1 downto 0 do
  785.  if ListBox4.Selected[i] then
  786.  begin
  787.       for j:=ListBox6.Items.Count-1 downto 0 do
  788.    begin
  789.     if ListBox4.Items[i]=ListBox6.Items[j] then
  790.     begin
  791.     ListBox6.Items.Delete(j);
  792.   ListBox4.Items.Delete(i);
  793.    Label11.Caption:='已选择 '+inttostr(ListBox4.Items.count)+'  题.          ';
  794.         Label12.Caption:='还剩余 '+inttostr(definepaperform.readpronum-ListBox4.Items.count)+'  题.          ';
  795.       break;
  796.    end;
  797.          end;
  798. end;
  799. end;
  800. procedure Tchoosepaperform.BitBtn11Click(Sender: TObject);
  801. var
  802. j,i:integer;
  803. begin
  804. for i:=ListBox5.Items.Count-1 downto 0 do
  805.  if ListBox5.Selected[i] then
  806.  begin
  807.    for j:=ListBox6.Items.Count-1 downto 0 do
  808.    begin
  809.     if ListBox5.Items[i]=ListBox6.Items[j] then
  810.     begin
  811.     ListBox6.Items.Delete(j);
  812.   ListBox5.Items.Delete(i);
  813.    Label14.Caption:='已选择 '+inttostr(ListBox5.Items.count)+'  题.          ';
  814.         Label15.Caption:='还剩余 '+inttostr(definepaperform.procedurenum-ListBox5.Items.count)+'  题.          ';
  815.       break;
  816.    end;
  817.          end;
  818. end;
  819. end;
  820. procedure Tchoosepaperform.FormCreate(Sender: TObject);
  821. begin
  822. //choosefull:=false;
  823. //judgefull:=false;
  824. //filltextfull:=false;
  825. //readprofull:=false;
  826. //procedurefull:=false;
  827. PageControl1.ActivePage:=TabSheet1;
  828. GroupBox1.Visible:=true;
  829. BitBtn1.Enabled:=true;
  830. BitBtn2.Enabled:=true;
  831. end;
  832. procedure Tchoosepaperform.ListBox2Click(Sender: TObject);
  833. begin
  834. BitBtn4.Enabled:=true;
  835. BitBtn5.Enabled:=true;
  836. Memo2.Show;
  837. end;
  838. procedure Tchoosepaperform.ListBox1Click(Sender: TObject);
  839. //var
  840. //i:integer;
  841. begin
  842.  BitBtn1.Enabled:=true;
  843. BitBtn2.Enabled:=true;
  844. Memo1.Show;
  845. //for i:=ListBox1.Items.Count-1 downto 0 do
  846.  // begin
  847. //if ListBox1.Selected[i] then
  848.   // end;
  849. end;
  850. procedure Tchoosepaperform.ListBox3Click(Sender: TObject);
  851. begin
  852. BitBtn6.Enabled:=true;
  853. BitBtn7.Enabled:=true;
  854. Memo3.Show;
  855. end;
  856. procedure Tchoosepaperform.ListBox4Click(Sender: TObject);
  857. begin
  858. BitBtn8.Enabled:=true;
  859. BitBtn9.Enabled:=true;
  860. Memo4.Show;
  861. end;
  862. procedure Tchoosepaperform.ListBox5Click(Sender: TObject);
  863. begin
  864. BitBtn10.Enabled:=true;
  865. BitBtn11.Enabled:=true;
  866. Memo5.Show;
  867. end;
  868. procedure Tchoosepaperform.BitBtn12Click(Sender: TObject);
  869. var
  870.  p,i,j,k,n,m: integer;
  871. begin
  872.  p:=1;
  873. if ListBox1.Items.Count<definepaperform.choosenum then
  874. showmessage('选择题还未选择完毕!')
  875. else
  876.  if  ListBox2.Items.Count<definepaperform.judgenum then
  877.   showmessage('判断题还未选择完毕!')
  878. else
  879.    if  ListBox3.Items.Count<definepaperform.filltextnum then
  880.   showmessage('填空题还未选择完毕!')
  881.  else
  882.   if ListBox4.Items.Count<definepaperform.readpronum then
  883.   showmessage('程序阅读题还未选择完毕!')
  884.  else
  885.    if  ListBox5.Items.Count<definepaperform.procedurenum then
  886.   showmessage('编程题还未选择完毕!')
  887. else if (ListBox1.Items.Count=definepaperform.choosenum)and (ListBox2.Items.Count=definepaperform.judgenum)and(ListBox3.Items.Count=definepaperform.filltextnum)and(ListBox4.Items.Count=definepaperform.readpronum)and(ListBox5.Items.Count=definepaperform.procedurenum) then
  888.   begin
  889. papermadeform.show;
  890. papermadeform.Memo1.Text:='';
  891. papermadeform.Memo1.Text:='             '+definepaperform.DBEdit1.Text+'                   '+'总分:'+definepaperform.DBEdit2.Text+#13#10#13#10#13#10;
  892. papermadeform.Memo1.Text:=papermadeform.Memo1.Text+'学校__________班级__________姓名__________得分________'+#13#10#13#10;
  893. madeanswerform.Memo1.Text:='';
  894. madeanswerform.Memo1.Text:='             '+definepaperform.DBEdit1.Text+'答案'+#13#10#13#10;
  895. if definepaperform.DBEdit3.Text<>'0' then
  896. begin
  897. try
  898. i:=0;
  899.     papermadeform.Memo1.Text:=papermadeform.Memo1.Text+''+#13#10+tmno[p]+'选择题'+'(共'+definepaperform.DBEdit3.Text+'小题,每题'+definepaperform.DBEdit6.Text+'分,小计'+definepaperform.DBEdit9.Text+'分).'+#13#10+'';
  900.    madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+''+#13#10+tmno[p]+'选择题: '+#13#10+'';
  901.     p:=p+1;
  902.    while i<listbox1.Count do
  903. begin
  904.    query1.Close;
  905.    query1.SQL.Clear;
  906.    query1.SQL.Add('select tigan,xa,xb,xc,xd,answer from ti_choose where tno='''+listbox1.Items.Strings[i]+'''' );
  907.    query1.ExecSQL;
  908.    query1.Active:=true;
  909.      i:=i+1;
  910.   papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+inttostr(i)+'、'+query1.fieldbyname('tigan').AsString+' ';
  911.   papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('xa').AsString+' ';
  912.   papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('xb').AsString+' ';
  913.   papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('xc').AsString+' ';
  914.   papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('xd').AsString+' '+#13#10;
  915.  madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+inttostr(i)+'、'+query1.fieldbyname('answer').AsString+' '+#13#10+'';
  916. //   watchdaform.memo1.Text:=watchdaform.memo1.Text+'改正为:'+query1.fieldbyname('gz').AsString+' '+#13#10+'';
  917.  end;
  918.    //进入选择题的生成
  919.  //  Application.CreateForm(Tresultmadeform, resultmadeform);
  920.  //  resultmadeform.Show;
  921.  //   close;
  922. except
  923. end;
  924.   end;
  925.   if definepaperform.DBEdit4.Text<>'0' then
  926.   begin
  927. try
  928. j:=0;
  929.    papermadeform.Memo1.Text:=papermadeform.Memo1.Text+''+#13#10+tmno[p]+'判断题'+'(共'+definepaperform.DBEdit4.Text+'小题,每题'+definepaperform.DBEdit7.Text+'分,小计'+definepaperform.DBEdit10.Text+'分).'+#13#10+'';
  930.    
  931.   madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+''+#13#10+tmno[p]+'判断题: '+#13#10+'';
  932.    p:=p+1;
  933.   while j<listbox2.Count do
  934. begin
  935.    query1.Close;
  936.    query1.SQL.Clear;
  937.    query1.SQL.Add('select tigan,answer from ti_judge where tno='''+listbox2.Items.Strings[j]+'''' );
  938.    query1.ExecSQL;
  939.    query1.Active:=true;
  940.      j:=j+1;
  941.   papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+inttostr(j)+'、'+query1.fieldbyname('tigan').AsString+' ';
  942.  madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+inttostr(j)+'、'+query1.fieldbyname('answer').AsString+' '+#13#10+'';
  943. //   watchdaform.memo1.Text:=watchdaform.memo1.Text+'改正为:'+query1.fieldbyname('gz').AsString+' '+#13#10+'';
  944.  end;
  945.    //进入选择题的生成
  946.  //  Application.CreateForm(Tresultmadeform, resultmadeform);
  947.  //  resultmadeform.Show;
  948.  //   close;
  949. except
  950. end;
  951. end;
  952. if definepaperform.DBEdit12.Text<>'0' then
  953. begin
  954. try
  955. k:=0;
  956.    papermadeform.Memo1.Text:=papermadeform.Memo1.Text+''+#13#10#13#10+tmno[p]+'填空题'+'(共'+definepaperform.DBEdit12.Text+'小题,每题'+definepaperform.DBEdit13.Text+'分,小计'+definepaperform.DBEdit14.Text+'分).'+#13#10+'';
  957.   madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+''+#13#10+tmno[p]+'填空题: '+#13#10+'';
  958.       p:=p+1;
  959.   while k<listbox3.Count do
  960. begin
  961.    query1.Close;
  962.    query1.SQL.Clear;
  963.    query1.SQL.Add('select tigan,ka,kb,kc,kd from ti_filltext where tno='''+listbox3.Items.Strings[k]+'''' );
  964.    query1.ExecSQL;
  965.    query1.Active:=true;
  966.      k:=k+1;
  967.   papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+inttostr(k)+'、'+query1.fieldbyname('tigan').AsString+' '+#13#10;
  968.  madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+#13#10+inttostr(k)+'、'+query1.fieldbyname('ka').AsString+' '+#13;
  969.  if query1.fieldbyname('kb').AsString<>'' then
  970. madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+#10+'   '+query1.fieldbyname('kb').AsString+' '+#13;
  971.  if query1.fieldbyname('kc').AsString<>'' then
  972.  madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+#10+'   '+query1.fieldbyname('kc').AsString+' '+#13;
  973.  if query1.fieldbyname('kd').AsString<>'' then
  974.  madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+#10+'   '+query1.fieldbyname('kd').AsString+' '+#13;
  975. //   watchdaform.memo1.Text:=watchdaform.memo1.Text+'改正为:'+query1.fieldbyname('gz').AsString+' '+#13#10+'';
  976.  end;
  977.    //进入选择题的生成
  978.  //  Application.CreateForm(Tresultmadeform, resultmadeform);
  979.  //  resultmadeform.Show;
  980.  //   close;
  981. except
  982. end;
  983. end;
  984. if definepaperform.DBEdit5.Text<>'0' then
  985. begin
  986. try
  987. m:=0;
  988.    papermadeform.Memo1.Text:=papermadeform.Memo1.Text+''+#13#10+tmno[p]+'程序阅读题'+'(共'+definepaperform.DBEdit5.Text+'小题,每题'+definepaperform.DBEdit8.Text+'分,小计'+definepaperform.DBEdit11.Text+'分).'+#13#10+'';
  989.   madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+''+#13#10+tmno[p]+'程序阅读题:'+#13#10+'';
  990.     p:=p+1;
  991.   while m<listbox4.Count do
  992. begin
  993.    query1.Close;
  994.    query1.SQL.Clear;
  995.    query1.SQL.Add('select tigan,ctigan1,x1a,x1b,x1c,x1d,answer1,ctigan2,x2a,x2b,x2c,x2d,answer2,ctigan3,x3a,x3b,x3c,x3d,answer3 from ti_readpro where tno='''+listbox4.Items.Strings[m]+'''' );
  996.    query1.ExecSQL;
  997.    query1.Active:=true;
  998.      m:=m+1;
  999.   papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+inttostr(m)+'、'+query1.fieldbyname('tigan').AsString+' ';
  1000.   papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('ctigan1').AsString+' '+#13#10#13#10;
  1001.   papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('x1a').AsString+' ';
  1002.   papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('x1b').AsString+' ';
  1003.   papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('x1c').AsString+' ';
  1004.   papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('x1d').AsString+' '+#13#10;
  1005.   if query1.FieldByName('ctigan2').AsString<>'' then
  1006.   begin
  1007.   papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('ctigan2').AsString+' '+#13#10#13#10;
  1008.   papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('x2a').AsString+' ';
  1009.   papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('x2b').AsString+' ';
  1010.   papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('x2c').AsString+' ';
  1011.   papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('x2d').AsString+' '+#13#10;
  1012.   end;
  1013.   if query1.FieldByName('ctigan3').AsString<>'' then
  1014.   begin
  1015.   papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('ctigan3').AsString+' '+#13#10#13#10;
  1016.   papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('x3a').AsString+' ';
  1017.   papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('x3b').AsString+' ';
  1018.   papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('x3c').AsString+' ';
  1019.   papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('x3d').AsString+' '+#13#10;
  1020.    end;
  1021.   madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+#13#10+inttostr(m)+'、'+query1.fieldbyname('answer1').AsString+' '+#13;
  1022.  if  query1.fieldbyname('answer2').AsString<>'' then
  1023.  madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+#10+'   '+query1.fieldbyname('answer2').AsString+' '+#13;
  1024.  if  query1.fieldbyname('answer3').AsString<>'' then
  1025.  madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+#10+'   '+query1.fieldbyname('answer3').AsString+' '+#13;
  1026. //   watchdaform.memo1.Text:=watchdaform.memo1.Text+'改正为:'+query1.fieldbyname('gz').AsString+' '+#13#10+'';
  1027.  end;
  1028.    //进入选择题的生成
  1029.  //  Application.CreateForm(Tresultmadeform, resultmadeform);
  1030.  //  resultmadeform.Show;
  1031.  //   close;
  1032. except
  1033. end;
  1034. end;
  1035. if definepaperform.DBEdit15.Text<>'0' then
  1036. begin
  1037. try
  1038. n:=0;
  1039.    papermadeform.Memo1.Text:=papermadeform.Memo1.Text+''+#13#10+tmno[p]+'编程题'+'(共'+definepaperform.DBEdit15.Text+'小题,每题'+definepaperform.DBEdit16.Text+'分,小计'+definepaperform.DBEdit17.Text+'分).'+#13#10+'';
  1040.   madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+''+#13#10+tmno[p]+'编程题:'+#13#10+'';
  1041.      p:=p+1;
  1042.   while n<listbox5.Count do
  1043. begin
  1044.    query1.Close;
  1045.    query1.SQL.Clear;
  1046.    query1.SQL.Add('select tigan,answer from ti_procedure where tno='''+listbox5.Items.Strings[n]+'''' );
  1047.    query1.ExecSQL;
  1048.    query1.Active:=true;
  1049.      n:=n+1;
  1050.   papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+inttostr(n)+'、'+query1.fieldbyname('tigan').AsString+' '+#13#10#13#10#13#10#13#10#13#10#13#10#13#10#13#10#13#10#13#10#13#10#13#10#13#10#13#10#13#10#13#10;
  1051.  madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+inttostr(n)+'、'+query1.fieldbyname('answer').AsString+' '+#13#10+'';
  1052. //   watchdaform.memo1.Text:=watchdaform.memo1.Text+'改正为:'+query1.fieldbyname('gz').AsString+' '+#13#10+'';
  1053.  end;
  1054.    //进入选择题的生成
  1055.  //  Application.CreateForm(Tresultmadeform, resultmadeform);
  1056.  //  resultmadeform.Show;
  1057.  //   close;
  1058. except
  1059. end;
  1060.   end;
  1061.  end;
  1062.  //  query1.Active:=true;
  1063. end;
  1064. end.