📄 unit6.pas
字号:
insqdsjk.ParamByName('fen').AsString :=form7.xzf.Text;
insqdsjk.ParamByName('tx').AsString :='选择题';
insqdsjk.ParamByName('no').AsString :=copy(juanno.Caption,9,length(juanno.Caption )-8) ;
insqdsjk.ExecSQL ;
insqdsjk.ParamByName('fen').AsString :=form7.tzf.Text;
insqdsjk.ParamByName('tx').AsString :='填空';
insqdsjk.ParamByName('no').AsString :=copy(juanno.Caption,9,length(juanno.Caption )-8) ;
insqdsjk.ExecSQL ;
end;
if form7.tag=2 then
begin
insqdsjk.SQL.Clear ;
insqdsjk.SQL.Add('update 确定试卷库 set 本题型总分=:fen where 题型=:tx and 试卷号=:no');
insqdsjk.ParamByName('fen').AsString :=form8.xzf.Text;
insqdsjk.ParamByName('tx').AsString :='选择题';
insqdsjk.ParamByName('no').AsString :=copy(juanno.Caption,9,length(juanno.Caption )-8) ;
insqdsjk.ExecSQL ;
insqdsjk.ParamByName('fen').AsString :=form8.tzf.Text;
insqdsjk.ParamByName('tx').AsString :='填空';
insqdsjk.ParamByName('no').AsString :=copy(juanno.Caption,9,length(juanno.Caption )-8) ;
insqdsjk.ExecSQL ;
end;
end
else
begin
showmessage('对不起!试卷已保存!');
end;
showmessage('请记住提供您的试卷号!');
end;
procedure TForm6.N3Click(Sender: TObject);
begin
form1.Close;
end;
procedure TForm6.FormClose(Sender: TObject; var Action: TCloseAction);
begin
form1.close;
teacher.Close;
xuqiu.close;
xuanke.close;
form5.Close;
end;
procedure TForm6.N2Click(Sender: TObject);
begin
query1.Next ;
panduan.SQL.Clear ;
panduan.SQL.Add('update 考卷试题库 set 选项A='+''''+'?'+''''+' where 选项A='+''''+' '+'''');
panduan.ExecSQL ;
panduan.SQL.Clear ;
panduan.SQL.Add('update 考卷试题库 set 选项B='+''''+'?'+''''+' where 选项B='+''''+' '+'''');
panduan.ExecSQL ;
panduan.SQL.Clear ;
panduan.SQL.Add('update 考卷试题库 set 选项C='+''''+'?'+''''+' where 选项C='+''''+' '+'''');
panduan.ExecSQL ;
panduan.SQL.Clear ;
panduan.SQL.Add('update 考卷试题库 set 选项D='+''''+'?'+''''+' where 选项D='+''''+' '+'''');
panduan.ExecSQL ;
if strtoint(tino.Caption)<query1.RecordCount then
tino.Caption:= inttostr(strtoint( tino.Caption) +1);
if strtoint(tino1.Caption)<query1.RecordCount then
tino1.Caption:= inttostr(strtoint( tino1.Caption) +1);
pdzw.SQL.Clear ;
pdzw.SQL.Add('update 考卷试题库 set 是否正确='+''''+'是'+''''+' where 题型='+''''+'选择题'+''''+' and 正确答案=考生答案');
pdzw.ExecSQL ; //判定选择题正误
pdzw.SQL.Clear ;
if student.tk1.Text ='外语填空题库' then
begin
pdzw.SQL.Add('update (select * from 考卷试题库,外语填空题库');
pdzw.SQL.Add(' where 考卷试题库.题号=外语填空题库.题号 and (外语填空题库.空1=考卷试题库.选项A and 外语填空题库.空2=考卷试题库.选项B');
pdzw.SQL.Add(' and 外语填空题库.空3=考卷试题库.选项C and 外语填空题库.空4=考卷试题库.选项D) and 考卷试题库.题型='+''''+'填空'+''''+')'+' set 考卷试题库.是否正确='+''''+'是'+'''') ;
end
else
begin
pdzw.SQL.Add('update (select * from 考卷试题库,线性代数填空题库');
pdzw.SQL.Add(' where 考卷试题库.题号=线性代数填空题库.题号 and (线性代数填空题库.空1=考卷试题库.选项A and 线性代数填空题库.空2=考卷试题库.选项B');
pdzw.SQL.Add(' and 线性代数填空题库.空3=考卷试题库.选项C and 线性代数填空题库.空4=考卷试题库.选项D) and 考卷试题库.题型='+''''+'填空'+''''+')'+' set 考卷试题库.是否正确='+''''+'是'+'''') ;;
end;
pdzw.ExecSQL ;//判定填空题正误
form10.show;
end;
procedure TForm6.FormActivate(Sender: TObject);
begin
if form6.tag=1 then
begin
pdzw.SQL.Clear;
pdzw.SQL.Add('update 考卷试题库 set 选项A='+''''+' '+''''+',选项B='+''''+' '+''''+',选项C='+''''+' '+''''+',选项D='+''''+' '+''''+' where 题型='+''''+'填空'+'''');
pdzw.ExecSQL ;
end;
end;
procedure TForm6.Timer1Timer(Sender: TObject);
begin
if edit1.text<>'120' then
edit1.Text :=inttostr(strtoint(edit1.Text )+1);
if edit2.Text<>'1' then
edit2.Text :=inttostr(strtoint(edit2.Text )-1);
end;
procedure TForm6.N6Click(Sender: TObject);
begin
form13.show;
form13.SetFocus ;
end;
procedure TForm6.aClick(Sender: TObject);
begin
daan.ReadOnly :=false;
if a.Checked =true then
begin
daan.Text :='A';
b.Checked :=false;
c.Checked:=false;
d.Checked:=false;
updatedaan.SQL.Clear ;
updatedaan.SQL.Add('update 考卷试题库 set 考生答案='+''''+'A'+''''+' where 题号=:no');
updatedaan.ParamByName('no').AsString :=dbedit1.Text ;
updatedaan.ExecSQL ;
end;
daan.ReadOnly :=true;
end;
procedure TForm6.bClick(Sender: TObject);
begin
daan.ReadOnly :=false;
if b.Checked =true then
begin
daan.Text :='B';
a.Checked :=false;
c.Checked:=false;
d.Checked:=false;
updatedaan.SQL.Clear ;
updatedaan.SQL.Add('update 考卷试题库 set 考生答案='+''''+'B'+''''+' where 题号=:no');
updatedaan.ParamByName('no').AsString :=dbedit1.Text ;
updatedaan.ExecSQL ;
end;
daan.ReadOnly :=true;
end;
procedure TForm6.cClick(Sender: TObject);
begin
daan.ReadOnly :=false;
if c.checked=true then
begin
daan.Text :='C';
b.Checked :=false;
a.Checked:=false;
d.Checked:=false;
updatedaan.SQL.Clear ;
updatedaan.SQL.Add('update 考卷试题库 set 考生答案='+''''+'C'+''''+' where 题号=:no');
updatedaan.ParamByName('no').AsString :=dbedit1.Text ;
updatedaan.ExecSQL ;
end;
daan.ReadOnly :=true;
end;
procedure TForm6.dClick(Sender: TObject);
begin
daan.ReadOnly :=false;
if d.Checked =true then
begin
daan.Text :='D';
b.Checked :=false;
c.Checked:=false;
a.Checked:=false;
updatedaan.SQL.Clear ;
updatedaan.SQL.Add('update 考卷试题库 set 考生答案='+''''+'D'+''''+' where 题号=:no');
updatedaan.ParamByName('no').AsString :=dbedit1.Text ;
updatedaan.ExecSQL ;
end;
daan.ReadOnly :=true;
end;
procedure TForm6.xuanzeClick(Sender: TObject);
begin
Form6.nexttiClick(Sender);
end;
procedure TForm6.tiankongClick(Sender: TObject);
begin
Form6.BitBtn3Click(Sender);
end;
procedure TForm6.Button1Click(Sender: TObject);
begin
if strtoint(tinox.text)<=strtoint(shumu.Caption ) then
begin
tino.Caption :=tinox.Text ;
query1.Close;
query1.Open;
query1.MoveBy(strtoint(tinox.Text )-1);
updatedaan.SQL.Clear;
updatedaan.SQL.Add('select 考生答案 from 考卷试题库 where 题号=:no');
updatedaan.ParamByName('no').AsString :=dbedit1.Text ;
updatedaan.Open;
daan.Text :=updatedaan.Fields.Fields[0].AsString ;
end
else
showmessage('对不起!您要查找的试题不存在!');
end;
procedure TForm6.Button2Click(Sender: TObject);
begin
if strtoint(tinot.text)<=strtoint(shumu1.Caption ) then
begin
tino1.Caption :=tinot.Text ;
query1.Close;
query1.Open;
query1.MoveBy(strtoint(tinot.Text )-1);
huifu();
kongshu1();
end
else
showmessage('对不起!您要查找的试题不存在!');
end;
procedure TForm6.k1Click(Sender: TObject);
begin
k1.SelectAll ;
end;
procedure TForm6.k2Click(Sender: TObject);
begin
k2.SelectAll ;
end;
procedure TForm6.k3Click(Sender: TObject);
begin
k3.SelectAll ;
end;
procedure TForm6.k4Click(Sender: TObject);
begin
k4.SelectAll ;
end;
procedure TForm6.k1KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
Form6.BitBtn3Click(Sender);
end;
if key=#32 then
if form6.k2.Visible =true then
form6.k2.SetFocus ;
end;
procedure TForm6.k2KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
Form6.BitBtn3Click(Sender);
end;
if key=#32 then
if form6.k3.Visible =true then
form6.k3.SetFocus ;
end;
procedure TForm6.k3KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
Form6.BitBtn3Click(Sender);
end;
if key=#32 then
if form6.k4.Visible =true then
form6.k4.SetFocus ;
end;
procedure TForm6.k4KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
Form6.BitBtn3Click(Sender);
end;
if key=#32 then
if form6.k1.Visible =true then
form6.k1.SetFocus ;
end;
procedure TForm6.tinoxKeyPress(Sender: TObject; var Key: Char);
begin
//是否是有效字符
if not ((key>=#48) and (key<=#57) ) then
begin
showmessage('对不起!您输入了非法的字符!');
key:=#13;
tinox.Text:='';
end;
end;
procedure TForm6.tinotKeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
Form6.BitBtn3Click(Sender);
end;
//是否是有效字符
if not ((key>=#48) and (key<=#57) ) then
begin
showmessage('对不起!您输入了非法的字符!');
key:=#13;
tinot.Text:='';
end;
end;
procedure TForm6.N1Click(Sender: TObject);
begin
timer1.Enabled :=true;
xuanze.Visible :=true;
tiankong.Visible :=true;
end;
procedure TForm6.N5Click(Sender: TObject);
begin
form16.show;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -