YNICTE/BO/Views/croom/grade4.cshtml

503 lines
22 KiB
Plaintext
Raw Normal View History

@model NP.Model.VMLect
@{
2020-10-12 14:39:23 +09:00
int idx = 1;
}
<form id="mform" method="post">
@if (Model.CMSDs.Count() < 1)
{
@:*등록된 과제가 없습니다.
}
else
{
<table class="regtable" style="margin-top: 0;">
<colgroup><col width="200" /><col /></colgroup>
<tr>
<th>회차선택</th>
<td>
<select name="addstringval" id="addstringval" class="form-control disp-init" onchange="changeex(this)">
@foreach (var e in Model.CMSDs)
{
<option value="@e.sdno" data-tpoint="@e.tpoint" @(Model.addstringval == e.sdno.ToString() ? "selected" : "")>@(e.rno) 회</option>
}
</select>
</td>
</tr>
@foreach (var e in Model.CMSDs)
{
<tr class="extr hidden ex@(e.rno)"><th>평가명</th><td>@e.sdname</td></tr>
<tr class="extr hidden ex@(e.rno)"><th>만점/조건</th><td>@string.Format("{0}점 만점 / 진도율 {1}% 이상", e.tpoint, e.sdcondition)</td></tr>
<tr class="extr hidden ex@(e.rno)"><th>평가내용</th><td>@Html.Raw((e.sddesc ?? "").Replace(System.Environment.NewLine, "<br/>"))</td></tr>
<tr class="extr hidden ex@(e.rno)">
<th>첨부파일</th>
<td>
@Html.Partial("./Partial/File", Model.FileList.Where(w => w.fgno == e.fgno).ToList(), new ViewDataDictionary {
2020-10-12 14:39:23 +09:00
{ "name", "fgno" },{"value", 0 },{ "fname", "file"},
{"width", null },{"folder", "Resume" },{"filecount", 5 },
{"readmode", 1 },{"hidemode", 0 },
{ "isimage", 0 },{ "imageid", "" },{ "dftsrc", "" },
{ "fileext", "" }
})
</td>
</tr>
2020-10-12 14:39:23 +09:00
}
</table>
}
2020-10-12 14:39:23 +09:00
<br />
<section class="panel panel-default">
<div style="padding: 10px 10px">
@Html.Partial("./Partial/Select", null, new ViewDataDictionary { { "valuetext", ":-환급여부;1:환급;0:비환급" }, { "name", "addstringval2" }, { "selected", Model.addstringval2 }, { "style", (Model.CM.isrefund == 1 ? "" : "display:none;") }, { "onchange", "findme()" } })
@Html.Partial("./Partial/Select", null, new ViewDataDictionary { { "valuetext", ":-응시상태;1:제출;0:미제출" }, { "name", "addstringval3" }, { "selected", Model.addstringval3 }, { "onchange", "findme()" } })
<a href="#" class="f-r btn btn-default" onclick="golist();" style="margin-left: 20px;">목록</a>
<a href="#" class="f-r btn btn-info" onclick="batchsd();" style="margin-left: 10px;">일괄평가</a>
<a href="#" class="f-r btn btn-default" onclick="downall();" style="margin-left: 20px;">일괄다운로드</a>
@Html.Partial("./Partial/sembtns", "#tbody1;" + (Model.IsAdmin ? "1;11;" : "0;0;0") + ";1;right;평가안내")
</div>
<div class="table-responsive" id="excel1">
<table class="table table-striped b-t b-light">
<thead>
<tr>
<th><input type="checkbox" onclick="javascript: checkall('excel1', this);" /></th>
<th width="20">No</th>
<th>구분</th>
<th>고객사</th>
<th>교육생(ID)</th>
<th>상태</th>
<th>점수</th>
<th>첨삭</th>
<th>모사</th>
<th>최근제출일(IP)</th>
<th>최근평가일(IP)</th>
</tr>
</thead>
<tbody class="data" id="tbody1">
@foreach (var d in Model.LectSDs)
{
<tr data-sdno="@d.sdno" data-lectno="@d.lectno">
<td><input type="checkbox" class="autocheck" value="@d.lectno" data-userno="@d.userno" /></td>
<td>@d.rnorvt</td>
<td>@d.isrebatename</td>
<td>@d.asname</td>
<td>@d.usernameid</td>
<td class="estate@(d.sdstate)">@d.sdstatename</td>
<td><a class="btn btn-xxs btn-select" onclick="viewsd(@d.sdno, @d.lectno, @(idx++))" href="#">@d.cpoint2</a></td>
<td>@d.feedbox</td>
<td><a class="btn btn-xxs btn-select iscopy@(d.iscopy)" onclick="viewcopy(@d.sdno, @d.lectno)" href="#">@d.copyratename</a></td>
<td>@Html.Raw(d.submittimeip)</td>
<td>@Html.Raw(d.checktimeip)</td>
</tr>
}
2020-10-12 14:39:23 +09:00
</tbody>
</table>
</div>
</section>
@Html.Partial("./Partial/dform", Model)
</form>
<div id="thisbox" class="findbox draggable regbox" style="height: 850px; width: 800px; z-index: 1041; top: 60px; overflow: auto;">
<form id="mform2" enctype="multipart/form-data">
<h4><i class="fa fa-bars"></i> <span id="pcap">개별 과제제출 내용</span><a href="#" class="btn btn-default btn-xs f-r closethisbox">닫기</a></h4>
<br />
@*<h5><i class="fa fa-bars"></i> 제목</h5>*@
2020-10-12 14:39:23 +09:00
<table class="regtable" id="exsummary">
<tr>
<th>제출자</th>
<td id="userinfo"></td>
</tr>
<tr>
2020-10-12 14:39:23 +09:00
<th>제출내용</th>
<td id="atext"></td>
</tr>
2020-10-12 14:39:23 +09:00
<tr>
<th>첨부파일</th>
<td>
<div id="fileinfoDiv" class="col-sm-8 col-md-10" style="width:100%;display:none">
@Html.Partial("./Partial/File", null, new ViewDataDictionary {
{ "name", "fgno" },{ "fname", "fgno"},
{"width", null },{ "column", "fgno"},{"filecount", 1 },
{"readmode", 0 },{"hidemode", 0 },
{ "isimage", 0 }, { "fileext", "" }})
</div>
<br />
<div id="fileinfo"></div>
</td>
2020-10-12 14:39:23 +09:00
</tr>
<tr>
<th>점수</th>
<td><input type="text" class="form-control int disp-init text-center" style="width: 70px;" max="3" id="cpoint" name="cpoint" onchange="checkmax(this)" /></td>
2020-10-12 14:39:23 +09:00
</tr>
<tr>
<th>피드백</th>
<td><textarea class="form-control" id="feedb" name="feedb" style="resize: none; height: 200px;" maxlength="800"></textarea></td>
</tr>
<tr>
<th>참고사항</th>
<td><textarea class="form-control" id="memo" name="memo" style="resize: none; height: 150px;" maxlength="800"></textarea></td>
2020-10-12 14:39:23 +09:00
</tr>
</table>
<br /><br /><br />
<div class="text-center">
<a href="#" id="btnpre" class="btn btn-info btn-xs" onclick="save(-1)">◀이전</a>
<a href="#" class="btn btn-primary btn-xs" onclick="save(0)">저장</a>
<a href="#" id="btnnext" class="btn btn-info btn-xs" onclick="save(1)">다음▶</a>
&nbsp;&nbsp;&nbsp;<a href="#" class="btn btn-default btn-xs closethisbox">닫기</a>
</div>
<br /><br />
<input type="hidden" id="sdno" name="sdno" value="">
<input type="hidden" id="lectno" name="lectno" value="">
<input type="hidden" id="tpoint" name="tpoint" value="">
<input type="hidden" id="ridx" name="ridx" value="">
<input type="hidden" id="iscopyVal" name="iscopy" value="">
<input type="hidden" id="cmno" name="cmno" value="">
<input type="hidden" id="userno" name="userno" value="">
</form>
2020-10-12 14:39:23 +09:00
</div>
<div id="thisbox2" class="findbox draggable regbox" style="width: 800px; z-index: 1041; top: 60px; overflow: auto;">
<h4><i class="fa fa-bars"></i> <span id="pcap">일괄평가</span><a href="#" class="btn btn-default btn-xs f-r closethisbox">닫기</a></h4>
<br />
<table class="regtable" id="exsummary2">
<tr>
<th>점수</th>
<td><input type="text" class="form-control int disp-init text-center" style="width: 70px;" max="3" id="cpoint2" onchange="checkmax(this)" /></td>
</tr>
<tr>
<th>피드백</th>
<td><textarea class="form-control" id="feedb2" style="resize: none; height: 250px;" maxlength="800"></textarea></td>
</tr>
</table>
※ 피드백은 1번 등록하면 수정할 수 없으며, 복사/붙여넣기가 불가능합니다.
<br /><br /><br />
<div class="text-center">
<a href="#" class="btn btn-primary btn-xs" onclick="savebatch()">저장</a>
&nbsp;&nbsp;&nbsp;<a href="#" class="btn btn-default btn-xs closethisbox">닫기</a>
</div>
<br /><br />
</div>
<style type="text/css">
td.estate0 {
background-color: #ffd7bb !important;
color: red;
}
td a.iscopy1 {
background-color: red !important;
}
.tablea0 {
word-break: break-all;
width: 100%;
}
.tablea0 tr td {
text-align: center;
}
.tablea0 tr td.qi {
text-align: left;
}
.regtable tr td .tablea0 tr td {
padding: 6px 5px;
}
2020-10-12 14:39:23 +09:00
/*#exsummary tr td{text-align: center;}*/
td.qi div.imgbox.active {
position: fixed;
left: 10%;
top: 10%;
height: 80%;
width: 80%;
z-index: 3000;
background-color: #999;
text-align: center;
padding-top: 10%;
}
td.qi div.imgbox.active img {
height: 60%;
max-width: 60%;
}
2020-10-12 14:39:23 +09:00
</style>
@Html.Partial("./Partial/FileScript")
2020-10-12 14:39:23 +09:00
<script>
2021-09-10 14:02:05 +09:00
var ischange = false;
2020-10-12 14:39:23 +09:00
$(document).ready(function () {
$("tr.ex" + ($("#addstringval").find("option").index($("#addstringval").find("option:selected")) + 1)).removeClass("hidden");
$("body").on("click", "td.qi div.imgbox", function () {
$(this).toggleClass("active");
});
$("#cpoint,#feedb,#feedb2,.file_input_opacity").on("propertychange change keyup paste input", function () {
2021-09-10 14:02:05 +09:00
ischange = true;
})
2021-05-25 13:39:38 +09:00
//$("#feedb,#feedb2").on("keydown", function (e) {
// if (e.keyCode == 17) {
// alert('기능키를 사용하실 수 없습니다.');
// $("body").focus();
// return false;
// }
//}).on("mousedown", function (e) {
// if (e.button == 2) {
// alert('마우스를 사용하실 수 없습니다.');
// $("body").focus();
// return false;
// }
// });
2020-10-12 14:39:23 +09:00
});
function findme() {
bglayer(); submit();
}
function changeex(s) {
$("tr.extr").addClass("hidden");
$("tr.ex" + ($(s).find("option").index($(s).find("option:selected")) + 1)).removeClass("hidden");
$("#tbody1 tr").remove();
getsds(false);
}
var _isprenext = false;
function getsds(isprenext) {
_isprenext = isprenext;
if (isprenext) {
$("#tbody1 tr").remove();
capp("/acommon/lectsds", { cmno: @Model.CM.cmno, sdno: $("#addstringval").val(), isrebate: valnull("addstringval2"), sdstate: valnull("addstringval3") }, "cblectsds", null, null, null, true);
} else {
capp("/acommon/lectsds", { cmno: @Model.CM.cmno, sdno: $("#addstringval").val(), isrebate: valnull("addstringval2"), sdstate: valnull("addstringval3") }, "cblectsds");
}
}
function cblectsds() {
$.each(capResult.obj, function (i, d) {
$("#tbody1").append(("<tr data-sdno=\"{8}\" data-lectno=\"{0}\">" +
"<td><input type=\"checkbox\" class=\"autocheck\" value=\"{0}\" data-userno=\"{1}\" /></td>" +
"<td>{2}</td>" +
"<td>{3}</td>" +
"<td>{4}</td>" +
"<td>{5}</td>" +
"<td class=\"estate{6}\">{7}</td>" +
"<td><a class=\"btn btn-xxs btn-select viewsd\" onclick=\"viewsd({8}, {0}, {15})\" href=\"#\">{9}</a></td>" +
"<td>{10}</td>" +
"<td><a class=\"btn btn-xxs btn-select iscopy{11}\" onclick=\"viewcopy({8}, {0})\" href=\"#\">{12}</a></td>" +
"<td>{13}</td>" +
"<td>{14}</td>").format(d.lectno, d.userno, d.rnorvt, d.isrebatename, d.asname
, d.usernameid, d.sdstate, d.sdstatename, d.sdno, d.cpoint2
, d.feedbox, d.iscopy, d.copyratename, d.submittimeip, d.checktimeip, (i+1)));
});
if (_isprenext) {
viewsd($("#tbody1 tr:eq(" + (_ridx + _saveidx - 1) + ")").attr("data-sdno"), $("#tbody1 tr:eq(" + (_ridx + _saveidx - 1) + ")").attr("data-lectno"), _ridx + _saveidx);
}
}
var _sdno = 0;
var _lectno = 0;
var _ridx=0;
function viewsd(sdno, lectno, ridx) {
2021-09-10 14:02:05 +09:00
ischange = false;
2020-10-12 14:39:23 +09:00
_sdno = sdno;
_lectno = lectno;
_ridx = ridx;
$("#sdno").val(sdno);
$("#lectno").val(lectno);
$("#ridx").val(ridx);
2020-10-12 14:39:23 +09:00
capp("/acommon/lectsd", { lectno: lectno, sdno: sdno }, "cblectsd");
}
function cblectsd() {
var d = capResult.obj;
$("#userinfo").text("[{0}]{1} | {2}".format(d.isrebatename, d.asname, d.usernameid));
if (getdb(d.atext) == "") {
$("#atext").html("- 미제출");
} else {
$("#atext").html(getdb(d.atext).replace(/\n/gi, "<br />"));
}
2020-10-12 14:39:23 +09:00
var _html = "- 제출파일 없음<br />";
if (getdb(d.fileurl) != "") {
// _html = "<a href=\"/aCommon/DownFile?fno={0}&loginfo=&issubject=1\" title=\"다운로드\"><i class=\"fa fa-paperclip\"></i> <span class=\"fileitem\">{1}</span></a><br />".format(d.fileno, d.orgname);
_html = '<div id="file{0}div"><a href="/aCommon/DownFile?fno={0}&loginfo=&issubject=1" title="다운로드"><i class="fa fa-paperclip"></i> <span class="fileitem">{1}</span></a>'.format(d.fileno, d.orgname);
_html += '<a href="#" style="color:red;margin-left:5px;cursor:point" onclick="fileDel(this)" data-fileno="{0}" data-filename="{1}">X</a>'.format(d.fileno, d.orgname);
_html += '</div><br />'
$("#fileinfoDiv .fgno").val(d.fgno)
$("#fileinfoDiv").css("display", "none")
}
else {
$("#fileinfoDiv").css("display", "")
2020-10-12 14:39:23 +09:00
}
_html += "(모사율: {0})&nbsp;&nbsp;&nbsp;".format(d.copyratename);
$("#fileinfo").html(_html + ("<label><input id=\"iscopy\" type=\"checkbox\" " + (d.iscopy == 1 ? "checked" : "") + " /> 모사답안신고</label>"));
setv("userno", d.userno);
setv("cmno", d.cmno);
2020-10-12 14:39:23 +09:00
setv("cpoint", d.cpoint);
//$("#feedb").val(d.feedb);
if (d.feedb != null) {
$("#feedb").val(d.feedb);
}
else {
$("#feedb").val("");
}
if (d.memo != null) {
$("#memo").val(d.memo);
}
else {
$("#memo").val("");
}
2020-10-12 14:39:23 +09:00
$("#feedb").removeAttr("readonly");
2021-05-25 13:39:38 +09:00
//if (getdb(d.feedb) != '') {
// $("#feedb").attr("readonly", "readonly");
//}
2020-10-12 14:39:23 +09:00
$("#btnpre,#btnnext").show();
if (_ridx == 1) {
$("#btnpre").hide();
}
if (_ridx == $("#tbody1 tr").length) {
$("#btnnext").hide();
}
2020-10-12 14:39:23 +09:00
setTimeout(function () {
bglayer(); $("#thisbox").slideDown("fast", function () { $("#thisbox").scrollTop(0); });
bglayer2(false);
$("#cpoint").focus();
}, 10);
}
var _saveidx = 0;
function save(idx) {
2021-09-10 14:02:05 +09:00
if (idx != 0 && ischange == false) {
2020-10-12 14:39:23 +09:00
_saveidx = idx;
2021-09-10 14:02:05 +09:00
hidelayermsg2(true);
getsds(true);
} else {
if (getint($("#cpoint").val()) < 0) {
$("#cpoint").focus();
msg2("0점 이상으로 입력해주세요.");
} else if (getint($("#cpoint").val()) > getint($("#addstringval").find("option:selected").attr("data-tpoint"))) {
$("#cpoint").focus();
msg2(getint($("#addstringval").find("option:selected").attr("data-tpoint")) + "점 이하으로 입력해주세요.");
} else if (confirm("저장하시겠습니까?")) {
_saveidx = idx;
//capp("/acommon/lectsdsave", { lectno: _lectno, sdno: val("addstringval"), iscopy: $("#iscopy").prop("checked") ? 1 : 0, cpoint: val("cpoint"), feedb: val("feedb") }, "cbsave", null, null, null, true);
$("#iscopyVal").val($("#iscopy").prop("checked") ? 1 : 0)
capfileform("/acommon/LectSDSaveToAdmin", "mform2", "cbsave");
2021-09-10 14:02:05 +09:00
}
2020-10-12 14:39:23 +09:00
}
}
function cbsave() {
if (capResult.code == 1000) {
//if (_saveidx == 0) {
// //msg2("저장했습니다.", null, null, null, true);
// msg2("저장했습니다.");
// viewsd(_sdno, _lectno, _ridx);
// //submit("mform", 500);
//} else {
// //리스트 갱신 후 다음 또는 이전 수강생과제 표시
// msg2("저장했습니다.", null, null, null, true);
// setTimeout(function () {
// hidelayermsg2(true);
// getsds(true);
// }, 300);
//}
msg2("저장했습니다.");
$(".file_input_opacity").val("")
$(".file_input_textbox").val("")
2020-10-12 14:39:23 +09:00
if (_saveidx == 0) {
viewsd(_sdno, _lectno, _ridx);
}
else {
ischange = false;
save(_saveidx)
2020-10-12 14:39:23 +09:00
}
//submit("mform", 500);
2020-10-12 14:39:23 +09:00
} else {
msgdev(true);
}
}
function batchsd() {
var lectnos = "";
$.each($("#tbody1 tr td input.autocheck:checked"), function () {
lectnos += "," + $(this).val();
});
if (lectnos == "") {
msg("일괄평가할 대상자를 선택해주세요.");
} else {
setv("cpoint2", "");
setv("feedb2", "");
bglayer(); $("#thisbox2").slideDown("fast", function () { $("#thisbox2").scrollTop(0); });
$("#cpoint2").focus();
}
}
function savebatch() {
var lectnos = "";
$.each($("#tbody1 tr td input.autocheck:checked"), function () {
lectnos += "," + $(this).val();
});
if (lectnos == "") {
msg("일괄평가할 대상자를 선택해주세요.");
} else if (check("cpoint2", null, "점수를 입력해주세요.", true, true)) {
2020-10-12 14:39:23 +09:00
} else if (getint($("#cpoint2").val()) < 0) {
$("#cpoint2").focus();
msg2("0점 이상으로 입력해주세요.");
} else if (getint($("#cpoint2").val()) > getint($("#addstringval").find("option:selected").attr("data-tpoint"))) {
$("#cpoint2").focus();
msg2(getint($("#addstringval").find("option:selected").attr("data-tpoint"))+"점 이하으로 입력해주세요.");
}
else if (check("feedb2", null, "피드백 내용을 입력해주세요.", true, true)) { }
else if (confirm("선택한 대상자를 일괄평가하시겠습니까?")) {
capp("/acommon/lectsdsave", { cmno: @Model.CM.cmno, lectnos: lectnos.substr(1), cpoint: val("cpoint2"), sdno: val("addstringval"), feedb: val("feedb2") }, "cblectsdsave", null, null, null, true);
}
}
function cblectsdsave() {
if (capResult.code == 1000) {
msg2("일괄평가했습니다.", null, null, null, true);
submit("mform", 500);
} else {
msgdev(true);
}
}
function downall() {
$("#ifrthis").attr("src", "/acommon/lectsdzip?cmno=@(Model.CM.cmno)&classno=@(Model.CM.classno)&sdno=" + val("addstringval"));
}
function checkmax(p) {
if (getint($(p).val()) < 0) {
$(p).focus();
msg2("0점 이상으로 입력해주세요.");
2020-10-12 14:39:23 +09:00
} else if (getint($(p).val()) > getint($("#addstringval").find("option:selected").attr("data-tpoint"))) {
$(p).focus();
msg2(getint($("#addstringval").find("option:selected").attr("data-tpoint"))+"점 이하으로 입력해주세요.");
}
}
2021-03-22 10:55:59 +09:00
function viewcopy(sdno,lectno) {
var winl = (screen.width - 840) / 2;
var wint = (screen.height - 410) / 2;
var opt = 'height=410, width=840, top=' + wint + ', left=' + winl + ',location=no, noresizable';
window.open("http://118.219.255.225:7614/memechecker/score.html?domain=v_lectsd_list&docId="+sdno+"_"+lectno, "iscopyWin", opt);
}
var fileDivId = "";
function fileDel(obj) {
let fileno = $(obj).data("fileno")
let filename = $(obj).data("filename")
fileDivId = "file" + fileno + "div";
let data = { "key": fileno, "fName": filename }
if (confirm("파일을 삭제하시겠습니까?")) {
capp("/acommon/deletefile", data, "fileDelResult");
}
}
function fileDelResult() {
if (capOK) {
let fileDivObj = $("#" + fileDivId)
if (fileDivObj.length == 1) {
fileDivObj.remove();
$("#fileinfoDiv").css("display", "")
let sdno = $("#sdno").val();
let lectno = $("#lectno").val();
capp("/acommon/delfileOk", { lectno: lectno, sdno: sdno }, "afterView");
}
}
else {
msg("파일을 삭제할 수 없습니다.");
}
}
function afterView() {
viewsd(_sdno, _lectno, _ridx);
}
2020-10-12 14:39:23 +09:00
</script>
<iframe id="ifrthis" style="display: none;"></iframe>