edit_id@p>
order by num asc
]]>
edit_id@p> and type_num=1) q_count1,
(select count(type_num) q_count
from et_exam_exampaper_and_editexampaper
inner join et_exam_editexampaper
on et_exam_exampaper_and_editexampaper.id = et_exam_editexampaper.edit_id
where <@p>edit_id@p> and type_num=2) q_count2,
(select count(type_num) q_count
from et_exam_exampaper_and_editexampaper
inner join et_exam_editexampaper
on et_exam_exampaper_and_editexampaper.id = et_exam_editexampaper.edit_id
where <@p>edit_id@p> and type_num=3) q_count3,
(select count(type_num) q_count
from et_exam_exampaper_and_editexampaper
inner join et_exam_editexampaper
on et_exam_exampaper_and_editexampaper.id = et_exam_editexampaper.edit_id
where <@p>edit_id@p> and type_num=4) q_count4,
(select count(type_num) q_count
from et_exam_exampaper_and_editexampaper
inner join et_exam_editexampaper
on et_exam_exampaper_and_editexampaper.id = et_exam_editexampaper.edit_id
where <@p>edit_id@p> and type_num=5) q_count5
]]>
id@p>) as edit_id,num,subject,type,type_num,ismust,score,optionA,optionB,optionC,optionD,optionE,optionF,isParagraph,answer
from et_exam_editexampaper
where <@p>edit_id@p>
]]>
categoryid@p> and type = '1') singlenumcheck,
(select count(*) from et_exam_question where <@p>categoryid@p> and type = '2') multiplenumcheck,
(select count(*) from et_exam_question where <@p>categoryid@p> and type = '3') judgementnumcheck,
(select count(*) from et_exam_question where <@p>categoryid@p> and type = '4') blanknumcheck,
(select count(*) from et_exam_question where <@p>categoryid@p> and type = '5') essaynumcheck
]]>
edit_id@p>
]]>
id@p>) as edit_id,subject,question_type,type,1 as ismust,optionA,optionB,optionC,optionD,optionE,optionF,0 as isParagraph,answer
from et_exam_question where <@p>categoryid@p>
and type = 1
<@p p=" and %s">card@p>
order by rand() limit <@p p=" ? ">singleNum@p>)
union
(select md5(uuid()) as id,(select id from et_exam_exampaper_and_editexampaper where <@p>id@p>) as edit_id,subject,question_type,type,1 as ismust,optionA,optionB,optionC,optionD,optionE,optionF,0 as isParagraph,answer
from et_exam_question where <@p>categoryid@p>
and type = 2
<@p p=" and %s">card@p>
order by rand() limit <@p p=" ? ">multipleNum@p>)
union
(select md5(uuid()) as id,(select id from et_exam_exampaper_and_editexampaper where <@p>id@p>) as edit_id,subject,question_type,type,1 as ismust,optionA,optionB,optionC,optionD,optionE,optionF,0 as isParagraph,answer
from et_exam_question where <@p>categoryid@p>
and type = 3
<@p p=" and %s">card@p>
order by rand() limit <@p p=" ? ">judgementNum@p>)
union
(select md5(uuid()) as id,(select id from et_exam_exampaper_and_editexampaper where <@p>id@p>) as edit_id,subject,question_type,type,1 as ismust,optionA,optionB,optionC,optionD,optionE,optionF,0 as isParagraph,answer
from et_exam_question where <@p>categoryid@p>
and type = 4
<@p p=" and %s">card@p>
order by rand() limit <@p p=" ? ">blankNum@p>)
union
(select md5(uuid()) as id,(select id from et_exam_exampaper_and_editexampaper where <@p>id@p>) as edit_id,subject,question_type,type,1 as ismust,optionA,optionB,optionC,optionD,optionE,optionF,0 as isParagraph,answer
from et_exam_question where <@p>categoryid@p>
and type = 5
<@p p=" and %s">card@p>
order by rand() limit <@p p=" ? ">essayNum@p>)
) a,(select @i:=0) z
]]>
id@p> order by type_num) j,
(select @i:=0) z
set a.num = j.i
where a.id=j.id and <@p p =" edit_id = ? ">id@p>
]]>
id@p>
]]>
edit_id@p>
]]>
edit_id@p>) as sum
from et_exam_editexampaper where
<@p>edit_id@p>
<@p p="and type_num in(%s)" f="?">type_num@p>
]]>
newnum@p>
where <@p>edit_id@p>
<@p p=" and %s">num@p>
]]>
num@p>
where <@p>id@p>
]]>
num@p>
where <@p>id@p>
]]>
edit_id@p>
]]>