匿评设置的调整

This commit is contained in:
cxt 2016-11-02 15:19:17 +08:00
parent 4e267c22b3
commit 54f45f18a5
9 changed files with 144 additions and 67 deletions

View File

@ -390,7 +390,14 @@ class HomeworkCommonController < ApplicationController
@homework_detail_manual.evaluation_end = params[:evaluation_end]
end
evaluation_num = @homework_detail_manual.evaluation_num
if params[:evaluation_limit].to_i == 1
@homework_detail_manual.evaluation_num = params[:evaluation_num]
@homework_detail_manual.absence_penalty = evaluation_num == -1 ? 5 : @homework_detail_manual.absence_penalty
else
@homework_detail_manual.evaluation_num = -1
@homework_detail_manual.absence_penalty = 0
end
@homework_detail_manual.save
@user_activity_id = params[:user_activity_id].to_i
@hw_status = params[:hw_status].to_i

View File

@ -1,53 +1,84 @@
<div class="markPopup" id="popbox02">
<div id="muban_popup_box" style="width:550px;">
<%= form_for('new_form',:url => {:controller => 'homework_common',:action => 'set_evaluation_attr',:homework => @homework.id,:user_activity_id=>user_activity_id,:hw_status=>hw_status},:method => "post",:remote => true) do |f|%>
<span class="uploadText">匿评设置</span>
<div class="muban_popup_top">
<h3 class="fl">匿评设置</h3>
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
<div class="cl"></div>
</div>
<div class="mt15">
<span class="f14 fontGrey3 fl mt5">开启匿评</span>
<div class="calendar_div fl ml10">
<div class="muban_popup_con clear">
<div class="clear mt15 ml20">
<ul class="pro_newsetting_con fl">
<li class="mb10 clear">
<label class="fl pop_box_label">开启匿评&nbsp;&nbsp;:&nbsp;</label>
<div class="calendar_div fl">
<input type="text" name="evaluation_start" id="evaluation_start_time" placeholder="开启匿评日期" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= @homework_detail_manual.evaluation_start%>"/>
<%#= calendar_for('evaluation_start_time')%>
</div>
<div class="cl"></div>
<p id="homework_evaluation_start_time" class="c_red"></p>
</div>
<div class="cl"></div>
<div class="mt15">
<span class="f14 fontGrey3 fl mt5">关闭匿评</span>
<div class="calendar_div fl ml10">
<p id="homework_evaluation_start_time" class="ml38 c_red"></p>
</li>
<li class="mb10 clear">
<label class="fl pop_box_label">关闭匿评&nbsp;&nbsp;:&nbsp;</label>
<div class="calendar_div fl">
<input type="text" name="evaluation_end" id="evaluation_end_time" placeholder="关闭匿评日期" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= @homework_detail_manual.evaluation_end%>"/>
<%#= calendar_for('evaluation_end_time')%>
</div>
<div class="cl"></div>
<p id="homework_evaluation_end_time" class="c_red"></p>
</div>
<p id="homework_evaluation_end_time" class="ml38 c_red"></p>
</li>
<li class="mb10 clear">
<label class="fl pop_box_label">&nbsp;匿评人数&nbsp;&nbsp;:&nbsp;</label>
<input type="radio" class="fl" value="1" name="evaluation_limit" id="limit"/>
<label for="limit" class="fl ml5">限定</label>
<input type="text" name="evaluation_num" id="evaluation_num" maxlength="2" class="radio-width90 fl ml10" value="<%= @homework_detail_manual.evaluation_num == -1 ? 3 : @homework_detail_manual.evaluation_num%>"/>
<div class="cl"></div>
<div class="mt15 mb10">
<span class="f14 fontGrey3 mr10 fl mt5">匿评人数</span>
<input type="text" name="evaluation_num" id="evaluation_num" placeholder="默认匿评人数为3" maxlength="2" class="markInput fl" value="<%= @homework_detail_manual.evaluation_num%>"/>
<p id="evaluation_num_notice" class="c_red ml100"></p>
</li>
<li class="mb10 clear">
<label class="fl pop_box_label">&nbsp;&nbsp;</label>
<input type="radio" class="fl" value="0" name="evaluation_limit" id="no_limit"/>
<label for="no_limit" class="fl ml5">不限定</label>
</li>
</ul>
<ul class="fl ml35">
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>
<p >系统自动开启匿评的时间</p>
</div>
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>
<p >系统自动关闭匿评的时间</p>
</div>
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>
<p >作品供指定数量的学生评阅</p>
</div>
<div class="popup_tip_box fontGrey2">
<em></em>
<span></span>
<p>作品供全部的学生评阅<br/>缺评扣分将被置零</p>
</div>
</ul>
<div class="cl"></div>
<p id="evaluation_num_notice" class="c_red"></p>
<div class="alert alert-orange mb15 ml30 mr80 mt10">
注意:开启匿评时尚未提交作品的同学,将不参与匿评
</div>
<div class="cl"></div>
<div class="mb20 none">
<span class="f14 fontGrey3 mr10">禁用匿评</span>
<input type="checkbox" />
<span class="f12 c_red ml10">禁用后将无法进行学生互评</span>
</div>
<div class="cl"></div>
<div>
<div class="courseSendSubmit">
<a href="javascript:void(0);" class="sendSourceText" onclick="submit_set_evaluation_attr('<%= @homework.end_time%>');">确定</a>
</div>
<div class="courseSendCancel">
<a href="javascript:void(0);" class="sendSourceText linkGrey6" onclick="hideModal();">取消</a>
<a href="javascript:void(0);" class="fr sy_btn_blue mr80" onclick="submit_set_evaluation_attr('<%= @homework.end_time%>');">确定</a>
<a href="javascript:void(0);" class="fr sy_btn_grey mr5" onclick="hideModal();">取消</a>
</div>
</div>
<div class="cl"></div>
<% end%>
</div>
<script>
$(function(){
<% if @homework_detail_manual.evaluation_num != -1 %>
$("#limit").attr("checked", "checked");
<% else %>
$("#no_limit").attr("checked", "checked");
<% end %>
});
</script>

