6731. 시험응시 조건 변경 lect.iscomplete = 1 평가버튼숨김

This commit is contained in:
iyak 2025-04-04 05:59:40 +00:00
parent c37fadd07a
commit 56ac69d2f2
4 changed files with 90 additions and 32 deletions

View File

@ -455,6 +455,7 @@
,null strval,0 intval10 ,null strval,0 intval10
,0 intval,0 intval2,0 intval3,0 intval4,0 intval5 ,0 intval,0 intval2,0 intval3,0 intval4,0 intval5
,0 intval6 ,0 intval6
,0 intval7
,0 rno ,0 rno
,null time ,null time
,null time2 ,null time2
@ -465,6 +466,7 @@
,null strval,0 intval10 ,null strval,0 intval10
,0 intval,0 intval2,0 intval3,0 intval4,a.attrate intval5 ,0 intval,0 intval2,0 intval3,0 intval4,a.attrate intval5
,0 intval6 ,0 intval6
,a.iscomplete intval7
,0 rno ,0 rno
,null time ,null time
,null time2 ,null time2
@ -473,13 +475,13 @@
<isNotNull property="exam"> <isNotNull property="exam">
union all union all
select b.extype dtype select b.extype dtype
,b.exname strval,b.exno intval10 ,b.exname strval,b.exno intval10
<!--,case when a2.sstime &lt; now() and a2.setime &gt; now() then a.attrate else -1 end intval,b.econdition intval2-->
,case when a.sdate &lt; now() and a.edate &gt; now() then a.attrate else -1 end intval,b.econdition intval2 ,case when a.sdate &lt; now() and a.edate &gt; now() then a.attrate else -1 end intval,b.econdition intval2
,case when c.eend is null then 0 else 1 end intval3 ,case when c.eend is null then 0 else 1 end intval3
,a.attrate intval5 ,a.attrate intval5
,null intval4 ,null intval4
,a2.studytime intval6 ,a2.studytime intval6
,a.iscomplete intval7
,row_number() over (partition by b.extype order by b.extype, b.cdt) rno ,row_number() over (partition by b.extype order by b.extype, b.cdt) rno
,a.edate time ,a.edate time
,a.sdate time2 ,a.sdate time2
@ -492,13 +494,13 @@
<isNotNull property="subject"> <isNotNull property="subject">
union all union all
select 2 dtype select 2 dtype
,b.sdname strval,b.sdno intval10 ,b.sdname strval,b.sdno intval10
<!--,case when a2.sstime &lt; now() and a2.setime &gt; now() then a.attrate else -1 end intval,b.sdcondition intval2-->
,case when a.sdate &lt; now() and a.edate &gt; now() then a.attrate else -1 end intval,b.sdcondition intval2 ,case when a.sdate &lt; now() and a.edate &gt; now() then a.attrate else -1 end intval,b.sdcondition intval2
,case when c.submittime is null then 0 else 1 end intval3 ,case when c.submittime is null then 0 else 1 end intval3
,case when c.checktime is null then 0 else 1 end intval4 ,case when c.checktime is null then 0 else 1 end intval4
,a.attrate intval5 ,a.attrate intval5
,a2.studytime intval6 ,a2.studytime intval6
,a.iscomplete intval7
,row_number() over (order by b.cdt) rno ,row_number() over (order by b.cdt) rno
,a.edate time ,a.edate time
,a.sdate time2 ,a.sdate time2
@ -511,13 +513,13 @@
<isNotNull property="discuss"> <isNotNull property="discuss">
union all union all
select 3 dtype select 3 dtype
,b.sdname strval,b.sdno intval10 ,b.sdname strval,b.sdno intval10
<!--,case when a2.sstime &lt; now() and a2.setime &gt; now() then a.attrate else -1 end intval,b.sdcondition intval2-->
,case when a.sdate &lt; now() and a.edate &gt; now() then a.attrate else -1 end intval,b.sdcondition intval2 ,case when a.sdate &lt; now() and a.edate &gt; now() then a.attrate else -1 end intval,b.sdcondition intval2
,case when count(d.bno) &gt; 0 then 1 else 0 end intval3 ,case when count(d.bno) &gt; 0 then 1 else 0 end intval3
,case when c.checktime is null then 0 else 1 end intval4 ,case when c.checktime is null then 0 else 1 end intval4
,a.attrate intval5 ,a.attrate intval5
,a2.studytime intval6 ,a2.studytime intval6
,a.iscomplete intval7
,row_number() over (order by b.cdt) rno ,row_number() over (order by b.cdt) rno
,a.edate time ,a.edate time
,a.sdate time2 ,a.sdate time2
@ -527,7 +529,7 @@
left outer join lectsd c on c.lectno=a.lectno and c.sdno=b.sdno left outer join lectsd c on c.lectno=a.lectno and c.sdno=b.sdno
left outer join lectsdboard d on d.lectno=a.lectno and d.sdno=b.sdno and d.isdel=0 left outer join lectsdboard d on d.lectno=a.lectno and d.sdno=b.sdno and d.isdel=0
where a.lectno=#lectno# and a.userno=#userno# where a.lectno=#lectno# and a.userno=#userno#
group by b.sdname,b.sdno,a2.sstime,a2.setime,a.attrate,b.sdcondition,c.checktime,b.cdt group by b.sdname,b.sdno,a2.sstime,a2.setime,a.attrate,a.iscomplete,b.sdcondition,c.checktime,b.cdt
</isNotNull> </isNotNull>
) a ) a
order by a.dtype,a.rno order by a.dtype,a.rno
@ -1881,6 +1883,7 @@
and l.userno = #userno# and l.userno = #userno#
and cmi.isscd = 1 and cmi.isscd = 1
and li.istatus = 2 and li.istatus = 2
AND IFNULL(l.iscomplete, 0) = 0
]]> ]]>
</select> </select>

View File

@ -503,6 +503,11 @@ namespace NP.FO.Controllers
return CView(vm); return CView(vm);
} }
/// <summary>
/// 강의실 > 시험응시 /과제제출 > 시험응시 페이지
/// </summary>
/// <param name="vm"></param>
/// <returns></returns>
public ActionResult EstimationExam(VMCRoom vm) public ActionResult EstimationExam(VMCRoom vm)
{ {
string ua = (Request?.UserAgent ?? "").ToLower(); string ua = (Request?.UserAgent ?? "").ToLower();

View File

@ -1,12 +1,18 @@
@model NP.Model.VMCRoom @model NP.Model.VMCRoom
@{ @{
/*
* -- Model.Datas의 Dtype
* -1 : lect만 쿼리하고 attrate만 intval5에 담아놓음
* 1 : 최종평가
* 2 : 과제
*/
// 1. 하단 문구에서 사용 // 1. 하단 문구에서 사용
// 1-1)최종평가 일때 cm.studytime 값 intval6 // 1-1)최종평가 일때 cm.studytime 값 intval6
int dType1CmStudyTime = Model.Datas int dType1CmStudyTime = Model.Datas
.Where(w => w.dtype == 1) .Where(w => w.dtype == 1)
.Select(s => s.intval6) .Select(s => s.intval6)
.SingleOrDefault(); .SingleOrDefault();
// 1-2)최종평가 일때 lect.sdate // 1-2)최종평가 일때 lect.sdate
DateTime dType1LectSDate = Model.Datas DateTime dType1LectSDate = Model.Datas
@ -14,24 +20,20 @@
.Select(s => s.time2) .Select(s => s.time2)
.SingleOrDefault(); .SingleOrDefault();
// 예외처리 과정코드들?
//List<long> allowLectNos = Array
// .ConvertAll("104069,102553,105325,104402,106226,62683,104419".Split(','), long.Parse)
// .ToList();
//ViewBag.exCheck = allowLectNos.IndexOf(Model.croomlectno) > -1 ? true : false;
// 현재 진도율 // 현재 진도율
int currentProgresRate = Model.Datas.Where(w => w.dtype == -1).FirstOrDefault().intval5; int currentProgresRate = Model.Datas.Where(w => w.dtype == -1).FirstOrDefault().intval5;
// 현재 과정 수료여부
int currentLectIsComplete = Model.Datas.Where(w => w.dtype == -1).FirstOrDefault().intval7;
// 시험응시가능여부 // 시험응시가능여부
bool isExCheck = ViewBag.exCheck != null ? (bool)ViewBag.exCheck : false; bool isExCheck = ViewBag.exCheck != null ? (bool)ViewBag.exCheck : false;
} }
<ul class="lctpTab col3"> <ul class="lctpTab col3">
<li class="@(Model.tabidx == 0 ? "current" : "")"><a onclick="gotab(0, this)" style="@(Model.tabidx == 0 ? "cursor: default;" : "")" href="#;">전체</a></li> <li class="@(Model.tabidx == 0 ? "current" : "")"><a onclick="gotab(0, this)" style="@(Model.tabidx == 0 ? "cursor: default;" : "")" href="javascript:;">전체</a></li>
<li class="@(Model.tabidx == 1 ? "current" : "")"><a onclick="gotab(1, this)" style="@(Model.tabidx == 1 ? "cursor: default;" : "")" href="#">시험</a></li> <li class="@(Model.tabidx == 1 ? "current" : "")"><a onclick="gotab(1, this)" style="@(Model.tabidx == 1 ? "cursor: default;" : "")" href="javascript:;">시험</a></li>
<li class="@(Model.tabidx == 2 ? "current" : "")"><a onclick="gotab(2, this)" style="@(Model.tabidx == 2 ? "cursor: default;" : "")" href="#">과제</a></li> <li class="@(Model.tabidx == 2 ? "current" : "")"><a onclick="gotab(2, this)" style="@(Model.tabidx == 2 ? "cursor: default;" : "")" href="javascript:;">과제</a></li>
</ul> </ul>
<div class="evaList"> <div class="evaList">
<input type="hidden" id="hdndType1StudyTime" value="@dType1CmStudyTime" /> <input type="hidden" id="hdndType1StudyTime" value="@dType1CmStudyTime" />
@ -103,7 +105,8 @@
<input type="hidden" name="lectEDate" value="@d.time" /> <input type="hidden" name="lectEDate" value="@d.time" />
<input type="hidden" name="isDateInRange" value="@IsDateInRange(d.time2, d.time).ToString()" /> <input type="hidden" name="isDateInRange" value="@IsDateInRange(d.time2, d.time).ToString()" />
<a href="javascript:;" onclick="eva(@d.dtype, @d.intval10, @(d.intval4 == 1 ? 4 : d.intval3 == 1 ? 3 : d.intval3 == 0 && d.intval >= d.intval2 ? 2 : 1))" <a href="javascript:;" onclick="eva(@d.dtype, @d.intval10, @(d.intval4 == 1 ? 4 : d.intval3 == 1 ? 3 : d.intval3 == 0 && d.intval >= d.intval2 ? 2 : 1))"
class="evaType@(d.intval4 == 1 ? "04" : d.intval3 == 1 ? "03" : d.intval3 == 0 && d.intval >= d.intval2 ? "02" : "01")">@(d.intval4 == 1 ? "[평가완료]" : d.intval3 == 1 ? "[참여완료]" : d.intval3 == 0 && d.intval >= d.intval2 ? "[참여가능]" : "[참여불가]")</a> class="@GetEvaTypeClass(d.intval, d.intval2, d.intval3, d.intval4, currentLectIsComplete)">@GetEvaStatusText(d.intval, d.intval2, d.intval3, d.intval4, currentLectIsComplete)
</a>
</td> </td>
} }
else else
@ -228,11 +231,12 @@
}); });
@*
/** /**
* 탭 변경 * 탭 변경
* @@param idx {int} - 탭번호 (0:전체, 1:평가, 2:과제) * @param idx {int} - 탭번호 (0:전체, 1:평가, 2:과제)
* @@param a {event} - e * @param a {event} - e
*/ */ *@
function gotab(idx, a) { function gotab(idx, a) {
if (!$(a).parent().hasClass("current")) { if (!$(a).parent().hasClass("current")) {
setv("tabidx", idx); setv("tabidx", idx);
@ -281,9 +285,56 @@
/// <param name="endDate">종료일</param> /// <param name="endDate">종료일</param>
/// <returns>true/false</returns> /// <returns>true/false</returns>
public bool IsDateInRange(DateTime startDate, DateTime endDate) public bool IsDateInRange(DateTime startDate, DateTime endDate)
{ {
// 현재일자가 시작일 이상 && 종료일 이하인지 확인 // 현재일자가 시작일 이상 && 종료일 이하인지 확인
return startDate <= DateTime.Now && DateTime.Now <= endDate; return startDate <= DateTime.Now && DateTime.Now <= endDate;
} }
/// <summary>
/// 평가 상태에 따른 css class를 반환
/// </summary>
/// <param name="intval">수강기간 내 출석률(없으면 -1)</param>
/// <param name="intval2">참여조건(출석률)</param>
/// <param name="intval3">평가종료여부(0:종료일자없음, 1:종료)</param>
/// <param name="intval4">시험일때는 null 과제일때는 (0:제출하지않음, 1:제출)</param>
/// <param name="currentLectIsComplete">현재 과정 수료여부 (0: 미수료, 1:수료)</param>
/// <returns></returns>
public string GetEvaTypeClass(int intval, int intval2, int intval3, int intval4, int currentLectIsComplete)
{
// todo currentLectIsComplete 는 평가완료인가 참여불가인가 확인
if (intval4 == 1)
// 과제 제출 여부가 1(제출 완료)이면 "evaType04" 반환
return "evaType04";
else if (intval3 == 1)
// 평가 종료 여부가 1(종료)인 경우 "evaType03" 반환
return "evaType03";
else if (intval3 == 0 && intval >= intval2)
// 평가가 종료되지 않았고(종료 여부가 0), 출석률이 참여 조건을 만족하거나 초과하면 "evaType02" 반환
return "evaType02";
else
// 위 조건에 해당하지 않는 모든 경우에 "evaType01" 반환
return "evaType01";
}
/// <summary>
/// 평가 상태에 따른 문구를 반환
/// </summary>
/// <param name="intval"></param>
/// <param name="intval2"></param>
/// <param name="intval3"></param>
/// <param name="intval4"></param>
/// <returns></returns>
public string GetEvaStatusText(int intval, int intval2, int intval3, int intval4, int currentLectIsComplete)
{
if (intval4 == 1)
return "[평가완료]";
else if (intval3 == 1)
return "[참여완료]";
else if (intval3 == 0 && intval >= intval2)
return "[참여가능]";
else
return "[참여불가]";
}
} }

View File

@ -6,24 +6,23 @@
<table class="evaDetail"> <table class="evaDetail">
<tr><th>시험종류</th><td>@Model.LectEX.exname</td></tr> <tr><th>시험종류</th><td>@Model.LectEX.exname</td></tr>
<tr><th>시험제목</th><td>@Model.LectEX.exname</td></tr> <tr><th>시험제목</th><td>@Model.LectEX.exname</td></tr>
<tr><th>시험내용</th><td>@Html.Raw((Model.LectEX.edesc??"").Replace(System.Environment.NewLine, "<br />"))</td></tr> <tr><th>시험내용</th><td>@Html.Raw((Model.LectEX.edesc ?? "").Replace(System.Environment.NewLine, "<br />"))</td></tr>
<tr><th>평가점수</th><td>@(Model.LectEX.tpoint+"점")</td></tr> <tr><th>평가점수</th><td>@(Model.LectEX.tpoint + "점")</td></tr>
<tr><th>제한시간</th><td>@(Model.LectEX.etime == 0 ? "제한없음" : string.Format("{0} 분", Model.LectEX.etime))</td></tr> <tr><th>제한시간</th><td>@(Model.LectEX.etime == 0 ? "제한없음" : string.Format("{0} 분", Model.LectEX.etime))</td></tr>
<tr><th>응시기간</th><td>@(Model.LectEX.sdate.Value.ToString("yy-MM-dd hh:mm")) ~ @(Model.LectEX.edate.Value.ToString("yy-MM-dd hh:mm"))까지(진도율 @(Model.LectEX.econdition)%이상 응시가능)</td></tr> <tr><th>응시기간</th><td>@(Model.LectEX.sdate.Value.ToString("yy-MM-dd hh:mm")) ~ @(Model.LectEX.edate.Value.ToString("yy-MM-dd hh:mm"))까지(진도율 @(Model.LectEX.econdition)%이상 응시가능)</td></tr>
<tr><th>재응시여부</th><td>@(Model.LectEX.isreexamable == 0 ? "불가능" : "가능")</td></tr> <tr><th>재응시여부</th><td>@(Model.LectEX.isreexamable == 0 ? "불가능" : "가능")</td></tr>
<tr><th>응시상태</th><td>@(Model.LectEX.estart == null ? ("응시전"+(Model.LectEX.recount > 0 ? string.Format(" (재응시승인 {0}회)", Model.LectEX.recount):"")) : Model.LectEX.eend != null ? "응시완료" : Model.LectEX.rtime < 1 ? "응시시간초과":("응시시작 (남은시간 " + Model.LectEX.rtime + "분)" +(Model.LectEX.relaylimit.Value <= Model.LectEX.entercount?", [이어보기 초과]":"")))</td></tr> <tr><th>응시상태</th><td>@(Model.LectEX.estart == null ? ("응시전" + (Model.LectEX.recount > 0 ? string.Format(" (재응시승인 {0}회)", Model.LectEX.recount) : "")) : Model.LectEX.eend != null ? "응시완료" : Model.LectEX.rtime < 1 ? "응시시간초과" : ("응시시작 (남은시간 " + Model.LectEX.rtime + "분)" + (Model.LectEX.relaylimit.Value <= Model.LectEX.entercount ? ", [이어보기 초과]" : "")))</td></tr>
@if (Model.LectEX.estart != null) @if (Model.LectEX.estart != null)
{ {
<tr><th>응시시작</th><td>@Model.LectEX.estart</td></tr> <tr><th>응시시작</th><td>@Model.LectEX.estart</td></tr>
} }
</table> </table>
<ul class="lctBtn col1"> <ul class="lctBtn col1">
@if (Model.LectEX.eend == null && (Model.LectEX.estart == null || Model.LectEX.relaylimit.Value >= Model.LectEX.entercount)) @if (Model.LectEX.eend == null && (Model.LectEX.estart == null || Model.LectEX.relaylimit.Value >= Model.LectEX.entercount) && Model.LectEX.iscomplete != 1)
{ {
<li><a href="#" class="bk" onclick="goexam()">응시하기</a></li> <li><a href="#" class="bk" onclick="goexam()">응시하기</a></li>
} }
@* [start] 아래 if문 주석은 2025 3월이후에 다시 사용 현재는 임시처리 *@ @* [start] 아래 if문 주석은 2025 3월이후에 다시 사용 현재는 임시처리 *@
@*@if (Model.LectEX.ispass == 1)*@ @*@if (Model.LectEX.ispass == 1)*@
@if (Model.LectEX.estart != null) @if (Model.LectEX.estart != null)