6731. 시험응시 조건 변경 lect.iscomplete = 1 평가버튼숨김
This commit is contained in:
parent
c37fadd07a
commit
56ac69d2f2
|
|
@ -455,6 +455,7 @@
|
|||
,null strval,0 intval10
|
||||
,0 intval,0 intval2,0 intval3,0 intval4,0 intval5
|
||||
,0 intval6
|
||||
,0 intval7
|
||||
,0 rno
|
||||
,null time
|
||||
,null time2
|
||||
|
|
@ -465,6 +466,7 @@
|
|||
,null strval,0 intval10
|
||||
,0 intval,0 intval2,0 intval3,0 intval4,a.attrate intval5
|
||||
,0 intval6
|
||||
,a.iscomplete intval7
|
||||
,0 rno
|
||||
,null time
|
||||
,null time2
|
||||
|
|
@ -474,12 +476,12 @@
|
|||
union all
|
||||
select b.extype dtype
|
||||
,b.exname strval,b.exno intval10
|
||||
<!--,case when a2.sstime < now() and a2.setime > now() then a.attrate else -1 end intval,b.econdition intval2-->
|
||||
,case when a.sdate < now() and a.edate > now() then a.attrate else -1 end intval,b.econdition intval2
|
||||
,case when c.eend is null then 0 else 1 end intval3
|
||||
,a.attrate intval5
|
||||
,null intval4
|
||||
,a2.studytime intval6
|
||||
,a.iscomplete intval7
|
||||
,row_number() over (partition by b.extype order by b.extype, b.cdt) rno
|
||||
,a.edate time
|
||||
,a.sdate time2
|
||||
|
|
@ -493,12 +495,12 @@
|
|||
union all
|
||||
select 2 dtype
|
||||
,b.sdname strval,b.sdno intval10
|
||||
<!--,case when a2.sstime < now() and a2.setime > now() then a.attrate else -1 end intval,b.sdcondition intval2-->
|
||||
,case when a.sdate < now() and a.edate > 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.checktime is null then 0 else 1 end intval4
|
||||
,a.attrate intval5
|
||||
,a2.studytime intval6
|
||||
,a.iscomplete intval7
|
||||
,row_number() over (order by b.cdt) rno
|
||||
,a.edate time
|
||||
,a.sdate time2
|
||||
|
|
@ -512,12 +514,12 @@
|
|||
union all
|
||||
select 3 dtype
|
||||
,b.sdname strval,b.sdno intval10
|
||||
<!--,case when a2.sstime < now() and a2.setime > now() then a.attrate else -1 end intval,b.sdcondition intval2-->
|
||||
,case when a.sdate < now() and a.edate > now() then a.attrate else -1 end intval,b.sdcondition intval2
|
||||
,case when count(d.bno) > 0 then 1 else 0 end intval3
|
||||
,case when c.checktime is null then 0 else 1 end intval4
|
||||
,a.attrate intval5
|
||||
,a2.studytime intval6
|
||||
,a.iscomplete intval7
|
||||
,row_number() over (order by b.cdt) rno
|
||||
,a.edate time
|
||||
,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 lectsdboard d on d.lectno=a.lectno and d.sdno=b.sdno and d.isdel=0
|
||||
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>
|
||||
) a
|
||||
order by a.dtype,a.rno
|
||||
|
|
@ -1881,6 +1883,7 @@
|
|||
and l.userno = #userno#
|
||||
and cmi.isscd = 1
|
||||
and li.istatus = 2
|
||||
AND IFNULL(l.iscomplete, 0) = 0
|
||||
]]>
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -503,6 +503,11 @@ namespace NP.FO.Controllers
|
|||
return CView(vm);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 강의실 > 시험응시 /과제제출 > 시험응시 페이지
|
||||
/// </summary>
|
||||
/// <param name="vm"></param>
|
||||
/// <returns></returns>
|
||||
public ActionResult EstimationExam(VMCRoom vm)
|
||||
{
|
||||
string ua = (Request?.UserAgent ?? "").ToLower();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
@model NP.Model.VMCRoom
|
||||
@{
|
||||
/*
|
||||
* -- Model.Datas의 Dtype
|
||||
* -1 : lect만 쿼리하고 attrate만 intval5에 담아놓음
|
||||
* 1 : 최종평가
|
||||
* 2 : 과제
|
||||
*/
|
||||
|
||||
// 1. 하단 문구에서 사용
|
||||
// 1-1)최종평가 일때 cm.studytime 값 intval6
|
||||
|
|
@ -14,24 +20,20 @@
|
|||
.Select(s => s.time2)
|
||||
.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 currentLectIsComplete = Model.Datas.Where(w => w.dtype == -1).FirstOrDefault().intval7;
|
||||
|
||||
// 시험응시가능여부
|
||||
bool isExCheck = ViewBag.exCheck != null ? (bool)ViewBag.exCheck : false;
|
||||
|
||||
}
|
||||
<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 == 1 ? "current" : "")"><a onclick="gotab(1, this)" style="@(Model.tabidx == 1 ? "cursor: default;" : "")" href="#">시험</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 == 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="javascript:;">시험</a></li>
|
||||
<li class="@(Model.tabidx == 2 ? "current" : "")"><a onclick="gotab(2, this)" style="@(Model.tabidx == 2 ? "cursor: default;" : "")" href="javascript:;">과제</a></li>
|
||||
</ul>
|
||||
<div class="evaList">
|
||||
<input type="hidden" id="hdndType1StudyTime" value="@dType1CmStudyTime" />
|
||||
|
|
@ -103,7 +105,8 @@
|
|||
<input type="hidden" name="lectEDate" value="@d.time" />
|
||||
<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))"
|
||||
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>
|
||||
}
|
||||
else
|
||||
|
|
@ -228,11 +231,12 @@
|
|||
|
||||
});
|
||||
|
||||
@*
|
||||
/**
|
||||
* 탭 변경
|
||||
* @@param idx {int} - 탭번호 (0:전체, 1:평가, 2:과제)
|
||||
* @@param a {event} - e
|
||||
*/
|
||||
* @param idx {int} - 탭번호 (0:전체, 1:평가, 2:과제)
|
||||
* @param a {event} - e
|
||||
*/ *@
|
||||
function gotab(idx, a) {
|
||||
if (!$(a).parent().hasClass("current")) {
|
||||
setv("tabidx", idx);
|
||||
|
|
@ -286,4 +290,51 @@
|
|||
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 "[참여불가]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -6,24 +6,23 @@
|
|||
<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>@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>@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.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.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)
|
||||
{
|
||||
<tr><th>응시시작</th><td>@Model.LectEX.estart</td></tr>
|
||||
}
|
||||
</table>
|
||||
<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>
|
||||
}
|
||||
|
||||
|
||||
@* [start] 아래 if문 주석은 2025 3월이후에 다시 사용 현재는 임시처리 *@
|
||||
@*@if (Model.LectEX.ispass == 1)*@
|
||||
@if (Model.LectEX.estart != null)
|
||||
|
|
|
|||
Loading…
Reference in New Issue