"복습기능 추가 구현

- 교육 종료일로부터 1년까지 복습만 가능하도록 추가구현"
This commit is contained in:
lch 2021-06-09 07:37:24 +00:00
parent 1845e4274c
commit e36fe50aad
6 changed files with 93 additions and 96 deletions

View File

@ -353,10 +353,10 @@ namespace NP.Base.Controllers
{
return JsonBack(new JsonRtn() { code = 1000, obj = -2 });
}
else if (cmi.isrebate == 1)
else
{
var intval = Dao.Get<LectInning>("cr.lectinnings", new System.Collections.Hashtable() { { "lectno", lectno }, { "isfinishtoday", 1 } }).Count();
if (intval > 5 && cmi.istatus < 2)
if (intval > 7 && cmi.istatus < 2)
{
return JsonBack(new JsonRtn() { code = 1000, obj = -3 });
}

View File

@ -251,9 +251,8 @@
<isGreaterThan property="pseq" compareValue="0">and p.pseq=#pseq#</isGreaterThan>
<isGreaterThan property="cpno" compareValue="0">and p.cpno=#cpno#</isGreaterThan>
<isGreaterThan property="isrelay" compareValue="0">and p.pseq=li.pseq</isGreaterThan>
inner join lect b on b.lectno=#lectno# and b.userno=#userno# and b.cmno=a.cmno and b.status=1 and b.ischanged=0 and b.sdate &lt; now()
<!--inner join cm c on c.cmno=b.cmno and c.sstime &lt; now() and c.setime &gt; now()-->
where a.cmino=#cmino#
inner join lect b on b.lectno=#lectno# and b.userno=#userno# and b.cmno=a.cmno and b.status=1 and b.ischanged=0
where a.cmino=#cmino# and b.sdate &lt; now() and b.edate &gt; now()
<selectKey type="post" property="logno" resultClass="long">SELECT last_insert_id()</selectKey>
</insert>
<select id="cr.ctps" parameterClass="hashtable" resultClass="ctp">

View File

@ -82,6 +82,10 @@ namespace NP.FO.Controllers
var data = Dao.Get<Data>("lect.lectinning.attcert.check", new Hashtable() { { "lectno", vm.lectno }, { "cmino", vm.cmino }, { "userno", SUserInfo.UserNo } }).FirstOrDefault();
//출석 인증 시만 보이게 제한 처리 (intval 회차, intval2 출석인증제외 회원, intval3 출석인증제외 강좌)
if (data != null && (data.intval == 1 || data.intval2 == 1 || data.intval3 == 1))
{
var todayLectinningCount = Dao.Get<LectInning>("cr.lectinnings", new System.Collections.Hashtable() { { "lectno", vm.croomlectno }, { "isfinishtoday", 1 } }).Count();
//1일 신규 동영상 강의를 8차시로 제한
if (todayLectinningCount < 8)
{
//이어보기를 위해 페이지관리
//vm.pseq = vm.pseq < 1 ? 1 : vm.pseq;
@ -130,6 +134,22 @@ namespace NP.FO.Controllers
//}
}
}
else
{
#region ( ~ 1)
vm.LectInnings = Dao.Get<LectInning>("cr.cminnings", new System.Collections.Hashtable() { { "lectno", vm.lectno }, { "userno", SUserInfo.UserNo }, { "limit", 1 } });
if (vm.LectInnings.Count() > 0 && vm.LectInnings.First().sdate < DateTime.Now && vm.LectInnings.First().edate.AddYears(1) > DateTime.Now)
{
vm.istaste = 1;
vm.status = 1;
vm.Pages = Dao.Get<LectInningPage, CTPage>("cr.ctps", vm.lip);
vm.pseq = vm.Pages.First().lastpseq;
vm.Page = vm.Pages.Where(w => w.pseq == vm.pseq).First();
vm.CMInning = new CMInning() { lectno = vm.lectno, cmino = vm.cmino, isokmid = vm.Page.isokmid, ismenu = vm.Page.ismenu, iseq = vm.Page.iseq, ititle = vm.Page.ititle, ctype = vm.Page.ctype, ccode = vm.Page.ccode, isoversize = vm.Page.isoversize, mstime = vm.Page.mstime, metime = vm.Page.metime };
}
#endregion
}
}
}
}
//Response.AddHeader("X-Frame-Options", "ALLOW-FROM http://www.kocw.net");