View File

@ -1,4 +1,4 @@
clickCanel();
hideModal();
<% if @hw_status == 5 %>
$("#homework_post_brief").html("<%= escape_javascript(render :partial => 'student_work/homework_post_brief', :locals => {:homework => @homework, :is_teacher => @is_teacher}) %>");
<% else %>

View File

@ -1,10 +1,12 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'homework_common/set_evalutation_att',:locals => {:user_activity_id => @user_activity_id,:hw_status => @hw_status,:remote=>true}) %>');
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_evalutation_att',:locals => {:user_activity_id => @user_activity_id,:hw_status => @hw_status,:remote=>true}) %>";
pop_box_new(htmlvalue, 620, 315);
//$('#ajax-modal').html('<%#= escape_javascript(render :partial => 'homework_common/set_evalutation_att',:locals => {:user_activity_id => @user_activity_id,:hw_status => @hw_status,:remote=>true}) %>');
var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: 0, showOn: 'button', buttonImageOnly: true, buttonImage: '/images/public_icon.png', showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true};
showModal('ajax-modal', '350px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
"<a href='javascript:' onclick='hideModal();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed").css("border","3px solid #269ac9");
//showModal('ajax-modal', '350px');
//$('#ajax-modal').siblings().remove();
//$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
//"<a href='javascript:' onclick='hideModal();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
//$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed").css("border","3px solid #269ac9");
$(function() { $('#evaluation_start_time').datepicker(datepickerOptions);
$('#evaluation_end_time').datepicker(datepickerOptions);
});

View File

