영남 사전설문 => 강사설문 으로 변경 추가개발

This commit is contained in:
ljs0531 2025-01-24 06:11:26 +00:00
parent bf9fc91992
commit d5c0b04f89
19 changed files with 480 additions and 292 deletions

View File

@ -225,6 +225,8 @@ namespace NP.BO.Controllers
ModelState.Clear();
vm.CMRS = new CMRS() { cmno = vm.cmno, rstype = -1 };
vm.examsavable = "";
//설문 회차조건 추가
vm.CMInnings = Dao.Get<CMInning>("cm.cminnings", new System.Collections.Hashtable() { { "cmno", vm.cmno }, { "isscd", 0 } });
if (vm.intval > 0)
{
vm.CMRS = Dao.Get<CMRS>("cm.cmrss", new System.Collections.Hashtable() { { "rsno", vm.intval } }).First();

View File

@ -343,7 +343,14 @@ namespace NP.BO.Controllers
ht.Add("tmno", vm.stringval2);
ht.Add("cshape", vm.stringval3);
ht.Add("rstype", vm.stringval4);
ht.Add("cnamelike", vm.stringval5);
if (vm.searchtype == "teachername")
{
ht.Add("teachername", vm.stringval5); // 강사명 완전 일치 검색
}
else
{
ht.Add("cnamelike", vm.stringval5); // 강좌명 like 검색
}
vm.CMRSs = Dao.Get<CMRS>("lect.cmrss", ht);
vm.pagetotalcount = GetCount(vm.CMRSs.FirstOrDefault());
vm.Terms = Dao.Get<Term>("cm.term.ys", new System.Collections.Hashtable() { });
@ -372,7 +379,14 @@ namespace NP.BO.Controllers
row = new System.Web.UI.HtmlControls.HtmlTableRow();
hcell = new System.Web.UI.HtmlControls.HtmlTableCell();
hcell.ColSpan = ccnt + 6;
if (vm.CMRS.rstype == 1 && !string.IsNullOrEmpty(vm.CMRS.teachername))
{
hcell.InnerText = "● 설문종류/설문지 : " + string.Format("{0} ({1}) / {2}", vm.CMRS.rstypename, vm.CMRS.teachername, vm.CMRS.rscname);
}
else
{
hcell.InnerText = "● 설문종류/설문지 : " + string.Format("{0} / {1}", vm.CMRS.rstypename, vm.CMRS.rscname);
}
row.Cells.Add(hcell); table.Rows.Add(row);
row = new System.Web.UI.HtmlControls.HtmlTableRow();

View File

@ -105,7 +105,7 @@
<thead>
<tr>
<th>평가구분</th>
<th>회차</th>
@*<th>회차</th>*@
<th>평가명</th>
<th>참여조건</th>
<th>총점</th>
@ -117,9 +117,16 @@
{
<tr>
<td>@item.estkindname</td>
<td>@item.rno</td>
@*<td>@item.rno</td>*@
<td class="link"><a href="#" onclick="add(@item.gubun, @item.exno)">@item.exname</a></td>
@if (item.rstype == 1)
{
<td>@(item.iseq + "회차" + " (" + item.teachername + ")") </td>
}
else
{
<td>출석 @item.econdition 이상</td>
}
<td>@(item.estkind < 30 ? (item.tpoint.ToString() + "점") : "-")</td>
<td><a href="#" style="color: red;" onclick="del(@(item.estkind), @item.exno)">[삭제]</a></td>
</tr>

View File

@ -2,7 +2,7 @@
@{
if (Model.CMRS.rsno > 0)
{
ViewBag.PopupMenuName = "사설문수정";
ViewBag.PopupMenuName = "사설문수정";
if (Model.CMRS.rstype == 0)
{
ViewBag.PopupMenuName = "강의평가 수정";
@ -19,7 +19,7 @@
<div class="col-sm-8 col-md-10">
@if (Model.CMRS.rsno < 1)
{
@Html.Partial("./Partial/Radio", "0:강의평가;1:사설문", new ViewDataDictionary { { "special", "stringlist" }, { "name", "CMRS.rstype" }, { "checked", Model.CMRS.rstype } })
@Html.Partial("./Partial/Radio", "0:강의평가;1:사설문", new ViewDataDictionary { { "special", "stringlist" }, { "name", "CMRS.rstype" }, { "checked", Model.CMRS.rstype } })
}
else
{
@ -31,10 +31,17 @@ else
<label class="col-sm-4 col-md-2 control-label req">평가명</label>
<div class="col-sm-8 col-md-10">@Html.TextBoxFor(m => m.CMRS.rsname, new { @class = "form-control", @maxlength = "100" })</div>
</div>
<div class="line line-dashed line-lg pull-in rstype1"></div><div class="form-group rstype1">
<div class="line line-dashed line-lg pull-in rstype0"></div><div class="form-group rstype0">
<label class="col-sm-4 col-md-2 control-label req">참여조건</label>
<div class="col-sm-8 col-md-10">출석률 @Html.TextBoxFor(m => m.CMRS.rscondition, new { @class = "form-control disp-init int nocomma text-center", @maxlength = "3", @style = "width: 80px;" }) % 이상</div>
</div>
@*25-01-20 추가개발 강사설문에 따른 회차키 cmino 추가*@
<div class="line line-dashed line-lg pull-in rstype1"></div><div class="form-group rstype1">
<label class="col-sm-4 col-md-2 control-label">회차조건</label>
<div class="col-sm-8 col-md-10">
@Html.Partial("./Partial/Select", Model.CMInnings, new ViewDataDictionary { { "name", "CMRS.cmino" }, { "selected", Model.CMRS.cmino }, { "df", ":선택" }, { "valuetext", string.Join(";", Model.CMInnings.Select(i => string.Format("{0}:({1} / {2}) {3}", i.cmino, i.iseq, i.username, i.ititle))) } })
</div>
</div>
<div class="line line-dashed line-lg pull-in"></div><div class="form-group">
<label class="col-sm-4 col-md-2 control-label">설문지선택</label>
<div class="col-sm-8 col-md-10">
@ -55,10 +62,12 @@ else
<div>
<div class="text-center">
<a href="#" class="btn btn-primary" onclick="save();">저장</a>
@*
이미 삭제 기능이 존재하여 주석처리
@if (Model.CMRS.rsno > 0)
{
<a href="#" class="btn btn-danger" onclick="del();">삭제</a>
}
}*@
<a href="#" class="btn btn-default" onclick="goparent(val('IsSavedForParent') == '1');">닫기</a>
</div>
</div>
@ -81,15 +90,9 @@ else
var rscs = '@(Model.CMRS.rsno > 0 ? "" : string.Join(";", Model.RSCs.Select(s=>string.Format("{0}:{1}:{2}", s.rstype, s.rscno, s.rscname.Replace(";", "|").Replace(":", "|")))))';
$(document).ready(function () {
focus("CMRS_rsname");
$(".rstype1").hide();
if ('@(Model.CMRS.rstype)' == '0') {
$(".rstype1").show();
}
toggleFields();
$("input[name='CMRS.rstype']").on("change", function () {
$(".rstype1").hide();
if ($("#CMRS_rstype0").prop("checked")) {
$(".rstype1").show();
}
toggleFields();
if ("@Model.CMRS.rsno" == '0') {
var v = $(this).val();
$("select#CMRS_rscno option:gt(0)").remove();
@ -101,11 +104,35 @@ else
}
});
});
@*강사설문 강의평가 라디오 버튼이 바뀔때 마다 조건 추가*@
function toggleFields() {
var rstype = $("input[name='CMRS.rstype']:checked").val();
if (rstype == '0') {
$(".rstype0").show();
$(".rstype1").hide();
} else if (rstype == '1') {
$(".rstype0").hide();
$(".rstype1").show();
} else {
$(".rstype0").hide();
$(".rstype1").hide();
}
@*수정일 때 조건*@
if (@Model.CMRS.rsno > 0 && @Model.CMRS.rstype == 0) {
$(".rstype0").show();
$(".rstype1").hide();
} else if (@Model.CMRS.rsno > 0 && @Model.CMRS.rstype == 1) {
$(".rstype0").hide();
$(".rstype1").show();
}
}
function save() {
if ('@(Model.CMRS.rsno)' == '0' && checkrv("CMRS.rstype", null, "평가구분을 선택해주세요.")) { }
else if (check("CMRS_rsname", null, "평가명을 입력해주세요.")) { }
else if (getDouble(val("CMRS_rscondition")) < 0 || getDouble(val("CMRS_rscondition")) > 100) {msg("출석률은 0 ~ 100 사이의 값을 입력해주세요.") }
else if ('@(Model.CMRS.rsno)' == '0' && check("CMRS_rscno", null, "설문지를 선택해주세요.")) { }
else if (check("CMRS_rscno", null, "설문지를 선택해주세요.")) { }
else if (confirm("저장하시겠습니까?")) {
capfileform("/acommon/cmrssave", "mform", "cbsave");
}
@ -123,11 +150,11 @@ else
msg("이미 등록된 평가구분입니다(평가구분 별 1회 등록 기준)");
}
}
function del() {
@*function del() {
if (confirm("삭제하시겠습니까?")) {
capp("/acommon/estdel", { extype: getrv("CMRS.rstype") == "0" ? 32:31, no: @Model.CMRS.rsno }, "cbdel");
}
}
}*@
function cbdel() {
if (capResult.code == 1000) {
msg("삭제했습니다.", null, true, null, true);

View File

@ -12,7 +12,7 @@
<div class="col-sm-8 col-md-10">
@if (Model.RSC.rscno < 1)
{
@Html.Partial("./Partial/Radio", "0:강의평가;1:사설문", new ViewDataDictionary { { "special", "stringlist" }, { "name", "RSC.rstype" }, { "checked", Model.RSC.rstype } })
@Html.Partial("./Partial/Radio", "0:강의평가;1:사설문", new ViewDataDictionary { { "special", "stringlist" }, { "name", "RSC.rstype" }, { "checked", Model.RSC.rstype } })
}
else
{

View File

@ -13,7 +13,7 @@
@Html.Partial("./Partial/SearchCaption")
<div class="step-content">
<div class="step-pane active form-inline" style="line-height: 5px;">
@Html.Partial("./Partial/Select", Model.CMs, new ViewDataDictionary { {"valuetext","0:강의평가;1:사설문" }, { "name", "stringval" }, { "selected", Model.stringval }, { "cssclass", "searchcon " }, { "df", ":-설문유형" } })
@Html.Partial("./Partial/Select", Model.CMs, new ViewDataDictionary { {"valuetext","0:강의평가;1:사설문" }, { "name", "stringval" }, { "selected", Model.stringval }, { "cssclass", "searchcon " }, { "df", ":-설문유형" } })
@Html.Partial("./Partial/Text", Model.stringval2, Helpers.DicText(new NP.Model.TextDic() { Name = "stringval2", Value = Model.stringval2, CssClass="ff", PH="설문명을 입력하세요." }))
@Html.Partial("./Partial/Button", new NP.Model.Button() { Special = "search" })
</div>

View File

@ -19,10 +19,11 @@
<option value="@t.tmno" @(Model.stringval2 == t.tmno.ToString() ? "selected" : "")>@t.tseq 기</option>
}
</select>
@*@Html.Partial("./Partial/Select", null, new ViewDataDictionary { { "valuetext", ":-유형선택;0:온라인;1:교육장;2:온라인 혼합" }, { "name", "stringval3" }, { "selected", Model.stringval3 } })*@
@Html.Partial("./Partial/Select", null, new ViewDataDictionary { { "valuetext", ":-유형선택;1:교육장교육;2:온라인교육" }, { "name", "stringval3" }, { "selected", Model.stringval3 } })
@Html.Partial("./Partial/Select", null, new ViewDataDictionary { { "valuetext", ":-유형선택;0:강의평가;1:사전설문" }, { "name", "stringval4" }, { "selected", Model.stringval4 } })
@Html.Partial("./Partial/Text", Model.stringval5, Helpers.DicText(new NP.Model.TextDic() { Name = "stringval5", Value = Model.stringval5, PH = "강좌명을 입력하세요.", CssClass = "ff" }))
@Html.Partial("./Partial/Select", null, new ViewDataDictionary { { "valuetext", ":-유형선택;0:강의평가;1:강사설문" }, { "name", "stringval4" }, { "selected", Model.stringval4 } })
@*강좌명(LIKE검색), 강사명(완전일치검색)*@
@Html.Partial("./Partial/Select", null, new ViewDataDictionary { { "valuetext", "cname:강좌명;teachername:강사명" }, { "name", "searchType" }, { "selected", Model.searchtype } })
@Html.Partial("./Partial/Text", Model.stringval5, Helpers.DicText(new NP.Model.TextDic() { Name = "stringval5", Value = Model.stringval5, PH = "검색어를 입력하세요.", CssClass = "ff" }))
@Html.Partial("./Partial/Button", new NP.Model.Button() { Special = "search" })
</div>
</div>
@ -42,6 +43,7 @@
<th>강좌명</th>
<th>교육기간</th>
<th>설문종류</th>
<th>강사명</th>
<th>설문인원<br />(참여/대상)</th>
</tr>
</thead>
@ -55,6 +57,7 @@
<td class="link"><a href="#" onclick="reg(@d.rsno)">@d.cnameclassno</a></td>
<td>@d.sssename2</td>
<td>@d.rstypename</td>
<td>@(string.IsNullOrEmpty(d.teachername) ? "-" : d.teachername)</td>
<td>@string.Format("{0}/{1}", d.countok.ToString("#,0"), d.countlect.ToString("#,0"))</td>
</tr>
}
@ -94,3 +97,4 @@
}
</script>
}

View File

@ -20,7 +20,17 @@
</div>
<div class="line line-dashed line-lg pull-in"></div><div class="form-group">
<label class="col-sm-4 col-md-2 control-label">설문종류/사용 설문지</label>
<div class="col-sm-8 col-md-10">@string.Format("{0} / {1}", Model.CMRS.rstypename, Model.CMRS.rscname)</div>
<div class="col-sm-8 col-md-10">
@*강사설문 일 때 강사 이름 추가*@
@if (Model.CMRS.rstype == 1 && !string.IsNullOrEmpty(Model.CMRS.teachername))
{
@: @string.Format("{0} ({1}) / {2}", Model.CMRS.rstypename, Model.CMRS.teachername, Model.CMRS.rscname)
}@*일반 강의 평가*@
else
{
@: @string.Format("{0} / {1}", Model.CMRS.rstypename, Model.CMRS.rscname)
}
</div>
</div>
</div>
</section>

View File

@ -508,7 +508,7 @@ namespace NP.Base.Controllers
return JsonOK(Dao.SaveExam(vm.CMEX), false);
}
/// <summary>
/// 가상번호 extype 1: 진행평가, 2: 최종평가, 11: 과제, 21: 토론, 31: 설문, 32: 강의평가
/// 가상번호 extype 1: 진행평가, 2: 최종평가, 11: 과제, 21: 토론, 31: 사설문, 32: 강의평가
/// </summary>
/// <param name="extype"></param>
/// <param name="no"></param>
@ -610,17 +610,26 @@ namespace NP.Base.Controllers
if (vm.CMRS.rstype == 1)
{
vm.CMRS.rscondition = 0;
}//강의평가일 때 cmino 저장 안함
else
{
vm.CMRS.cmino = 0;
}
//등록일 때
if (vm.CMRS.rsno < 1)
{
//설문(강의평가, 사전설문)은 1개씩만 등록가능
if (Dao.Get<int>("cm.cmrs.check", new Hashtable() { {"cmno",vm.CMRS.cmno }, { "rsno", vm.CMRS.rsno }, { "rstype", vm.CMRS.rstype } }).First() > 0)
//설문(강사설문) 일 때 복수 등록 가능
//설문(강의평가)은 1개씩만 등록가능
if (Dao.Get<int>("cm.cmrs.check", new Hashtable() { {"cmno",vm.CMRS.cmno }, { "rsno", vm.CMRS.rsno }, { "rstype", vm.CMRS.rstype } }).First() > 0 && vm.CMRS.rstype != 1)
{
return JsonOK(0);
}
Dao.Insert("cm.cmrs.in", vm.CMRS);
return JsonOK(vm.CMRS.rsno);
}
//수정일 때
if (base.RSSaveValid(vm.CMRS.rsno) == "")
{
return JsonOK(Dao.Save("cm.cmrs.up", vm.CMRS));

View File

@ -687,6 +687,7 @@
,null sdno,null sdtype,null sdname,null sddesc,null sdcondition
,null rsno,null rscno,null rstype,null rsname,null rscondition
, row_number() over(partition by a.extype order by a.cdt) rno
,null as iseq,null as teachername
from cmex a
where a.cmno=#cmno# and a.isdel=0
union all
@ -695,6 +696,7 @@
,a.sdno,a.sdtype,a.sdname,a.sddesc,a.sdcondition
,null rsno,null rscno,null rstype,null rsname,null rscondition
, row_number() over(partition by a.sdtype order by a.cdt) rno
,null as iseq,null as teachername
from cmsd a
where a.cmno=#cmno# and a.isdel=0
union all
@ -703,9 +705,12 @@
,null sdno,null sdtype,null sdname,null sddesc,null sdcondition
,a.rsno,a.rscno,a.rstype,a.rsname,a.rscondition
, row_number() over(partition by a.rstype order by a.cdt) rno
,b.iseq,c.username as teachername
from cmrs a
left outer join cminning b on a.cmino = b.cmino
left outer join users c on b.userno = c.userno
where a.cmno=#cmno# and a.isdel=0
order by estkind,rno
order by rsno<!--estkind,rno-->
</select>
<update id="cm.cmevsave" parameterClass="hashtable">
insert into cmev (cmno,attend,attendcut,attendrfd,attendcutrfd,mid,midcut,midrfd,midcutrfd,final,finalcut,finalrfd,finalcutrfd,subject,subjectcut,subjectrfd,subjectcutrfd,discuss,discusscut,discussrfd,discusscutrfd,etc,etccut,etcrfd,etccutrfd,cut,cutrfd,isoffabs,<include refid="sql.inc"></include>)
@ -1161,6 +1166,7 @@
,b.rscname
,row_number() over(order by <isNotNull property="orderby">$orderby$</isNotNull><isNull property="orderby">a.cdt</isNull>) rno
,count(a.cno) over() pagetotalcount
,a.cmino
from cmrs a
inner join rsc b on b.rscno=a.rscno
where a.isdel=0 <isNotNull property="rsno">and a.rsno=#rsno#</isNotNull>
@ -1169,8 +1175,8 @@
order by a.rno
</select>
<insert id="cm.cmrs.in" parameterClass="hashtable">
insert into cmrs(rstype,cmno,rsname,rscondition,rscno,isdel,<include refid="sql.inc"></include>)
values(#rstype#,#cmno#,#rsname#,#rscondition#,#rscno#,0,<include refid="sql.inv"></include>);
insert into cmrs(rstype,cmno,rsname,rscondition,rscno,isdel,cmino,<include refid="sql.inc"></include>)
values(#rstype#,#cmno#,#rsname#,#rscondition#,#rscno#,0,#cmino#,<include refid="sql.inv"></include>);
<selectKey type="post" property="rsno" resultClass="int">SELECT LAST_INSERT_ID()</selectKey>
</insert>
<update id="cm.cmrs.up" parameterClass="hashtable">
@ -1179,6 +1185,7 @@
,rsname =#rsname#
,rscondition =#rscondition#
,rscno =#rscno#
,cmino =#cmino#
where rsno=#rsno#
</update>
<update id="cm.cmrs.uplock" parameterClass="hashtable">
@ -1354,67 +1361,83 @@
<selectKey type="post" property="cmno" resultClass="int">SELECT LAST_INSERT_ID()</selectKey>
</insert>
<update id="cm.cmcopy" parameterClass="cm">
<!-- 임시 테이블 생성 -->
create temporary table if not exists temp_cminning_mapping (
old_cmino bigint,
new_cmino bigint
);
<!-- cminning 복제 및 매핑 정보 저장 -->
insert into cminning(cmno, week, iseq, isonline, ititle, icontent, iday, idate, ist, iet, ctno, istaste, sttime, atime, mstime, metime, userno, isscd, scdtype, <include refid="sql.inc"></include>)
select #cmno#, week, iseq, isonline, ititle, icontent, iday, idate, ist, iet, ctno, istaste, sttime, atime, mstime, metime, userno, isscd, scdtype, <include refid="sql.inv"></include>
from cminning
where cmno = #orgcmno#;
<selectKey type="post" property="cmino" resultClass="long">SELECT LAST_INSERT_ID()</selectKey>
insert into temp_cminning_mapping(old_cmino, new_cmino)
select old_cmino, new_cmino
from (
select a.cmino as old_cmino, b.cmino as new_cmino
from cminning a
inner join cminning b on a.cmno = #orgcmno# and b.cmno = #cmno# and a.week = b.week and a.iseq = b.iseq
) t;
<!-- cmrs 복제 -->
insert into cmrs(cmno, rscno, rstype, rsname, rscondition, isdel, cmino, <include refid="sql.inc"></include>)
select #cmno#, rscno, rstype, rsname, rscondition, 0, t.new_cmino, <include refid="sql.inv"></include>
from cmrs a
inner join temp_cminning_mapping t on a.cmino = t.old_cmino
where a.cmno = #orgcmno# and a.isdel = 0;
<!-- 나머지 테이블 복제 -->
insert into cmprof(cmno, userno, pfee, <include refid="sql.inc"></include>)
select #cmno#,a.userno,0,<include refid="sql.inv"></include>
from cmprof a
where a.cmno=#orgcmno#;
select #cmno#, userno, 0, <include refid="sql.inv"></include>
from cmprof
where cmno = #orgcmno#;
insert into cmbook(cmno, bkno, <include refid="sql.inc"></include>)
select #cmno#,a.bkno,<include refid="sql.inv"></include>
from cmbook a
where a.cmno=#orgcmno#;
select #cmno#, bkno, <include refid="sql.inv"></include>
from cmbook
where cmno = #orgcmno#;
insert into cmrelay(cmno, rcmno, ispre, <include refid="sql.inc"></include>)
select #cmno#,a.rcmno,a.ispre,<include refid="sql.inv"></include>
from cmrelay a
where a.cmno=#orgcmno#;
select #cmno#, rcmno, ispre, <include refid="sql.inv"></include>
from cmrelay
where cmno = #orgcmno#;
insert into cmncsd(cmno, ndno, <include refid="sql.inc"></include>)
select #cmno#,a.ndno,<include refid="sql.inv"></include>
from cmncsd a
where a.cmno=#orgcmno#;
insert into cminning(cmno,week,iseq,isonline,ititle,icontent,iday,idate,ist,iet,ctno,istaste,sttime,atime,mstime,metime,userno,orgcmino,isscd,<include refid="sql.inc"></include>)
select #cmno#,a.week,a.iseq,a.isonline,a.ititle,a.icontent,a.iday
,case when a.isonline=1 or b.sstime is null or a.iday is null then null else date_add(b.sstime, interval (a.iday - 1) day) end
,a.ist,a.iet,a.ctno,a.istaste,a.sttime,a.atime,a.mstime,a.metime,a.userno,cmino,a.isscd,<include refid="sql.inv"></include>
from cminning a
inner join cm b on b.cmno=#cmno#
where a.cmno=#orgcmno#;
select #cmno#, ndno, <include refid="sql.inv"></include>
from cmncsd
where cmno = #orgcmno#;
insert into cminningscd(cmino, estart, eend, quota, studyplace, sseq, <include refid="sql.inc"></include>)
select c.cmino,b.estart,b.eend,b.quota,b.studyplace,sseq,<include refid="sql.inv"></include>
from cminning a
inner join cminningscd b on b.cmino=a.cmino
inner join cminning c on c.cmno=#cmno# and c.isonline=0
where a.cmno=#orgcmno# and a.isonline=0;
select t.new_cmino, estart, eend, quota, studyplace, sseq, <include refid="sql.inv"></include>
from cminningscd a
inner join temp_cminning_mapping t on a.cmino = t.old_cmino
where a.cmino in (select old_cmino from temp_cminning_mapping);
insert into cmev(cmno,attend,attendcut,attendrfd,attendcutrfd,mid,midcut,midrfd,midcutrfd,final,finalcut,finalrfd,finalcutrfd,subject,subjectcut,subjectrfd,subjectcutrfd
,discuss,discusscut,discussrfd,discusscutrfd,etc,etccut,etcrfd,etccutrfd,cut,cutrfd,isoffabs,<include refid="sql.inc"></include>)
select #cmno#,attend,attendcut,attendrfd,attendcutrfd,mid,midcut,midrfd,midcutrfd,final,finalcut,finalrfd,finalcutrfd,subject,subjectcut,subjectrfd,subjectcutrfd
,discuss,discusscut,discussrfd,discusscutrfd,etc,etccut,etcrfd,etccutrfd,cut,cutrfd,isoffabs,<include refid="sql.inv"></include>
from cmev a
where a.cmno=#orgcmno#;
insert into cmev(cmno, attend, attendcut, attendrfd, attendcutrfd, mid, midcut, midrfd, midcutrfd, final, finalcut, finalrfd, finalcutrfd, subject, subjectcut, subjectrfd, subjectcutrfd, discuss, discusscut, discussrfd, discusscutrfd, etc, etccut, etcrfd, etccutrfd, cut, cutrfd, isoffabs, <include refid="sql.inc"></include>)
select #cmno#, attend, attendcut, attendrfd, attendcutrfd, mid, midcut, midrfd, midcutrfd, final, finalcut, finalrfd, finalcutrfd, subject, subjectcut, subjectrfd, subjectcutrfd, discuss, discusscut, discussrfd, discusscutrfd, etc, etccut, etcrfd, etccutrfd, cut, cutrfd, isoffabs, <include refid="sql.inv"></include>
from cmev
where cmno = #orgcmno#;
insert into cmsd(sdtype, cmno, sdname, sddesc, tpoint, sdcondition, fgno, isdel, orgsdno, <include refid="sql.inc"></include>)
select sdtype, #cmno#, sdname, sddesc, tpoint, sdcondition, null, 0, sdno, <include refid="sql.inv"></include>
from cmsd a
where a.cmno=#orgcmno# and a.isdel=0;
insert into cmrs(cmno,rscno,rstype,rsname,rscondition,isdel,<include refid="sql.inc"></include>)
select #cmno#,rscno,rstype,rsname,rscondition,0,<include refid="sql.inv"></include>
from cmrs a
where a.cmno=#orgcmno# and a.isdel=0;
from cmsd
where cmno = #orgcmno# and isdel = 0;
insert into cmmenu(cmno, isplan, iscontent, isev, isrs, isgrade, <include refid="sql.inc"></include>)
select #cmno#, isplan, iscontent, isev, isrs, isgrade, <include refid="sql.inv"></include>
from cmmenu a
where a.cmno=#orgcmno#;
from cmmenu
where cmno = #orgcmno#;
insert into cmmenubm(cmno, bmno, <include refid="sql.inc"></include>)
select #cmno#,a.bmno,<include refid="sql.inv"></include>
from cmmenubm a
where a.cmno=#orgcmno#
select #cmno#, bmno, <include refid="sql.inv"></include>
from cmmenubm
where cmno = #orgcmno#;
<!-- 임시 테이블 삭제 -->
drop temporary table if exists temp_cminning_mapping;
</update>
<insert id="cm.cmcopy.ex0" parameterClass="cmex">
insert into cmex (cmno,extype,exname,edesc,etime,econdition,evtype,eqtype,israndq,israndqi,qcount,isblur,tpoint,relaylimit,isusebackup,isseq,isresultopen,isreexamable,isdel,<include refid="sql.inc"></include>)

View File

@ -390,20 +390,25 @@
,b.rsno,b.cmno,b.rscno,b.rstype,b.rsname,b.rscondition
,case when c.lectno is null then 0 else 1 end isrsok
,a.edate
,d.istatus,e.iseq
from lect a
inner join cmrs b on b.cmno=a.cmno and b.isdel=0
left outer join lectrs c on c.lectno=a.lectno and c.rsno=b.rsno
left outer join lectinning d on d.lectno=a.lectno and b.cmino = d.cmino
left outer join cminning e on b.cmino = e.cmino
where a.lectno=#lectno# and a.userno=#userno#
order by b.cdt
order by b.rsno
</select>
<select id="cr.mycmrsq" parameterClass="hashtable" resultClass="rscq">
select b.rscno,b.rscqno
,c.qno,c.atype,c.qtext,c.rightcount
,c.qno,c.atype,c.qtext,c.rightcount,a.username as teachername
from (
select distinct b.rscno
select distinct b.rscno,e.username
from lect a
inner join cmrs b on b.rsno=#rsno# and b.cmno=a.cmno and b.isdel=0
left outer join lectrs c on c.lectno=a.lectno and c.rsno=b.rsno
left outer join cminning d on b.cmino = d.cmino
left outer join users e on d.userno = e.userno
where a.lectno=#lectno# and a.userno=#userno# and c.lectno is null
) a
inner join rscq b on b.rscno=a.rscno

View File

@ -572,24 +572,29 @@
<include refid="sql.encourages"></include>
</select>
<select id="lect.cmrss" parameterClass="hashtable" resultClass="cmrs">
select a.*
from (
select a.*
,row_number() over(order by a.tyear desc,a.tseq,a.cname,a.classno ) rno
,row_number() over(order by a.rsno desc<!--a.tyear desc,a.tseq,a.cname,a.classno-->) rno
,count(a.cdt) over() pagetotalcount
from (
select d.rsno,b.cmno,a.tyear,a.tseq,c.cgname,b.cshape,b.cname,b.classno,b.sstime,b.setime,d.rstype
,count(distinct e.lectno) countlect,count(distinct f.lectno) countok,a.cdt
,count(distinct e.lectno) countlect,count(distinct f.lectno) countok,a.cdt,h.username as teachername
from term a
inner join cm b on b.ismaster=0 and b.tmno=a.tmno <isNotNull property="cshape">and b.cshape=#cshape#</isNotNull> <isNotNull property="cnamelike">and b.cname like concat('%',#cnamelike#,'%')</isNotNull>
inner join cg c on c.cgno=b.cgno
inner join cmrs d on d.cmno=b.cmno <isNotNull property="rstype">and d.rstype=#rstype#</isNotNull> and d.isdel=0
inner join lect e on e.cmno=d.cmno and e.status =1 and e.ischanged=0
left outer join lectrs f on f.lectno=e.lectno and f.rsno=d.rsno
left outer join cminning g on d.cmino = g.cmino
left outer join users h on h.userno = g.userno
<dynamic prepend="where">
<isNotNull property="tyear" prepend="and">a.tyear=#tyear#</isNotNull>
<isNotNull property="tmno" prepend="and">a.tmno=#tmno#</isNotNull>
<isNotNull property="teachername" prepend="and">h.username=#teachername#</isNotNull>
<!-- 강사명 검색 추가 -->
</dynamic>
group by d.rsno,b.cmno,a.tyear,a.tseq,c.cgname,b.cshape,b.cname,b.classno,b.sstime,b.setime,d.rstype
) a
@ -597,16 +602,20 @@
<include refid="sql.pagedynamic"></include>
order by a.rno
</select>
<select id="lect.cmrs" parameterClass="int" resultClass="cmrs">
select a.rsno,a.rstype,a2.rscno,a2.rscname,b.cshape,b.cname,b.classno,b.rstime,b.retime,b.sstime,b.setime
,c.tyear,c.tseq
,count(distinct d.lectno) countlect,count(distinct e.lectno) countok
,g.username as teachername
from cmrs a
inner join rsc a2 on a2.rscno=a.rscno
inner join cm b on b.cmno=a.cmno
inner join term c on c.tmno=b.tmno
inner join lect d on d.cmno=b.cmno and d.status=1 and d.ischanged=0
left outer join lectrs e on e.lectno=d.lectno and e.rsno=a.rsno
left outer join cminning f on a.cmino = f.cmino
left outer join users g on g.userno = f.userno
where a.rsno=#rsno#
group by a.rsno,a.rstype,a2.rscno,a2.rscname,b.cshape,b.cname,b.classno,b.rstime,b.retime,b.sstime,b.setime,c.tyear,c.tseq
</select>

View File

@ -80,6 +80,7 @@ namespace NP.FO.Controllers
{
vm.intval = Dao.Get<LectInning>("cr.lectinnings", new System.Collections.Hashtable() { /*{ "lectno", vm.croomlectno }*/ {"userno",SUserInfo.UserNo }, { "isfinishtoday", 1 } }).Count();
}
vm.CMRSes = Dao.Get<CMRS>("cr.mycmrs", new System.Collections.Hashtable() { { "lectno", vm.croomlectno }, { "userno", SUserInfo.UserNo } });
return CView();
}
public ActionResult Research()

View File

@ -7,7 +7,25 @@
{
isplay = Model.LectInnings.First().isplay > 0 ? true : false;
}
// 강사설문 진행 가능 여부
bool hasAvailableSurvey = Model.CMRSes.Any(d => d.istatus == 2 && d.isrsok == 0);
}
@*강사설문 진행 가능하면 실행*@
@if (hasAvailableSurvey)
{
<script>
$(document).ready(function () {
confirmtoggle(true, "진행 가능한 강사 설문이 있습니다.<br/>설문참여 메뉴로 이동하여 설문 진행하시겠습니까?", "goToSurvey");
});
function goToSurvey() {
location.href = "/CRoom/Research?croomlectno=@Model.croomlectno";
}
</script>
}
@*<div class="lrnSch">
<a href="#" onclick="showatt()">출결이력조회</a>
</div>*@

View File

@ -7,29 +7,49 @@
<tbody>
@if (Model.CMRSes.Count() > 0)
{
foreach (var d in Model.CMRSes)
{
<tr>
<th>
<h5><span>@d.rstypename</span></h5>
@if (d.rstype == 0)
{
<p>참여조건 : 진도율 @(d.rscondition)% 이상 / 수강 종료일 (@d.edate.ToShortDateString()) 이내</p>
}
else
{
<p>참여조건 : @(d.iseq)회차 출석완료</p>
}
</th>
<td>
@if (ViewBag.isres > 0)
{
<td><a href="#" data-rsno="@(d.attrate >= d.rscondition && d.isrsok == 0?d.rsno:0)" class="evaType@((d.rscondition > d.attrate) || (d.edate < DateTime.Now ) ? "01": d.isrsok == 1 ? "03" : "02")">@(d.rscondition > d.attrate ? "참여불가" : d.isrsok == 1 ? "참여완료" : "참여가능")</a></td>
if (d.rstype == 0)
{
<a href="#" data-rsno="@(d.attrate >= d.rscondition && d.isrsok == 0 ? d.rsno : 0)" class="evaType@((d.rscondition > d.attrate) || (d.edate < DateTime.Now) ? "01" : d.isrsok == 1 ? "03" : "02")">
@(d.rscondition > d.attrate ? "참여불가" : d.isrsok == 1 ? "참여완료" : "참여가능")
</a>
}
else
{
<td><a href="#" class="evaType01">참여불가</a></td>
<a href="#" data-rsno="@(d.istatus == 2 && d.isrsok == 0 ? d.rsno : 0)" class="evaType@((d.istatus != 2) ? "01" : d.isrsok == 1 ? "03" : "02")">
@(d.istatus == 2 && d.isrsok == 0 ? "참여가능" : d.isrsok == 1 ? "참여완료" : "참여불가")
</a>
}
}
else
{
<a href="#" class="evaType01">참여불가</a>
}
</td>
</tr>
}
}
else
{
<tr><th colspan="2" style="text-align: center; font-weight: normal; height: 100px;">- 등록된 설문이 없습니다.</th></tr>
<tr>
<th colspan="2" style="text-align: center; font-weight: normal; height: 100px;">- 등록된 설문이 없습니다.</th>
</tr>
}
</tbody>
</table>
@ -40,6 +60,7 @@
<div class="svyPopWrap" style="height: 100%; max-width: 800px;">
<div class="svyPopTitle"><h5>설문참여</h5><a href="#" onclick="$('#pop1').hide();$('html, body').removeClass('lock');"></a></div>
<div class="lctPopScroll">
<p id="teachername" style="padding-left: 30px; padding-top: 30px; font-weight: bold;"></p>
<div class="svyPopCont" id="rslist"><ul class="svyPopBtn" id="btnrscgobox"><li><a href="#" class="bk" onclick="save()">설문제출</a></li></ul></div>
</div>
</div>
@ -48,7 +69,9 @@
</div>
@section styles{
<style type="text/css">
ul.qis input{vertical-align: middle;}
ul.qis input {
vertical-align: middle;
}
</style>
}
@section scriptsHeader{
@ -69,6 +92,7 @@
function cbcmrsgo() {
var h = capResult.obj.q;
if (h.length > 0) {
$("#teachername").text("강사설문 : " + h[0].teachername); // 첫 번째 요소의 teachername 설정
$("#rslist dl").remove();
$.each(h, function (i, q) {
if (q.atype == 0) {

View File

@ -185,7 +185,7 @@
}
@if (Model.PayItemResults.Where(w => w.ptype2 == 0 || w.ptype2 == 4).Count() == 1 && Model.PayItemResults.Where(w => w.ptype2 == 0 || w.ptype2 == 4).First().status == 1 && Model.PayItemResults.Where(w => w.ptype2 == 0 || w.ptype2 == 4).First().rsno > 0)
{
<li><a href="/CRoom/Research?croomlectno=@Model.PayItemResults.Where(w => w.ptype2 == 0 || w.ptype2 == 4).First().lectno" class="bk">사설문</a></li>
<li><a href="/CRoom/Research?croomlectno=@Model.PayItemResults.Where(w => w.ptype2 == 0 || w.ptype2 == 4).First().lectno" class="bk">사설문</a></li>
}
</ul>
}

View File

@ -1956,14 +1956,14 @@ namespace NP.Model
/// </summary>
public int gubun { get; set; }
/// <summary>
/// 1: 진행평가, 2: 최종평가, 11: 과제평가, 21: 토론평가, 31: 설문, 32: 강의평가설문
/// 1: 진행평가, 2: 최종평가, 11: 과제평가, 21: 토론평가, 31: 사설문, 32: 강의평가설문
/// </summary>
public int estkind { get; set; }
public String estkindname
{
get
{
return estkind == 1 ? "진행평가" : estkind == 2 ? "최종평가" : estkind == 11 ? "과제" : estkind == 21 ? "토론" : estkind == 31 ? "설문" : estkind == 32 ? "강의평가설문" : "-";
return estkind == 1 ? "진행평가" : estkind == 2 ? "최종평가" : estkind == 11 ? "과제" : estkind == 21 ? "토론" : estkind == 31 ? "사설문" : estkind == 32 ? "강의평가설문" : "-";
}
}
/// <summary>
@ -2054,7 +2054,15 @@ namespace NP.Model
/// 순차풀이여부 0:비순차,1:순차
/// </summary>
public int isseq {get;set;}
/// <summary>
/// 설문유형 0:강의평가,1:강사설문 (cmrs.rstype)
/// </summary>
public int rstype { get; set; }
/// <summary>
/// 설문 회차 (cminning.iseq)
/// </summary>
public int iseq { get; set; }
public string teachername { get; set; }
}
/// <summary>
@ -2399,14 +2407,14 @@ namespace NP.Model
/// </summary>
public int rscno { get; set; }
/// <summary>
/// 설문유형 0:강의평가,1:설문
/// 설문유형 0:강의평가,1:사설문
/// </summary>
public int rstype{ get; set; }
public String rstypename
{
get
{
return rstype == 0 ? "강의평가" : rstype == 1 ? "설문" : "-";
return rstype == 0 ? "강의평가" : rstype == 1 ? "사설문" : "-";
}
}
/// <summary>
@ -2462,6 +2470,10 @@ namespace NP.Model
public String atext { get; set; }
public int acount { get; set; }
public int scount { get; set; }
/// <summary>
/// 강사 설문에 따른 강사 이름
/// </summary>
public string teachername { get; set; }
}
/// <summary>
@ -2508,7 +2520,7 @@ namespace NP.Model
}
/// <summary>
/// 강좌/과정 설문(강의평가,설문)
/// 강좌/과정 설문(강의평가,사설문)
/// </summary>
[Serializable]
public class CMRS : CMBase
@ -2527,14 +2539,14 @@ namespace NP.Model
public int rscno {get;set;}
public String rscname { get; set; }
/// <summary>
/// 평가구분 0:강의평가,1:설문
/// 평가구분 0:강의평가,1:사설문
/// </summary>
public int rstype {get;set;}
public String rstypename
{
get
{
return rstype == 0 ? "강의평가" : "설문";
return rstype == 0 ? "강의평가" : "사설문";
}
}
/// <summary>
@ -2549,6 +2561,23 @@ namespace NP.Model
public int isrsok { get; set; }
public DateTime sdate { get; set; }
public DateTime edate { get; set; }
/// <summary>
/// 강사선물 일 때 회차조건 추가(cminning.cmino)
/// </summary>
public Int64 cmino { get; set; }
/// <summary>
/// 강사이름(cminning.userno => users.username)
/// </summary>
public string teachername { get; set; }
/// <summary>
/// 회차의 출석조건(lectinning.istatus) (null:입력전,0:결석(온라인학습중),1:입실,2:출석)
/// </summary>
public int istatus { get; set; }
/// <summary>
/// 설문 회차 (cminning.iseq)
/// </summary>
public int iseq { get; set; }
}
[Serializable]

Binary file not shown.

View File

@ -0,0 +1,6 @@
ALTER TABLE cmrs
ADD COLUMN cmino BIGINT(20) NULL;
UPDATE rsc
SET rscname = '강사설문'
WHERE rstype = 1;