From 56ac69d2f2ae96a5a1302627737ce39979e2a59d Mon Sep 17 00:00:00 2001 From: iyak Date: Fri, 4 Apr 2025 05:59:40 +0000 Subject: [PATCH] =?UTF-8?q?6731.=20=EC=8B=9C=ED=97=98=EC=9D=91=EC=8B=9C=20?= =?UTF-8?q?=EC=A1=B0=EA=B1=B4=20=EB=B3=80=EA=B2=BD=20lect.iscomplete=20=3D?= =?UTF-8?q?=201=20=ED=8F=89=EA=B0=80=EB=B2=84=ED=8A=BC=EC=88=A8=EA=B9=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dao/MyBatis/Maps/CRoom.xml | 17 +++--- FO/Controllers/CRoomController.cs | 5 ++ FO/Views/CRoom/Estimation.cshtml | 87 ++++++++++++++++++++++------ FO/Views/CRoom/EstimationExam.cshtml | 13 ++--- 4 files changed, 90 insertions(+), 32 deletions(-) diff --git a/Dao/MyBatis/Maps/CRoom.xml b/Dao/MyBatis/Maps/CRoom.xml index 91f9600..9d363e2 100644 --- a/Dao/MyBatis/Maps/CRoom.xml +++ b/Dao/MyBatis/Maps/CRoom.xml @@ -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 @@ -473,13 +475,13 @@ union all select b.extype dtype - ,b.exname strval,b.exno intval10 - + ,b.exname strval,b.exno intval10 ,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 @@ -492,13 +494,13 @@ union all select 2 dtype - ,b.sdname strval,b.sdno intval10 - + ,b.sdname strval,b.sdno intval10 ,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 @@ -511,13 +513,13 @@ union all select 3 dtype - ,b.sdname strval,b.sdno intval10 - + ,b.sdname strval,b.sdno intval10 ,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 ) 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 ]]> diff --git a/FO/Controllers/CRoomController.cs b/FO/Controllers/CRoomController.cs index b1775a0..10f8755 100644 --- a/FO/Controllers/CRoomController.cs +++ b/FO/Controllers/CRoomController.cs @@ -503,6 +503,11 @@ namespace NP.FO.Controllers return CView(vm); } + /// + /// 강의실 > 시험응시 /과제제출 > 시험응시 페이지 + /// + /// + /// public ActionResult EstimationExam(VMCRoom vm) { string ua = (Request?.UserAgent ?? "").ToLower(); diff --git a/FO/Views/CRoom/Estimation.cshtml b/FO/Views/CRoom/Estimation.cshtml index a9de21c..a6a00a9 100644 --- a/FO/Views/CRoom/Estimation.cshtml +++ b/FO/Views/CRoom/Estimation.cshtml @@ -1,12 +1,18 @@ @model NP.Model.VMCRoom @{ + /* + * -- Model.Datas의 Dtype + * -1 : lect만 쿼리하고 attrate만 intval5에 담아놓음 + * 1 : 최종평가 + * 2 : 과제 + */ // 1. 하단 문구에서 사용 // 1-1)최종평가 일때 cm.studytime 값 intval6 int dType1CmStudyTime = Model.Datas - .Where(w => w.dtype == 1) - .Select(s => s.intval6) - .SingleOrDefault(); + .Where(w => w.dtype == 1) + .Select(s => s.intval6) + .SingleOrDefault(); // 1-2)최종평가 일때 lect.sdate DateTime dType1LectSDate = Model.Datas @@ -14,24 +20,20 @@ .Select(s => s.time2) .SingleOrDefault(); - // 예외처리 과정코드들? - //List 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; }
@@ -103,7 +105,8 @@ = d.intval2 ? "02" : "01")">@(d.intval4 == 1 ? "[평가완료]" : d.intval3 == 1 ? "[참여완료]" : d.intval3 == 0 && d.intval >= d.intval2 ? "[참여가능]" : "[참여불가]") + class="@GetEvaTypeClass(d.intval, d.intval2, d.intval3, d.intval4, currentLectIsComplete)">@GetEvaStatusText(d.intval, d.intval2, d.intval3, d.intval4, currentLectIsComplete) + } 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); @@ -281,9 +285,56 @@ /// 종료일 /// true/false public bool IsDateInRange(DateTime startDate, DateTime endDate) - { + { // 현재일자가 시작일 이상 && 종료일 이하인지 확인 return startDate <= DateTime.Now && DateTime.Now <= endDate; } + /// + /// 평가 상태에 따른 css class를 반환 + /// + /// 수강기간 내 출석률(없으면 -1) + /// 참여조건(출석률) + /// 평가종료여부(0:종료일자없음, 1:종료) + /// 시험일때는 null 과제일때는 (0:제출하지않음, 1:제출) + /// 현재 과정 수료여부 (0: 미수료, 1:수료) + /// + 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"; + } + + /// + /// 평가 상태에 따른 문구를 반환 + /// + /// + /// + /// + /// + /// + 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 "[참여불가]"; + } + } \ No newline at end of file diff --git a/FO/Views/CRoom/EstimationExam.cshtml b/FO/Views/CRoom/EstimationExam.cshtml index 998e79f..3c6e3d8 100644 --- a/FO/Views/CRoom/EstimationExam.cshtml +++ b/FO/Views/CRoom/EstimationExam.cshtml @@ -6,24 +6,23 @@ - - + + - + @if (Model.LectEX.estart != null) { }
시험종류@Model.LectEX.exname
시험제목@Model.LectEX.exname
시험내용@Html.Raw((Model.LectEX.edesc??"").Replace(System.Environment.NewLine, "
"))
평가점수@(Model.LectEX.tpoint+"점")
시험내용@Html.Raw((Model.LectEX.edesc ?? "").Replace(System.Environment.NewLine, "
"))
평가점수@(Model.LectEX.tpoint + "점")
제한시간@(Model.LectEX.etime == 0 ? "제한없음" : string.Format("{0} 분", Model.LectEX.etime))
응시기간@(Model.LectEX.sdate.Value.ToString("yy-MM-dd hh:mm")) ~ @(Model.LectEX.edate.Value.ToString("yy-MM-dd hh:mm"))까지(진도율 @(Model.LectEX.econdition)%이상 응시가능)
재응시여부@(Model.LectEX.isreexamable == 0 ? "불가능" : "가능")
응시상태@(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?", [이어보기 초과]":"")))
응시상태@(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 ? ", [이어보기 초과]" : "")))
응시시작@Model.LectEX.estart
-
    - @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) + {
    • 응시하기
    • } - @* [start] 아래 if문 주석은 2025 3월이후에 다시 사용 현재는 임시처리 *@ @*@if (Model.LectEX.ispass == 1)*@ @if (Model.LectEX.estart != null)