@ -423,6 +423,9 @@ function showModal(id, width) {
}
function hideModal(el) {
if($("#popupWrap").length > 0){
$("#popupWrap").hide();
}
var modal;
if (el) {
modal = $(el).parents('.ui-dialog-content');
@ -1554,13 +1557,24 @@ function pop_up_box(value,tWidth,tTop,tLeft){
function pop_box_new(value, Width, Height){
w = ($(window).width() - Width)/2;
h = ($(window).height() - Height)/2;
$("#ajax-modal").html(value);
showModal('ajax-modal', Width + 'px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').parent().css({"top": h+"px","left": w+"px","padding":"0","border":"none","position":"fixed"});
$('#ajax-modal').parent().removeClass("resourceUploadPopup popbox_polls popbox");
$('#ajax-modal').css({"padding":"0","overflow":"hidden"});
$('#ajax-modal').parent().attr("id","popupWrap");
var container =$('<div></div>');
container.attr('id','popupWrap');
$(document.body).append(container);
$("#popupWrap").html(value);
$("#popupWrap").show();
$('#popupWrap').css({"top": h+"px","left": w+"px","padding":"0","border":"none","position":"fixed","z-index":"99999"});
$('#popupWrap').find("a[class*='close']").click(function(){
$("#popupWrap").hide();
});
// w = ($(window).width() - Width)/2;
// h = ($(window).height() - Height)/2;
// $("#ajax-modal").html(value);
// showModal('ajax-modal', Width + 'px');
// $('#ajax-modal').siblings().remove();
// $('#ajax-modal').parent().css({"top": h+"px","left": w+"px","padding":"0","border":"none","position":"fixed"});
// $('#ajax-modal').parent().removeClass("resourceUploadPopup popbox_polls popbox");
// $('#ajax-modal').css({"padding":"0","overflow":"hidden"});
// $('#ajax-modal').parent().attr("id","popupWrap");
//拖拽
function Drag(id) {
@ -1576,7 +1590,7 @@ function pop_box_new(value, Width, Height){
_this.getDistance(evt);
document.onmousemove = function (evt) {
_this.setPosition(evt);
}
};
_this.div.onmouseup = function () {
_this.clearEvent();
}
@ -1586,7 +1600,7 @@ function pop_box_new(value, Width, Height){
var oEvent = evt || event;
this.disX = oEvent.clientX - this.div.offsetLeft;
this.disY = oEvent.clientY - this.div.offsetTop;
}
};
Drag.prototype.setPosition = function (evt) {
var oEvent = evt || event;
var l = oEvent.clientX - this.disX;
@ -1605,18 +1619,24 @@ function pop_box_new(value, Width, Height){
}
this.div.style.left = l + "px";
this.div.style.top = t + "px";
}
};
Drag.prototype.clearEvent = function () {
this.div.onmouseup = null;
document.onmousemove = null;
}
};
$(".sy_popup_con").mousedown(function(event){
new Drag("popupWrap");
$("#popupWrap input, #popupWrap textarea").mousedown(function(event){
event.stopPropagation();
new Drag("popupWrap");
});
}
function close_modal(){
$("#popupWrap").hide();
}
// 公共提示弹框样式
//function pop_box_tip_new(value, Width, Top, Left){
// $("#ajax-modal").html(value);

View File

@ -650,7 +650,7 @@ function submit_set_evaluation_attr(end_time){
$("#evaluation_num").focus();
}
else{
$('#popbox02 form').submit();
$('#muban_popup_box form').submit();
}
}

View File

@ -165,6 +165,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.mr60 {margin-right:60px;}
.mr65 {margin-right:65px;}
.mr70{margin-right: 70px;}
.mr80{margin-right: 80px;}
.mr95 {margin-right:95px !important;}
.mr100 {margin-right:100px !important;}
.mr118 {margin-right:118px !important;}

View File

@ -3,7 +3,10 @@
.muban_popup_top{background:#3b94d6;height:40px;-webkit-border-radius: 5px 5px 0px 0px;-moz-border-radius: 5px 5px 0px 0px;-o-border-radius: 5px 5px 0px 0px;border-radius: 5px 5px 0px 0px;}
.muban_popup_top h3{ font-size:16px; color:#fff; font-weight:normal; line-height:40px; padding-left:10px; }
a.muban_icons_close{width:20px; height:20px;display:block;background: url(/images/sy/sy_icons_close.png) 0 0px no-repeat; margin:8px 10px 0 0;}
a:hover.muban_icons_close{background: url(/images/sy/sy_icons_close.png) -40px 0px no-repeat;}
a:hover.muban_icons_close{background: url(../images/sy/sy_icons_close.png) -40px 0px no-repeat;}
#muban_popup_box input,#muban_popup_box select{ border:1px solid #c8c8c8; height: 28px; color: #888;}
#muban_popup_box label.pop_box_label{width: 100px; text-align: right; display: inline-block;}
input.radio-width90{ width: 90px; }
/*模板表格 20161013byLB*/
.muban_table{ width:100%; background:#fff; border:1px solid #e5e5e5; border-bottom: none; }
.muban_table thead tr{ height:40px; line-height:40px;}
@ -57,3 +60,11 @@ a.sub_btn{ cursor:pointer; -moz-border-radius:3px; -webkit-border-radius:3px; b
a:hover.sub_btn{ background:#b5e2fa; color:#000; border:1px solid #3c7fb1;}
/*模板form 20161013byLB*/
textarea.muban_textarea{ width: 98.5%;border:1px solid #ddd; background:#fff; color:#666; padding:5px;}
/*模板图标20161020byLB*/
.muban-icons-clock{ background: url("../images/project/icons_issue.png") 0 -224px no-repeat; display: inline-block; width: 19px; height: 13px;}
/*提示条20161020byLB*/
.alert{ padding:10px;border: 1px solid transparent; text-align: center;}
.alert-blue{ background-color: #d9edf7;border-color: #bce8f1; color: #3a87ad;}
.alert-orange{ background-color: #fff9e9;border-color: #f6d0b1; color:#ee4a20;}
.close{padding: 0;cursor: pointer; background: transparent; border: 0; -webkit-appearance: none; font-size: 21px; font-weight: bold;line-height: 1; color: #000000; text-shadow: 0 1px 0 #ffffff; opacity: 0.3;}
.close:hover{opacity: 0.5;}

View File

@ -1518,3 +1518,8 @@ a.syllabusbox_a_blue{
.homepagePostContainer {width:718px; border:1px solid #dddddd; padding:15px; background-color:#ffffff;}
.homepageMainContent {margin: 10px auto; width: 750px;}
.pro_newsetting_con li{ line-height: 30px;}
.popup_tip_box { position: relative; padding: 5px 10px; white-space: nowrap; background-color: #FFFEF4; border:1px solid #F3DDB3;}
.popup_tip_box em { display: block; border-width: 9px; position: absolute; top: 5px; left: -18px; border-style: dashed solid dashed dashed; border-color: transparent #F3DDB3 transparent transparent; font-size: 0; line-height: 0;}
.popup_tip_box span { display: block; border-width: 9px;position: absolute; top: 5px; left: -17px; border-style: dashed solid dashed dashed;border-color: transparent #FFFEF4 transparent transparent; font-size: 0; line-height: 0; }