View File

@ -353,22 +353,6 @@
//}
}
function golog(ispaging, isunload, isinning) {
var checklectdate = -1;
if (@Model.istaste == 1) {
checklectdate = 1;
} else {
$.ajax({
type: "post",
url: "/focommon/checklectdate",
async: false,
data: { lectno: @Model.lip.lectno},
success: function (res) {
checklectdate = res.result;
}, error: function (e) {
alert("error");
}
});
}
ispaging = ispaging || false;
isunload = isunload || false;
@ -395,13 +379,8 @@
_psecond = getint($("#video1")[0].currentTime);
}
} catch (e) { }
if (checklectdate > 0) {
capp("/focommon/studylog", { logno: _logno, lectno: @Model.lip.lectno, cmino: @Model.lip.cmino, cpno: _cpno, studysec: _sec, ispc: ismobile() ? 0 : 1, nextcpno: ispaging ? _nextcpno : 0, getiframe: @(Model.CMInning.ismenu == 1 && Model.CMInning.ctype == 2 ? 1 : 0), issample: @Model.istaste, psec: _psecond }, "cbstudylog" + (ispaging ? "page" : "") + (isunload ? "unload" : "") + (isinning ? "inning" : ""), null, null, true, null, true);
}
} else if (_mtime > 0 && !_okmid && _tsec >= _mtime && _mtimesec < 1) {
if (checklectdate > 0) {
//alert(checklectdate);
//clearInterval(_timerlog);
_mtimesec = 1;
$("#playerbox").addClass("hidecontent");
@ -428,7 +407,6 @@
msg("중간출석 확인 메시지입니다. 10초안에 확인을 눌러주세요.", null, null, null, "okmid()");
}
}
}
function okmid() {
capp("/focommon/studylogmid", { lectno: @Model.lip.lectno, cmino: @Model.lip.cmino}, "cbokmid");
}
@ -585,7 +563,7 @@
msg("현재차시를 학습완료해야 다음차시를 학습할 수 있습니다.");
} else if (capResult.obj == -3) {
_timerlog = setInterval(golog, 1000);
msg("일일 최대 학습회차는 6차시입니다.");
msg("일일 최대 학습회차는 8차시입니다.");
} else {
//학습로그 & 차시이동
_prenextcmino = capResult.obj;

View File

@ -141,7 +141,7 @@
@if (d.isonline == 1)
{
//학습기간 종료후에도 시청은 가능하고, 출석인정은 되지않도록 변경 2021-01-25
<a href="#" onclick="playerOpen(@d.cmino, @(d.sdate < DateTime.Now @*&& d.edate > DateTime.Now*@ ? 1 : 0), @(d.isseq == 1 &&d.iseq != 1 && d.preistatus < 2 ? 0 : 1), @(Model.intval > 7 && d.isrebate == 1 ? 0 : 1));" class="lctcStdy">학습하기</a>
<a href="#" onclick="playerOpen(@d.cmino, @(d.sdate < DateTime.Now && d.edate.AddYears(1) > DateTime.Now ? 1 : 0), @(d.isseq == 1 &&d.iseq != 1 && d.preistatus < 2 ? 0 : 1), @(Model.intval > 7 ? 0 : 1));" class="lctcStdy">학습하기</a>
}
</li>
</ul>

View File

@ -47,7 +47,7 @@
@if (d.isonline == 1)
{
//학습기간 종료후에도 시청은 가능하고, 출석인정은 되지않도록 변경 2021-01-25
<a href="#" onclick="playerOpen(@d.cmino, @(d.sdate < DateTime.Now @*&& d.setime > DateTime.Now *@ ? 1 : 0), @(d.isseq == 1 && d.iseq != 1 && d.preistatus < 2 ? 0 : 1), @(Model.intval > 7 && d.isrebate == 1 ? 0 : 1));" class="lctcStdy">학습하기</a>
<a href="#" onclick="playerOpen(@d.cmino, @(d.sdate < DateTime.Now && d.edate.AddYears(1) > DateTime.Now ? 1 : 0), @(d.isseq == 1 && d.iseq != 1 && d.preistatus < 2 ? 0 : 1), @(Model.intval > 7 ? 0 : 1));" class="lctcStdy">학습하기</a>
}
</li>
</ul>