This commit is contained in:
hyunho 2021-01-26 01:17:53 +00:00
parent 41d0de2b4e
commit e0dd43df9b
5 changed files with 62 additions and 26 deletions

View File

@ -322,6 +322,15 @@ namespace NP.Base.Controllers
} }
} }
[HttpPost] [HttpPost]
public JsonResult checklectdate(Int64 lectno)
{
Lect lect = Dao.Get<Lect>("cr.checklectdate", new Hashtable() { { "lectno", lectno } }).First();
if (DateTime.Now <= lect.edate) //lect.수강종료일 이후 클릭시, 학습만 허용하나 로그는 쌓지 않음
return Json(new { result = 1 });
else
return Json(new { result = -1 });
}
[HttpPost]
public JsonResult StudyLogMid(Int64 lectno, Int64 cmino) public JsonResult StudyLogMid(Int64 lectno, Int64 cmino)
{ {
if (SUserInfo.UserNo > 0) if (SUserInfo.UserNo > 0)
@ -551,6 +560,8 @@ namespace NP.Base.Controllers
} }
return JsonOK(0); return JsonOK(0);
} }
} }
} }

View File

@ -251,8 +251,8 @@
<isGreaterThan property="pseq" compareValue="0">and p.pseq=#pseq#</isGreaterThan> <isGreaterThan property="pseq" compareValue="0">and p.pseq=#pseq#</isGreaterThan>
<isGreaterThan property="cpno" compareValue="0">and p.cpno=#cpno#</isGreaterThan> <isGreaterThan property="cpno" compareValue="0">and p.cpno=#cpno#</isGreaterThan>
<isGreaterThan property="isrelay" compareValue="0">and p.pseq=li.pseq</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 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() <!--inner join cm c on c.cmno=b.cmno and c.sstime &lt; now() and c.setime &gt; now()-->
where a.cmino=#cmino# where a.cmino=#cmino#
<selectKey type="post" property="logno" resultClass="long">SELECT last_insert_id()</selectKey> <selectKey type="post" property="logno" resultClass="long">SELECT last_insert_id()</selectKey>
</insert> </insert>
@ -276,6 +276,11 @@
inner join cminning b on b.cmino=a.cmino inner join cminning b on b.cmino=a.cmino
where a.lectno=#lectno# and a.cmino=#cmino# where a.lectno=#lectno# and a.cmino=#cmino#
</select> </select>
<select id="cr.checklectdate" parameterClass="hashtable" resultClass="lect">
select a.lectno,a.sdate,a.edate
from lect a
where a.lectno=#lectno#
</select>
<update id="cr.studylog" parameterClass="hashtable"> <update id="cr.studylog" parameterClass="hashtable">
update lectinningpage a update lectinningpage a
inner join lect b on b.lectno=a.lectno and b.userno=#userno# inner join lect b on b.lectno=a.lectno and b.userno=#userno#

View File

@ -353,6 +353,18 @@
//} //}
} }
function golog(ispaging, isunload, isinning) { function golog(ispaging, isunload, isinning) {
var checklectdate = -1;
$.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; ispaging = ispaging || false;
isunload = isunload || false; isunload = isunload || false;
@ -378,33 +390,39 @@
if ($("#video1").length > 0) { if ($("#video1").length > 0) {
_psecond = getint($("#video1")[0].currentTime); _psecond = getint($("#video1")[0].currentTime);
} }
} catch (e) {} } catch (e) { }
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); 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) { } else if (_mtime > 0 && !_okmid && _tsec >= _mtime && _mtimesec < 1) {
//clearInterval(_timerlog);
_mtimesec = 1; if (checklectdate > 0) {
$("#playerbox").addClass("hidecontent"); alert(checklectdate);
if (_ctype == 0 && navigator.userAgent.match(/iPhone|iPod/i)) { //clearInterval(_timerlog);
var vid = document.getElementById('video1'); _mtimesec = 1;
vid.webkitExitFullscreen(); $("#playerbox").addClass("hidecontent");
} else { if (_ctype == 0 && navigator.userAgent.match(/iPhone|iPod/i)) {
try { var vid = document.getElementById('video1');
if (navigator.userAgent.match(/iPhone|iPod/i)) { vid.webkitExitFullscreen();
alert('10초안에 중간출석을 확인해주세요.'); } else {
}
else if (typeof (document.msExitFullscreen) == "function") {
document.msExitFullscreen();
} else if (typeof (document.webkitExitFullscreen) == "function") {
document.webkitExitFullscreen();
}
} catch (e) {
try { try {
document.webkitExitFullscreen(); if (navigator.userAgent.match(/iPhone|iPod/i)) {
} catch (e2) { alert('10초안에 중간출석을 확인해주세요.');
}
else if (typeof (document.msExitFullscreen) == "function") {
document.msExitFullscreen();
} else if (typeof (document.webkitExitFullscreen) == "function") {
document.webkitExitFullscreen();
}
} catch (e) {
try {
document.webkitExitFullscreen();
} catch (e2) {
}
} }
} }
msg("중간출석 확인 메시지입니다. 10초안에 확인을 눌러주세요.", null, null, null, "okmid()");
} }
msg("중간출석 확인 메시지입니다. 10초안에 확인을 눌러주세요.", null, null, null, "okmid()");
} }
} }
function okmid() { function okmid() {

View File

@ -135,7 +135,8 @@
<li class="lctc2"> <li class="lctc2">
@if (d.isonline == 1) @if (d.isonline == 1)
{ {
<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 > 5 && d.isrebate == 1 ? 0 : 1));" class="lctcStdy">학습하기</a> //학습기간 종료후에도 시청은 가능하고, 출석인정은 되지않도록 변경 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 > 5 && d.isrebate == 1 ? 0 : 1));" class="lctcStdy">학습하기</a>
} }
</li> </li>
</ul> </ul>

View File

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