📄 系统程序文挡1.txt
字号:
xuanze.Visible :=false;
tiankong.Visible :=true;
kongshu1();
tino.Caption :='1';
tino1.Caption :='1';
end;
procedure TForm6.xzClick(Sender: TObject); // 进入选择题答题
begin
query1.Next ;
query1.Close;
query1.ParamByName('tixing').AsString :='选择题';
query1.Open;
xuanze.Visible :=true;
tiankong.Visible :=false;
tino.Caption :='1';
tino1.Caption :='1';
end;
procedure TForm6.ghClick(Sender: TObject); //用户更换试卷
begin
huanjuan.ExecSQL ;
form5.chuansong.SQL.Clear ;
if form5.banzidong.tag=0 then
begin
Form5.quanzidongClick(Sender);
query1.ParamByName('tixing').AsString :='选择题';
end
else
Form7.tjClick(Sender);
query1.Close;
if form5.banzidong.tag=1 then //正在半自动试卷模式
begin
if form7.isxuan.Checked =true then
query1.ParamByName('tixing').AsString :='选择题'
else
begin
query1.ParamByName('tixing').AsString :='填空';
end;
end;
query1.Open;
tino.Caption :='1';
tino1.Caption :='1';
xuanze.Visible :=true;
tiankong.Visible :=false;
if form5.banzidong.tag=1 then
begin
if form7.isxuan.Checked =false then
begin
xuanze.Visible :=false;
tiankong.Visible :=true;
end;
end;
end;
procedure TForm6.BitBtn7Click(Sender: TObject); //保存教师选定试卷并按照试卷号保存
begin
insqdsjk.SQL.Clear ;
insqdsjk.SQL.Add('select * from 确定试卷库 where 试卷号=:no1' );
insqdsjk.ParamByName('no1').AsString :=copy(juanno.Caption,9,length(juanno.Caption )-8);
insqdsjk.Open; //查看此试卷是否已经存在
if insqdsjk.IsEmpty then
begin
insqdsjk.SQL.Clear ;
insqdsjk.SQL.add('insert into 确定试卷库(题号,题型,所属课程) select 题号,题型,所属课程 from 考卷试题库');
insqdsjk.ExecSQL ; //插入试题信息
insqdsjk.SQL.Clear ;
if form7.tag=0 then
insqdsjk.SQL.Add('update 确定试卷库 set 本题型总分=50,所属课程=:ke,试卷号=:no where isnull(试卷号)')
else
insqdsjk.SQL.Add('update 确定试卷库 set 所属课程=:ke,试卷号=:no where isnull(试卷号)') ;
insqdsjk.ParamByName('no').AsString :=copy(juanno.Caption,9,length(juanno.Caption )-8) ;
insqdsjk.ParamByName('ke').AsString :=teacher.ke.Text ;
insqdsjk.ExecSQL ; //写入本题型分数
if form7.tag=1 then //半自动出题模式
begin
insqdsjk.SQL.Clear ;
insqdsjk.SQL.Add('update 确定试卷库 set 本题型总分=:fen where 题型=:tx and 试卷号=:no');
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;
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); //考生选择A并将考生答案写入库
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);//考生选择B并将考生答案写入库
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);//考生选择C并将考生答案写入库
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);//考生选择D并将考生答案写入库
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;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -