콘텐츠 차시 진도율 기능 추가
This commit is contained in:
parent
f845c4359c
commit
384cf418c5
|
|
@ -263,6 +263,22 @@ namespace NP.Base.Controllers
|
||||||
return JsonOK(0);
|
return JsonOK(0);
|
||||||
}
|
}
|
||||||
[HttpPost]
|
[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)
|
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)
|
if (SUserInfo.UserNo > 0 || issample > 0)
|
||||||
|
|
|
||||||
|
|
@ -261,6 +261,13 @@
|
||||||
where a.cmino=#cmino#
|
where a.cmino=#cmino#
|
||||||
order by a.iseq
|
order by a.iseq
|
||||||
</select>
|
</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) > 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 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#
|
||||||
|
|
|
||||||
|
|
@ -510,6 +510,25 @@
|
||||||
//clearInterval(_timerlog);
|
//clearInterval(_timerlog);
|
||||||
golog(true);
|
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 () {
|
window.onbeforeunload = function () {
|
||||||
if (!_passunload && @Model.istaste != 1 && !_islogout) {
|
if (!_passunload && @Model.istaste != 1 && !_islogout) {
|
||||||
clearInterval(_timerlog);
|
clearInterval(_timerlog);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue