作
删除
利用dw_1.getrow()得到当前选定的数据项,dw_1.deleterow数据窗口函数删除当前选定用户dw_1.update()更新数据
dw_1.deleterow(dw_1.getrow())
dw_1.update()
commit;
4试卷信息
控件
属性
值
Datawindow
Hscollbar
选中
Datawindow
H/Vscollbar
选中
Datawindow
H/Vscollbar
选中
Commandbutton返回
text
10
退出键
ifdw_1.ModifiedCount()>0then dw_1.update()
deletefrompaperwheredue1=0;
close(parent)
6试卷登记
退出键
ifdw_1.ModifiedCount()>0then dw_1.update()
close(parent)
N
Y
二统计分析
1查找学生
检索键
stringget_str
get_str=trim(sle_1.text)
ifsle_1.text=""then
return
endif
choosecasetab_1.selectedtab
case1
dw_1.dataObject="dw_find_stu_by_id"
dw_1.setTransObject(sqlca)
dw_1.retrieve(get_str)
case2
dw_1.dataObject="dw_find_stu_by_name"
dw_1.setTransObject(sqlca)
dw_1.retrieve(get_str)
endchoose
Y
N
N
Y
A按学生学号进行查询,基本表对应主键的均自动建立索引,所以不必另建索引。
B按学生姓名进行查询,窗口中列出该姓名所有记录。
2学生成绩统计和频数分布图
DataWindowChilddwc_score,dwc_absent,dwc_graph
dw_1.GetChild("dw_score",dwc_score)
//dw_1.GetChild("dw_absent",dwc_absent)
dw_1.GetChild("dw_graph1",dwc_graph)
ifvar_semester<>""then
//dw_1.dataObject="dw_score_statistics"
decimalthere_paper
SELECTtop1paper.due1
INTO:there_paper
FROMpaper
WHERE(paper.semester=:var_semester);
ifsqlca.sqlcode<>0then
messagebox("′í?ó","?ú?ù???¨μ?רòμ?ú???¨μ??§?ú2"′??úê?3/4í£?")
dwc_score.SetTransObject(SQLCA)
dwc_score.Retrieve("")
//dwc_absent.SetTransObject(SQLCA)
//dwc_absent.Retrieve("")
dwc_graph.SetTransObject(SQLCA)
dwc_graph.Retrieve("")
return
endif
dwc_score.SetTransObject(SQLCA)
dwc_score.Retrieve(var_semester)
//dwc_absent.SetTransObject(SQLCA)
//dwc_absent.Retrieve(var_semester)
dwc_graph.SetTransObject(SQLCA)
dwc_graph.Retrieve(var_semester,var_spec)
else
dwc_score.SetTransObject(SQLCA)
dwc_score.Retrieve("")
//dwc_absent.SetTransObject(SQLCA)
//dwc_absent.Retrieve("")
dwc_graph.SetTransObject(SQLCA)
dwc_graph.Retrieve("","")
endif
3成绩分析
SELECTspecialty.spec_name,
score.stu_id,
score.score1,
score.score2,
score.score3,
score.score4,
score.score5,
score.score6,
score.score7,
score.score8,
score.score9,
score.score10,
score.absent,
score.score1+score.score2+score.score3+score.score4+score.score5+score.score6+score.score7+score.score8+score.score9+score.score10ASSCORE_SUM
FROMscore,
specialty,
student
WHERE(specialty.spec_code=student.spec_code)and
(student.stu_id=score.stu_id)and
((score.semester=:var_semester))
ifvar_semester<>""then
decimalthere_paper[6,10]
SELECTtop1paper.due1,paper.due2,paper.due3,paper.due4,paper.due5,
paper.due6,paper.due7,paper.due8,paper.due9,paper.due10
INTO:there_paper[1,1],:there_paper[1,2],:there_paper[1,3],:there_paper[1,4],
:there_paper[1,5],:there_paper[1,6],:there_paper[1,7],:there_paper[1,8],
:there_paper[1,9],:there_paper[1,10]
FROMpaper
WHERE(paper.semester=:var_semester);
ifsqlca.sqlcode<>0then
messagebox("′í?ó","?ú?ù???¨μ?רòμ?ú???¨μ??§?ú2"′??úê?3/4í£?")
dwc_section1.SetTransObject(SQLCA)
dwc_section1.Retrieve()
//dwc_section2.SetTransObject(sqlca)
//dwc_section2.retrieve("","")
return
endif
intvar_questions=1//getquestinsnumbers
forvar_questions=1to10
ifthere_paper[1,var_questions]=0thenEXIT
next
var_questions-=1
//calculatedifficult
realtemp[2,10]
SELECTsum(casewhenpaper.due1=score.score1then1else0end),
sum(casewhenpaper.due2=score.score2then1else0end),
sum(casewhenpaper.due3=score.score3then1else0end),
sum(casewhenpaper.due4=score.score4then1else0end),
sum(casewhenpaper.due5=score.score5then1else0end),
sum(casewhenpaper.due6=score.score6then1else0end),
sum(casewhenpaper.due7=score.score7then1else0end),
sum(casewhenpaper.due8=score.score8then1else0end),
sum(casewhenpaper.due9=score.score9then1else0end),
sum(casewhenpaper.due10=score.score10then1else0end),
avg(score.score1),max(score.score1),
avg(score.score2),max(score.score2),
avg(score.score3),max(score.score3),
avg(score.score4),max(score.score4),
avg(score.score5),max(score.score5),
avg(score.score6),max(score.score6),
avg(score.score7),max(score.score7),
avg(score.score8),max(score.score8),
avg(score.score9),max(score.score9),
avg(score.score10),max(score.score10)
INTO:there_paper[2,1],:there_paper[2,2],:there_paper[2,3],:there_paper[2,4],
:there_paper[2,5],:there_paper[2,6],:there_paper[2,7],:there_paper[2,8],
:there_paper[2,9],:there_paper[2,10],
:temp[1,1],:temp[2,1],:temp[1,2],:temp[2,2],:temp[1,3],:temp[2,3],:temp[1,4],:temp[2,4],
:temp[1,5],:temp[2,5],:temp[1,6],:temp[2,6],:temp[1,7],:temp[2,7],:temp[1,8],:temp[2,8],
:temp[1,9],:temp[2,9],:temp[1,10],:temp[2,10]
FROMscore,
paper,
student
WHERE(score.semester=paper.semester)and
(paper.spec_code=student.spec_code)and
(score.stu_id=student.stu_id)and
((score.semester=:VAR_SEMESTER)AND
(score.absent=0)
);
intstu_nums
stu_nums=there_paper[2,var_questions+1]//thenumberofstudents
inti
fori=1tovar_questions
there_paper[2,i]=round(there_paper[2,1]/stu_nums,2)
next
iftemp[2,var_questions]=0then
there_paper[2,var_questions]=0
else
there_paper[2,var_questions]=round(temp[1,var_questions]/temp[2,var_questions],2)
endif
realdata_trans[8]
fori=1tovar_questions
choosecasethere_paper[2,i]
case0to0.30
data_trans[1]+=1
case0.31to0.50
data_trans[2]+=1
case0.51to0.70
data_trans[3]+=1
case0.71to1
上一篇:
pb学生学籍管理+论文(论文和程序)
下一篇:
餐饮管理系统