Unit13.pas
上传用户:szyozho
上传日期:2013-04-13
资源大小:3688k
文件大小:37k
- unit Unit13;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, Buttons, ComCtrls, ExtCtrls, DBCtrls, DB, DBTables,
- Mask;
- type
- Tchoosepaperform = class(TForm)
- Panel1: TPanel;
- BitBtn1: TBitBtn;
- BitBtn2: TBitBtn;
- PageControl1: TPageControl;
- TabSheet1: TTabSheet;
- DBNavigator1: TDBNavigator;
- Memo1: TMemo;
- TabSheet2: TTabSheet;
- Memo2: TMemo;
- TabSheet3: TTabSheet;
- Memo3: TMemo;
- TabSheet4: TTabSheet;
- Memo4: TMemo;
- TabSheet5: TTabSheet;
- Memo5: TMemo;
- DBNavigator2: TDBNavigator;
- DBNavigator3: TDBNavigator;
- DBNavigator4: TDBNavigator;
- DBNavigator5: TDBNavigator;
- BitBtn3: TBitBtn;
- ListBox1: TListBox;
- GroupBox1: TGroupBox;
- GroupBox2: TGroupBox;
- GroupBox3: TGroupBox;
- GroupBox4: TGroupBox;
- GroupBox5: TGroupBox;
- ListBox2: TListBox;
- ListBox3: TListBox;
- ListBox4: TListBox;
- ListBox5: TListBox;
- BitBtn4: TBitBtn;
- BitBtn6: TBitBtn;
- BitBtn8: TBitBtn;
- BitBtn10: TBitBtn;
- BitBtn5: TBitBtn;
- BitBtn7: TBitBtn;
- BitBtn9: TBitBtn;
- BitBtn11: TBitBtn;
- ListBox6: TListBox;
- BitBtn12: TBitBtn;
- Query1: TQuery;
- Label13: TLabel;
- Label14: TLabel;
- Label15: TLabel;
- Label10: TLabel;
- Label11: TLabel;
- Label12: TLabel;
- Label7: TLabel;
- Label8: TLabel;
- Label9: TLabel;
- Label4: TLabel;
- Label5: TLabel;
- Label6: TLabel;
- Label1: TLabel;
- Label2: TLabel;
- Label3: TLabel;
- DBEdit1: TDBEdit;
- DBEdit2: TDBEdit;
- DBEdit3: TDBEdit;
- DBEdit4: TDBEdit;
- DBEdit5: TDBEdit;
- // DBListBox1: TDBListBox;
- // DBListBox2: TDBListBox;
- // DBListBox3: TDBListBox;
- // DBListBox4: TDBListBox;
- // DBListBox5: TDBListBox;
- // procedure addtonewtimu;
- procedure DBNavigator1Click(Sender: TObject; Button: TNavigateBtn);
- procedure DBNavigator2Click(Sender: TObject; Button: TNavigateBtn);
- procedure DBNavigator3Click(Sender: TObject; Button: TNavigateBtn);
- procedure DBNavigator4Click(Sender: TObject; Button: TNavigateBtn);
- procedure DBNavigator5Click(Sender: TObject; Button: TNavigateBtn);
- procedure TabSheet1Show(Sender: TObject);
- procedure TabSheet2Show(Sender: TObject);
- procedure TabSheet3Show(Sender: TObject);
- procedure TabSheet4Show(Sender: TObject);
- procedure TabSheet5Show(Sender: TObject);
- procedure BitBtn1Click(Sender: TObject);
- procedure BitBtn4Click(Sender: TObject);
- procedure BitBtn6Click(Sender: TObject);
- procedure BitBtn8Click(Sender: TObject);
- procedure BitBtn10Click(Sender: TObject);
- procedure BitBtn2Click(Sender: TObject);
- procedure BitBtn5Click(Sender: TObject);
- procedure BitBtn7Click(Sender: TObject);
- procedure BitBtn9Click(Sender: TObject);
- procedure BitBtn11Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure ListBox2Click(Sender: TObject);
- procedure ListBox1Click(Sender: TObject);
- procedure ListBox3Click(Sender: TObject);
- procedure ListBox4Click(Sender: TObject);
- procedure ListBox5Click(Sender: TObject);
- procedure BitBtn12Click(Sender: TObject);
- // procedure BitBtn4Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- choosepaperform: Tchoosepaperform;
- choosedtno:integer;
- tempstring:string;
- tmno: array[1..5] of string=('一、','二、','三、','四、','五、');
- // choosefull,judgefull,filltextfull,readprofull,procedurefull:boolean;
- implementation
- uses Unit4, Unit10, Unit14, Unit17, Unit19;
- {$R *.dfm}
- procedure Tchoosepaperform.DBNavigator1Click(Sender: TObject; Button: TNavigateBtn);
- begin
- case button of
- nbFirst:
- begin
- with DataModule4.Table_choose do
- begin
- if active<>true then open;
- 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;
- end;
- end;
- end;
- end;
- case button of
- nbLast:
- begin
- with DataModule4.Table_choose do
- begin
- if active<>true then open;
- 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;
- end;
- end;
- end;
- end;
- case button of
- nbNext:
- begin
- with DataModule4.Table_choose do
- begin
- if active<>true then open;
- 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;
- end;
- end;
- end;
- end;
- case button of
- nbPrior:
- begin
- with DataModule4.Table_choose do
- begin
- if active<>true then open;
- 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;
- end;
- end;
- end;
- end;
- end;
- procedure Tchoosepaperform.DBNavigator2Click(Sender: TObject; Button: TNavigateBtn);
- begin
- case button of
- nbFirst:
- begin
- with DataModule4.Table_judge do
- begin
- if active<>true then open;
- begin
- Memo2.Text:=DataModule4.Table_judge.FieldByName('tigan').AsString+sLineBreak+DataModule4.Table_judge.FieldByName('answer').AsString;
- choosedtno:=DataModule4.Table_judge.fieldbyname('tno').AsInteger;
- end;
- end;
- end;
- end;
- case button of
- nbLast:
- begin
- with DataModule4.Table_judge do
- begin
- if active<>true then open;
- begin
- Memo2.Text:=DataModule4.Table_judge.FieldByName('tigan').AsString+sLineBreak+DataModule4.Table_judge.FieldByName('answer').AsString;
- choosedtno:=DataModule4.Table_judge.fieldbyname('tno').AsInteger;
- end;
- end;
- end;
- end;
- case button of
- nbNext:
- begin
- with DataModule4.Table_judge do
- begin
- if active<>true then open;
- begin
- Memo2.Text:=DataModule4.Table_judge.FieldByName('tigan').AsString+sLineBreak+DataModule4.Table_judge.FieldByName('answer').AsString;
- choosedtno:=DataModule4.Table_judge.fieldbyname('tno').AsInteger;
- end;
- end;
- end;
- end;
- case button of
- nbPrior:
- begin
- with DataModule4.Table_judge do
- begin
- if active<>true then open;
- begin
- Memo2.Text:=DataModule4.Table_judge.FieldByName('tigan').AsString+sLineBreak+DataModule4.Table_judge.FieldByName('answer').AsString;
- choosedtno:=DataModule4.Table_judge.fieldbyname('tno').AsInteger;
- end;
- end;
- end;
- end;
- end;
- procedure Tchoosepaperform.DBNavigator3Click(Sender: TObject; Button: TNavigateBtn);
- begin
- case button of
- nbFirst:
- begin
- with DataModule4.Table_filltext do
- begin
- if active<>true then open;
- begin
- Memo3.Text:=DataModule4.Table_filltext.FieldByName('tigan').AsString;
- choosedtno:=DataModule4.Table_filltext.fieldbyname('tno').AsInteger;
- end;
- end;
- end;
- end;
- case button of
- nbLast:
- begin
- with DataModule4.Table_filltext do
- begin
- if active<>true then open;
- begin
- Memo3.Text:=DataModule4.Table_filltext.FieldByName('tigan').AsString;
- choosedtno:=DataModule4.Table_filltext.fieldbyname('tno').AsInteger;
- end;
- end;
- end;
- end;
- case button of
- nbNext:
- begin
- with DataModule4.Table_filltext do
- begin
- if active<>true then open;
- begin
- Memo3.Text:=DataModule4.Table_filltext.FieldByName('tigan').AsString;
- choosedtno:=DataModule4.Table_filltext.fieldbyname('tno').AsInteger;
- end;
- end;
- end;
- end;
- case button of
- nbPrior:
- begin
- with DataModule4.Table_filltext do
- begin
- if active<>true then open;
- begin
- Memo3.Text:=DataModule4.Table_filltext.FieldByName('tigan').AsString;
- choosedtno:=DataModule4.Table_filltext.fieldbyname('tno').AsInteger;
- end;
- end;
- end;
- end;
- end;
- procedure Tchoosepaperform.DBNavigator4Click(Sender: TObject; Button: TNavigateBtn);
- begin
- case button of
- nbFirst:
- begin
- with DataModule4.Table_readpro do
- begin
- if active<>true then open;
- 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;
- end;
- end;
- end;
- end;
- case button of
- nbLast:
- begin
- with DataModule4.Table_readpro do
- begin
- if active<>true then open;
- 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;
- end;
- end;
- end;
- end;
- case button of
- nbNext:
- begin
- with DataModule4.Table_readpro do
- begin
- if active<>true then open;
- 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;
- end;
- end;
- end;
- end;
- case button of
- nbPrior:
- begin
- with DataModule4.Table_readpro do
- begin
- if active<>true then open;
- 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;
- end;
- end;
- end;
- end;
- end;
- procedure Tchoosepaperform.DBNavigator5Click(Sender: TObject; Button: TNavigateBtn);
- begin
- case button of
- nbFirst:
- 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
- nbLast:
- 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
- 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
-
- for j:=ListBox6.Items.Count-1 downto 0 do
- begin
- if ListBox1.Items[i]=ListBox6.Items[j] then
- begin
- ListBox6.Items.Delete(j);
- ListBox1.Items.Delete(i);
- Label2.Caption:='已选择 '+inttostr(ListBox1.Items.count)+' 题. ';
- Label3.Caption:='还剩余 '+inttostr(definepaperform.choosenum-ListBox1.Items.count)+' 题. ';
- break;
- end;
- end;
- end;
- end;
- procedure Tchoosepaperform.BitBtn5Click(Sender: TObject);
- var
- j,i:integer;
- begin
- for i:=ListBox2.Items.Count-1 downto 0 do
- if ListBox2.Selected[i] then
- begin
- for j:=ListBox6.Items.Count-1 downto 0 do
- begin
- if ListBox2.Items[i]=ListBox6.Items[j] then
- begin
- ListBox6.Items.Delete(j);
- ListBox2.Items.Delete(i);
- Label5.Caption:='已选择 '+inttostr(ListBox2.Items.count)+' 题. ';
- Label6.Caption:='还剩余 '+inttostr(definepaperform.judgenum-ListBox2.Items.count)+' 题. ';
- break;
- end;
- end;
- end;
- end;
- procedure Tchoosepaperform.BitBtn7Click(Sender: TObject);
- var
- j,i:integer;
- begin
- for i:=ListBox3.Items.Count-1 downto 0 do
- if ListBox3.Selected[i] then
- begin
- for j:=ListBox6.Items.Count-1 downto 0 do
- begin
- if ListBox3.Items[i]=ListBox6.Items[j] then
- begin
- ListBox6.Items.Delete(j);
- ListBox3.Items.Delete(i);
- Label8.Caption:='已选择 '+inttostr(ListBox3.Items.count)+' 题. ';
- Label9.Caption:='还剩余 '+inttostr(definepaperform.filltextnum-ListBox3.Items.count)+' 题. ';
- break;
- end;
- end;
- end;
- end;
- procedure Tchoosepaperform.BitBtn9Click(Sender: TObject);
- var
- j,i:integer;
- begin
- for i:=ListBox4.Items.Count-1 downto 0 do
- if ListBox4.Selected[i] then
- begin
- for j:=ListBox6.Items.Count-1 downto 0 do
- begin
- if ListBox4.Items[i]=ListBox6.Items[j] then
- begin
- ListBox6.Items.Delete(j);
- ListBox4.Items.Delete(i);
- Label11.Caption:='已选择 '+inttostr(ListBox4.Items.count)+' 题. ';
- Label12.Caption:='还剩余 '+inttostr(definepaperform.readpronum-ListBox4.Items.count)+' 题. ';
- break;
- end;
- end;
- end;
- end;
- procedure Tchoosepaperform.BitBtn11Click(Sender: TObject);
- var
- j,i:integer;
- begin
- for i:=ListBox5.Items.Count-1 downto 0 do
- if ListBox5.Selected[i] then
- begin
- for j:=ListBox6.Items.Count-1 downto 0 do
- begin
- if ListBox5.Items[i]=ListBox6.Items[j] then
- begin
- ListBox6.Items.Delete(j);
- ListBox5.Items.Delete(i);
- Label14.Caption:='已选择 '+inttostr(ListBox5.Items.count)+' 题. ';
- Label15.Caption:='还剩余 '+inttostr(definepaperform.procedurenum-ListBox5.Items.count)+' 题. ';
- break;
- end;
- end;
- end;
- end;
- procedure Tchoosepaperform.FormCreate(Sender: TObject);
- begin
- //choosefull:=false;
- //judgefull:=false;
- //filltextfull:=false;
- //readprofull:=false;
- //procedurefull:=false;
- PageControl1.ActivePage:=TabSheet1;
- GroupBox1.Visible:=true;
- BitBtn1.Enabled:=true;
- BitBtn2.Enabled:=true;
- end;
- procedure Tchoosepaperform.ListBox2Click(Sender: TObject);
- begin
- BitBtn4.Enabled:=true;
- BitBtn5.Enabled:=true;
- Memo2.Show;
- end;
- procedure Tchoosepaperform.ListBox1Click(Sender: TObject);
- //var
- //i:integer;
- begin
- BitBtn1.Enabled:=true;
- BitBtn2.Enabled:=true;
- Memo1.Show;
- //for i:=ListBox1.Items.Count-1 downto 0 do
- // begin
- //if ListBox1.Selected[i] then
- // end;
- end;
- procedure Tchoosepaperform.ListBox3Click(Sender: TObject);
- begin
- BitBtn6.Enabled:=true;
- BitBtn7.Enabled:=true;
- Memo3.Show;
- end;
- procedure Tchoosepaperform.ListBox4Click(Sender: TObject);
- begin
- BitBtn8.Enabled:=true;
- BitBtn9.Enabled:=true;
- Memo4.Show;
- end;
- procedure Tchoosepaperform.ListBox5Click(Sender: TObject);
- begin
- BitBtn10.Enabled:=true;
- BitBtn11.Enabled:=true;
- Memo5.Show;
- end;
- procedure Tchoosepaperform.BitBtn12Click(Sender: TObject);
- var
- p,i,j,k,n,m: integer;
- begin
- p:=1;
- if ListBox1.Items.Count<definepaperform.choosenum then
- showmessage('选择题还未选择完毕!')
- else
- if ListBox2.Items.Count<definepaperform.judgenum then
- showmessage('判断题还未选择完毕!')
- else
- if ListBox3.Items.Count<definepaperform.filltextnum then
- showmessage('填空题还未选择完毕!')
- else
- if ListBox4.Items.Count<definepaperform.readpronum then
- showmessage('程序阅读题还未选择完毕!')
- else
- if ListBox5.Items.Count<definepaperform.procedurenum then
- showmessage('编程题还未选择完毕!')
- 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
- begin
- papermadeform.show;
- papermadeform.Memo1.Text:='';
- papermadeform.Memo1.Text:=' '+definepaperform.DBEdit1.Text+' '+'总分:'+definepaperform.DBEdit2.Text+#13#10#13#10#13#10;
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+'学校__________班级__________姓名__________得分________'+#13#10#13#10;
- madeanswerform.Memo1.Text:='';
- madeanswerform.Memo1.Text:=' '+definepaperform.DBEdit1.Text+'答案'+#13#10#13#10;
- if definepaperform.DBEdit3.Text<>'0' then
- begin
- try
- i:=0;
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+''+#13#10+tmno[p]+'选择题'+'(共'+definepaperform.DBEdit3.Text+'小题,每题'+definepaperform.DBEdit6.Text+'分,小计'+definepaperform.DBEdit9.Text+'分).'+#13#10+'';
- madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+''+#13#10+tmno[p]+'选择题: '+#13#10+'';
- p:=p+1;
- while i<listbox1.Count do
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select tigan,xa,xb,xc,xd,answer from ti_choose where tno='''+listbox1.Items.Strings[i]+'''' );
- query1.ExecSQL;
- query1.Active:=true;
- i:=i+1;
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+inttostr(i)+'、'+query1.fieldbyname('tigan').AsString+' ';
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('xa').AsString+' ';
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('xb').AsString+' ';
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('xc').AsString+' ';
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('xd').AsString+' '+#13#10;
- madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+inttostr(i)+'、'+query1.fieldbyname('answer').AsString+' '+#13#10+'';
- // watchdaform.memo1.Text:=watchdaform.memo1.Text+'改正为:'+query1.fieldbyname('gz').AsString+' '+#13#10+'';
- end;
- //进入选择题的生成
- // Application.CreateForm(Tresultmadeform, resultmadeform);
- // resultmadeform.Show;
- // close;
- except
- end;
- end;
- if definepaperform.DBEdit4.Text<>'0' then
- begin
- try
- j:=0;
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+''+#13#10+tmno[p]+'判断题'+'(共'+definepaperform.DBEdit4.Text+'小题,每题'+definepaperform.DBEdit7.Text+'分,小计'+definepaperform.DBEdit10.Text+'分).'+#13#10+'';
-
- madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+''+#13#10+tmno[p]+'判断题: '+#13#10+'';
- p:=p+1;
- while j<listbox2.Count do
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select tigan,answer from ti_judge where tno='''+listbox2.Items.Strings[j]+'''' );
- query1.ExecSQL;
- query1.Active:=true;
- j:=j+1;
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+inttostr(j)+'、'+query1.fieldbyname('tigan').AsString+' ';
- madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+inttostr(j)+'、'+query1.fieldbyname('answer').AsString+' '+#13#10+'';
- // watchdaform.memo1.Text:=watchdaform.memo1.Text+'改正为:'+query1.fieldbyname('gz').AsString+' '+#13#10+'';
- end;
- //进入选择题的生成
- // Application.CreateForm(Tresultmadeform, resultmadeform);
- // resultmadeform.Show;
- // close;
- except
- end;
- end;
- if definepaperform.DBEdit12.Text<>'0' then
- begin
- try
- k:=0;
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+''+#13#10#13#10+tmno[p]+'填空题'+'(共'+definepaperform.DBEdit12.Text+'小题,每题'+definepaperform.DBEdit13.Text+'分,小计'+definepaperform.DBEdit14.Text+'分).'+#13#10+'';
- madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+''+#13#10+tmno[p]+'填空题: '+#13#10+'';
- p:=p+1;
- while k<listbox3.Count do
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select tigan,ka,kb,kc,kd from ti_filltext where tno='''+listbox3.Items.Strings[k]+'''' );
- query1.ExecSQL;
- query1.Active:=true;
- k:=k+1;
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+inttostr(k)+'、'+query1.fieldbyname('tigan').AsString+' '+#13#10;
- madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+#13#10+inttostr(k)+'、'+query1.fieldbyname('ka').AsString+' '+#13;
- if query1.fieldbyname('kb').AsString<>'' then
- madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+#10+' '+query1.fieldbyname('kb').AsString+' '+#13;
- if query1.fieldbyname('kc').AsString<>'' then
- madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+#10+' '+query1.fieldbyname('kc').AsString+' '+#13;
- if query1.fieldbyname('kd').AsString<>'' then
- madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+#10+' '+query1.fieldbyname('kd').AsString+' '+#13;
- // watchdaform.memo1.Text:=watchdaform.memo1.Text+'改正为:'+query1.fieldbyname('gz').AsString+' '+#13#10+'';
- end;
- //进入选择题的生成
- // Application.CreateForm(Tresultmadeform, resultmadeform);
- // resultmadeform.Show;
- // close;
- except
- end;
- end;
- if definepaperform.DBEdit5.Text<>'0' then
- begin
- try
- m:=0;
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+''+#13#10+tmno[p]+'程序阅读题'+'(共'+definepaperform.DBEdit5.Text+'小题,每题'+definepaperform.DBEdit8.Text+'分,小计'+definepaperform.DBEdit11.Text+'分).'+#13#10+'';
- madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+''+#13#10+tmno[p]+'程序阅读题:'+#13#10+'';
- p:=p+1;
- while m<listbox4.Count do
- begin
- query1.Close;
- query1.SQL.Clear;
- 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]+'''' );
- query1.ExecSQL;
- query1.Active:=true;
- m:=m+1;
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+inttostr(m)+'、'+query1.fieldbyname('tigan').AsString+' ';
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('ctigan1').AsString+' '+#13#10#13#10;
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('x1a').AsString+' ';
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('x1b').AsString+' ';
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('x1c').AsString+' ';
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('x1d').AsString+' '+#13#10;
- if query1.FieldByName('ctigan2').AsString<>'' then
- begin
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('ctigan2').AsString+' '+#13#10#13#10;
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('x2a').AsString+' ';
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('x2b').AsString+' ';
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('x2c').AsString+' ';
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('x2d').AsString+' '+#13#10;
- end;
- if query1.FieldByName('ctigan3').AsString<>'' then
- begin
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('ctigan3').AsString+' '+#13#10#13#10;
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('x3a').AsString+' ';
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('x3b').AsString+' ';
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('x3c').AsString+' ';
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+#13#10+query1.fieldbyname('x3d').AsString+' '+#13#10;
- end;
- madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+#13#10+inttostr(m)+'、'+query1.fieldbyname('answer1').AsString+' '+#13;
- if query1.fieldbyname('answer2').AsString<>'' then
- madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+#10+' '+query1.fieldbyname('answer2').AsString+' '+#13;
- if query1.fieldbyname('answer3').AsString<>'' then
- madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+#10+' '+query1.fieldbyname('answer3').AsString+' '+#13;
- // watchdaform.memo1.Text:=watchdaform.memo1.Text+'改正为:'+query1.fieldbyname('gz').AsString+' '+#13#10+'';
- end;
- //进入选择题的生成
- // Application.CreateForm(Tresultmadeform, resultmadeform);
- // resultmadeform.Show;
- // close;
- except
- end;
- end;
- if definepaperform.DBEdit15.Text<>'0' then
- begin
- try
- n:=0;
- papermadeform.Memo1.Text:=papermadeform.Memo1.Text+''+#13#10+tmno[p]+'编程题'+'(共'+definepaperform.DBEdit15.Text+'小题,每题'+definepaperform.DBEdit16.Text+'分,小计'+definepaperform.DBEdit17.Text+'分).'+#13#10+'';
- madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+''+#13#10+tmno[p]+'编程题:'+#13#10+'';
- p:=p+1;
- while n<listbox5.Count do
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select tigan,answer from ti_procedure where tno='''+listbox5.Items.Strings[n]+'''' );
- query1.ExecSQL;
- query1.Active:=true;
- n:=n+1;
- 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;
- madeanswerform.Memo1.Text:=madeanswerform.Memo1.Text+inttostr(n)+'、'+query1.fieldbyname('answer').AsString+' '+#13#10+'';
- // watchdaform.memo1.Text:=watchdaform.memo1.Text+'改正为:'+query1.fieldbyname('gz').AsString+' '+#13#10+'';
- end;
- //进入选择题的生成
- // Application.CreateForm(Tresultmadeform, resultmadeform);
- // resultmadeform.Show;
- // close;
- except
- end;
- end;
- end;
- // query1.Active:=true;
- end;
- end.