콘텐츠 차시 진도율 기능 추가

This commit is contained in:
hodong13 2020-11-03 06:54:31 +00:00
parent f845c4359c
commit 384cf418c5
3 changed files with 42 additions and 0 deletions

View File

@ -263,6 +263,22 @@ namespace NP.Base.Controllers
return JsonOK(0);
}
[HttpPost]
public JsonResult PRGRS(Int64 lectno, Int64 cmino)
{
if (SUserInfo.UserNo > 0)
{
try
{
return Json(Dao.Get<int>("cr.getprogress", new Hashtable() { { "lectno", lectno }, { "cmino", cmino } }).First(), JsonRequestBehavior.AllowGet);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
return Json(-1, JsonRequestBehavior.AllowGet);
}
[HttpPost]
public JsonResult StudyLog(Int64 logno, Int64 lectno, Int64 cmino, int cpno, int studysec, int ispc, int nextcpno, int getiframe, int issample = 0, int psec = 0)
{
if (SUserInfo.UserNo > 0 || issample > 0)

View File

@ -261,6 +261,13 @@
where a.cmino=#cmino#
order by a.iseq
</select>
<select id="cr.getprogress" parameterClass="hashtable" resultClass="int">
select case when b.atime=0 then 100
else case when floor(a.totstudy / (b.sttime * 60) * 100) &gt; 100 then 100 else floor(a.totstudy / (b.sttime * 60) * 100) end end
from lectinning a
inner join cminning b on b.cmino=a.cmino
where a.lectno=#lectno# and a.cmino=#cmino#
</select>
<update id="cr.studylog" parameterClass="hashtable">
update lectinningpage a
inner join lect b on b.lectno=a.lectno and b.userno=#userno#

View File

@ -510,6 +510,25 @@
//clearInterval(_timerlog);
golog(true);
}
function getprgrs() {
var r = -1;
if (@Model.istaste == 1) {
r = 100;
} else {
$.ajax({
type: "post",
url: "/focommon/prgrs",
async: false,
data: { lectno: @Model.lip.lectno, cmino: @Model.lip.cmino},
success: function (r2) {
r = parseInt(r2, 10);
}, error: function (e) {
r = -1;
}
});
}
return r;
}
window.onbeforeunload = function () {
if (!_passunload && @Model.istaste != 1 && !_islogout) {
clearInterval(_timerlog);