作业设置改成整页保存
This commit is contained in:
parent
fef0854624
commit
adc677b0d8
|
|
@ -8,8 +8,7 @@ class HomeworkCommonController < ApplicationController
|
|||
before_filter :find_course, :only => [:index,:new,:create]
|
||||
before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy,:start_evaluation_set,
|
||||
:set_evaluation_attr,:score_rule_set,:alert_forbidden_anonymous_comment,:alert_open_student_works,:open_student_works,
|
||||
:set_score_open,:alert_score_open_modal,:add_to_homework_bank,:publish_homework,:setting,:publish_setting,:late_setting,
|
||||
:anon_setting,:score_setting,:public_setting,:set_public]
|
||||
:set_score_open,:alert_score_open_modal,:add_to_homework_bank,:publish_homework,:setting,:set_public,:homework_setting]
|
||||
before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment,
|
||||
:start_evaluation_set,:set_evaluation_attr,:score_rule_set,:alert_forbidden_anonymous_comment,:alert_open_student_works,
|
||||
:open_student_works,:add_to_homework_bank,:publish_homework]
|
||||
|
|
@ -207,32 +206,24 @@ class HomeworkCommonController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def publish_setting
|
||||
def homework_setting
|
||||
@homework.publish_time = params[:homework_publish_time] if params[:homework_publish_time]
|
||||
@homework.end_time = params[:homework_end_time] if params[:homework_end_time]
|
||||
@homework.archive_time = params[:homework_archive_time] if params[:homework_archive_time]
|
||||
@homework.save
|
||||
@is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course))
|
||||
respond_to do |format|
|
||||
format.js
|
||||
if @homework.archive_time < Time.now && @homework_detail_manual.comment_status < 6
|
||||
@homework_detail_manual.comment_status = 6
|
||||
elsif @homework.archive_time > Time.now && @homework_detail_manual.comment_status == 6
|
||||
@homework_detail_manual.comment_status = 5
|
||||
end
|
||||
end
|
||||
|
||||
def late_setting
|
||||
if params[:homework_allow_late] == '1'
|
||||
@homework.allow_late = true
|
||||
#@homework.late_time = params[:homework_late_time]
|
||||
@homework.late_penalty = params[:homework_late_penalty].to_i
|
||||
else
|
||||
@homework.allow_late = false
|
||||
#@homework.late_time = nil
|
||||
@homework.late_penalty = 0
|
||||
end
|
||||
@homework.save
|
||||
@is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course))
|
||||
end
|
||||
|
||||
def anon_setting
|
||||
anonymous_comment = @homework.anonymous_comment
|
||||
absence_penalty = @homework_detail_manual.absence_penalty
|
||||
appeal_penalty = @homework_detail_manual.appeal_penalty
|
||||
|
|
@ -291,12 +282,7 @@ class HomeworkCommonController < ApplicationController
|
|||
student_work.save
|
||||
end
|
||||
end
|
||||
@homework.save
|
||||
@homework_detail_manual.save
|
||||
@is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course))
|
||||
end
|
||||
|
||||
def score_setting
|
||||
if params[:homework_ta_mode] && @homework_detail_manual.ta_mode.to_i != params[:homework_ta_mode].to_i
|
||||
@homework_detail_manual.ta_mode = params[:ta_mode].to_i
|
||||
@homework_detail_manual.save
|
||||
|
|
@ -346,21 +332,7 @@ class HomeworkCommonController < ApplicationController
|
|||
end
|
||||
end
|
||||
end
|
||||
# @homework_detail_manual.ta_mode = params[:homework_ta_mode].to_i
|
||||
# @homework_detail_manual.final_mode = params[:homework_final_mode].to_i == 1 ? false : true
|
||||
# unless @homework_detail_manual.final_mode
|
||||
# @homework_detail_manual.te_proportion = params[:te_proportion]
|
||||
# @homework_detail_manual.ta_proportion = params[:ta_proportion]
|
||||
# if @homework.homework_type == 2
|
||||
# @homework_detail_programing.ta_proportion = params[:sy_proportion]
|
||||
# end
|
||||
# end
|
||||
# @homework_detail_manual.save
|
||||
# @homework_detail_programing.save if @homework_detail_programing
|
||||
@is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course))
|
||||
end
|
||||
|
||||
def public_setting
|
||||
if @homework.homework_type == 4
|
||||
@homework.score_open = params[:homework_score_open] ? 1 : 0
|
||||
else
|
||||
|
|
@ -369,7 +341,8 @@ class HomeworkCommonController < ApplicationController
|
|||
@homework.answer_public = params[:homework_answer_public] ? 1 : 0
|
||||
end
|
||||
@homework.save
|
||||
@is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course))
|
||||
@homework_detail_manual.save
|
||||
redirect_to setting_homework_common_path(@homework)
|
||||
end
|
||||
|
||||
def edit
|
||||
|
|
|
|||
|
|
@ -1,11 +1,8 @@
|
|||
<div class="edu-con-top clearfix mb15">
|
||||
<p class="ml15 fl">匿评设置</p>
|
||||
<a href="javascript:void(0);" class="link-color-grey fr font-16 " id="anon_setting_form_submit" title="保存"><i class="fa fa-floppy-o mr15"></i></a>
|
||||
<a href="javascript:void(0);" class="link-color-grey fr font-16 " onclick="setting_cancel_edit('anon_cancel_edit');" title="取消"><i class="fa fa-times mr15"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ml30 mr30">
|
||||
<div class="clearfix">
|
||||
<%= form_tag(anon_setting_homework_common_path(@homework), :remote => true, :method => "post", :id => 'anon_setting_form') do |f| %>
|
||||
<ul>
|
||||
<li class="clearfix edu-position">
|
||||
<label class="panel-form-label fl mr10"> </label>
|
||||
|
|
@ -69,6 +66,5 @@
|
|||
<span class="color-orange fl ml20 mt5 none" id="homework_appeal_penalty_notice"><i class="fa fa-exclamation-circle mr5 color-orange"></i></span>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,11 +1,8 @@
|
|||
<div class="edu-con-top clearfix mb15">
|
||||
<p class="ml15 fl">补交设置</p>
|
||||
<a href="javascript:void(0);" class="link-color-grey fr font-16 " id="late_setting_form_submit" title="保存"><i class="fa fa-floppy-o mr15"></i></a>
|
||||
<a href="javascript:void(0);" class="link-color-grey fr font-16 " onclick="setting_cancel_edit('late_cancel_edit');" title="取消"><i class="fa fa-times mr15"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ml30 mr30" style="padding-bottom:20px;">
|
||||
<div class="clearfix">
|
||||
<%= form_tag(late_setting_homework_common_path(@homework), :remote => true, :method => "post", :id => 'late_setting_form') do |f| %>
|
||||
<ul >
|
||||
<li class="clearfix mb20 edu-position">
|
||||
<label class="panel-form-label fl mr10">作品补交</label>
|
||||
|
|
@ -34,6 +31,5 @@
|
|||
<span class="color-orange fl ml20 mt5 none" id="homework_late_penalty_notice"><i class="fa fa-exclamation-circle mr5 color-orange"></i></span>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -6,12 +6,9 @@
|
|||
|
||||
<div class="edu-con-top clearfix mb15">
|
||||
<p class="ml15 fl">公开设置</p>
|
||||
<a href="javascript:void(0);" class="link-color-grey fr font-16 " id="public_setting_form_submit" title="保存"><i class="fa fa-floppy-o mr15"></i></a>
|
||||
<a href="javascript:void(0);" class="link-color-grey fr font-16 " onclick="setting_cancel_edit('public_cancel_edit');" title="取消"><i class="fa fa-times mr15"></i></a>
|
||||
</div>
|
||||
<div class="ml30 mr30">
|
||||
<div class="clearfix">
|
||||
<%= form_tag(public_setting_homework_common_path(@homework), :remote => true, :method => "post", :id => 'public_setting_form') do |f| %>
|
||||
<ul>
|
||||
<% if @homework.homework_type != 4 %>
|
||||
<li class="clearfix">
|
||||
|
|
@ -36,6 +33,5 @@
|
|||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,12 +1,9 @@
|
|||
<div class="edu-con-top clearfix mb15">
|
||||
<p class="ml15 fl">发布设置</p>
|
||||
<a href="javascript:void(0);" class="link-color-grey fr font-16" id="publish_setting_form_submit" title="保存"><i class="fa fa-floppy-o mr15"></i></a>
|
||||
<a href="javascript:void(0);" class="link-color-grey fr font-16" onclick="setting_cancel_edit('publish_cancel_edit');" title="取消"><i class="fa fa-times mr15"></i></a>
|
||||
</div>
|
||||
<div class="ml30 mr30">
|
||||
<div class="clearfix">
|
||||
<ul>
|
||||
<%= form_tag(publish_setting_homework_common_path(@homework), :remote => true, :method => "post", :id => 'publish_setting_form') do |f| %>
|
||||
<li class="clearfix mb15 edu-position">
|
||||
<label class="panel-form-label fl mr10">发布时间</label>
|
||||
<input type="text" name="homework_publish_time" readonly value="<%=format_time @homework.publish_time %>" <%= @homework.homework_detail_manual.try(:comment_status) > 0 ? 'disabled' : '' %> class="fl task-form-15 task-height-40 panel-box-sizing <%= @homework.homework_detail_manual.try(:comment_status) > 0 ? 'disabled-bg' : '' %>" placeholder="<%= Time.parse((Time.now + 1.days).to_s).strftime("%Y-%m-%d") %> 00:00"/>
|
||||
|
|
@ -44,7 +41,6 @@
|
|||
<p>结束之后,系统自动归档作业</p>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,11 +1,8 @@
|
|||
<div class="edu-con-top clearfix mb15">
|
||||
<p class="ml15 fl">评分设置</p>
|
||||
<a href="javascript:void(0);" class="link-color-grey fr font-16 " id="score_setting_form_submit" title="保存"><i class="fa fa-floppy-o mr15"></i></a>
|
||||
<a href="javascript:void(0);" class="link-color-grey fr font-16 " onclick="setting_cancel_edit('score_cancel_edit');" title="取消"><i class="fa fa-times mr15"></i></a>
|
||||
</div>
|
||||
<div class="ml30 mr30">
|
||||
<div class="clearfix">
|
||||
<%= form_tag(score_setting_homework_common_path(@homework), :remote => true, :method => "post", :id => 'score_setting_form') do |f| %>
|
||||
<ul>
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl mr10">助教评分</label>
|
||||
|
|
@ -124,6 +121,5 @@
|
|||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,8 +1,5 @@
|
|||
<div class="edu-con-top clearfix mb15">
|
||||
<p class="ml15 fl">匿评设置</p>
|
||||
<% if @is_teacher %>
|
||||
<a href="javascript:void(0);" class="link-color-grey fr font-16 " title="编辑" onclick="$('#edit_anon_setting').show(); $('#show_anon_setting').hide();"><i class="fa fa-pencil mr15"></i></a>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="ml30 mr30">
|
||||
<div class="clearfix">
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
<div class="edu-con-top clearfix mb15">
|
||||
<p class="ml15 fl">补交设置</p>
|
||||
<% if @is_teacher %>
|
||||
<a href="javascript:void(0);" class="link-color-grey fr font-16 " title="编辑" onclick="$('#edit_late_setting').show(); $('#show_late_setting').hide();"><i class="fa fa-pencil mr15"></i></a>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="ml30 mr30" style="padding-bottom:20px;">
|
||||
<div class="clearfix">
|
||||
|
|
|
|||
|
|
@ -9,9 +9,6 @@
|
|||
</style>
|
||||
<div class="edu-con-top clearfix mb15">
|
||||
<p class="ml15 fl">公开设置</p>
|
||||
<% if @is_teacher %>
|
||||
<a href="javascript:void(0);" class="link-color-grey fr font-16" title="编辑" onclick="$('#edit_public_setting').show(); $('#show_public_setting').hide();"><i class="fa fa-pencil mr15"></i></a>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="ml30 mr30">
|
||||
<div class="clearfix">
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<div class="edu-con-top clearfix mb15">
|
||||
<p class="ml15 fl">发布设置</p>
|
||||
<% if @is_teacher %>
|
||||
<a href="javascript:void(0);" class="link-color-grey fr font-16 " title="编辑" onclick="$('#edit_publish_setting').show(); $('#show_publish_setting').hide();"><i class="fa fa-pencil mr15"></i></a>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-blue fr mr15" title="编辑" onclick="show_edit_setting();">编辑</a>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="ml30 mr30">
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
<div class="edu-con-top clearfix mb15">
|
||||
<p class="ml15 fl">评分设置</p>
|
||||
<% if @is_teacher %>
|
||||
<a href="javascript:void(0);" class="link-color-grey fr font-16 " title="编辑" onclick="$('#edit_score_setting').show(); $('#show_score_setting').hide();"><i class="fa fa-pencil mr15"></i></a>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="ml30 mr30">
|
||||
<div class="clearfix">
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
$("#show_anon_setting").html("<%= j(render :partial => 'show_anon_setting') %>").show();
|
||||
$("#show_score_setting").html("<%= j(render :partial => 'show_score_setting') %>");
|
||||
$("#edit_score_setting").html("<%= j(render :partial => 'edit_score_setting') %>");
|
||||
$("#edit_anon_setting").html("<%= j(render :partial => 'edit_anon_setting') %>").hide();
|
||||
|
||||
$("input[name='homework_evaluation_start']").datetimepicker({
|
||||
allowBlank:true,
|
||||
lang:'ch',
|
||||
format:'Y-m-d H:i',
|
||||
validateOnBlur:false
|
||||
});
|
||||
$("input[name='homework_evaluation_end']").datetimepicker({
|
||||
allowBlank:true,
|
||||
lang:'ch',
|
||||
format:'Y-m-d H:i',
|
||||
validateOnBlur:false
|
||||
});
|
||||
$("input[name='homework_appeal_time']").datetimepicker({
|
||||
allowBlank:true,
|
||||
lang:'ch',
|
||||
format:'Y-m-d H:i',
|
||||
validateOnBlur:false
|
||||
});
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
$("#show_late_setting").html("<%= j(render :partial => 'show_late_setting') %>").show();
|
||||
$("#edit_late_setting").html("<%= j(render :partial => 'edit_late_setting') %>").hide();
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
$("#show_public_setting").html("<%= j(render :partial => 'show_public_setting') %>").show();
|
||||
$("#edit_public_setting").html("<%= j(render :partial => 'edit_public_setting') %>").hide();
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
$("#show_publish_setting").html("<%= j(render :partial => 'show_publish_setting') %>").show();
|
||||
$("#edit_publish_setting").html("<%= j(render :partial => 'edit_publish_setting') %>").hide();
|
||||
<% unless @homework.publish_time.nil? %>
|
||||
$("#homework_late_setting").html('<div id="show_late_setting"><%= j(render :partial => 'show_late_setting') %></div><div class="none" id="edit_late_setting"><%= j(render :partial => 'edit_late_setting') %></div>');
|
||||
<% if @homework.homework_type != 4 %>
|
||||
$("#homework_anon_setting").html('<div id="show_anon_setting"><%= j(render :partial => 'show_anon_setting') %></div><div class="none" id="edit_anon_setting"><%= j(render :partial => 'edit_anon_setting') %></div>');
|
||||
$("#homework_score_setting").html('<div id="show_score_setting"><%= j(render :partial => 'show_score_setting') %></div><div class="none" id="edit_score_setting"><%= j(render :partial => 'edit_score_setting') %></div>');
|
||||
<% end %>
|
||||
$("#homework_public_setting").html('<div id="show_public_setting"><%= j(render :partial => 'show_public_setting') %></div><div class="none" id="edit_public_setting"><%= j(render :partial => 'edit_public_setting') %></div>');
|
||||
<% end %>
|
||||
$("input[name='homework_publish_time']").datetimepicker({
|
||||
allowBlank:true,
|
||||
lang:'ch',
|
||||
format:'Y-m-d H:i',
|
||||
validateOnBlur:false,
|
||||
onSelectDate:function() {
|
||||
$("#reset_publish_time").show();
|
||||
if($.trim($("input[name='homework_archive_time']").val()) == ""){
|
||||
var date = new Date(Date.parse($("input[name='homework_publish_time']").val().replace(/-/g, "/")));
|
||||
$("input[name='homework_archive_time']").val(formate_time(new Date(date.setMonth(date.getMonth()+1))));
|
||||
}
|
||||
},
|
||||
onSelectTime:function() {
|
||||
$("#reset_publish_time").show();
|
||||
if($.trim($("input[name='homework_archive_time']").val()) == ""){
|
||||
var date = new Date(Date.parse($("input[name='homework_publish_time']").val().replace(/-/g, "/")));
|
||||
$("input[name='homework_archive_time']").val(formate_time(new Date(date.setMonth(date.getMonth()+1))));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("input[name='homework_end_time']").datetimepicker({
|
||||
allowBlank:true,
|
||||
lang:'ch',
|
||||
format:'Y-m-d H:i',
|
||||
validateOnBlur:false,
|
||||
onSelectDate:function() {
|
||||
$("#reset_end_time").show();
|
||||
},
|
||||
onSelectTime:function() {
|
||||
$("#reset_end_time").show();
|
||||
}
|
||||
});
|
||||
|
||||
$("input[name='homework_archive_time']").datetimepicker({
|
||||
allowBlank:true,
|
||||
lang:'ch',
|
||||
format:'Y-m-d H:i',
|
||||
validateOnBlur:false
|
||||
});
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
$("#show_score_setting").html("<%= j(render :partial => 'show_score_setting') %>").show();
|
||||
$("#edit_score_setting").html("<%= j(render :partial => 'edit_score_setting') %>").hide();
|
||||
|
|
@ -14,110 +14,84 @@
|
|||
<%= link_to '作业详情', student_work_index_path(:homework => @homework.id), :class => 'fr font-12 mr15 color-blue mt3' %>
|
||||
</div>
|
||||
|
||||
<div class="edu-con-bg01 mt15" id="homework_publish_setting">
|
||||
<% if @is_new && @is_teacher %>
|
||||
<div class="none" id="show_publish_setting">
|
||||
<%= form_tag(homework_setting_homework_common_path(@homework), :method => "post", :id => 'homework_setting_form') do |f| %>
|
||||
<div class="edu-con-bg01 mt15" id="homework_publish_setting">
|
||||
<% edit_mode = @is_new && @is_teacher %>
|
||||
<div class="<%= edit_mode ? 'none' : '' %>" id="show_publish_setting">
|
||||
<%= render :partial => 'show_publish_setting' %>
|
||||
</div>
|
||||
<div id="edit_publish_setting">
|
||||
<div class="<%= edit_mode ? '' : 'none' %>" id="edit_publish_setting">
|
||||
<%= render :partial => 'edit_publish_setting' %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div id="show_publish_setting">
|
||||
<%= render :partial => 'show_publish_setting' %>
|
||||
</div>
|
||||
<div class="none" id="edit_publish_setting">
|
||||
<%= render :partial => 'edit_publish_setting' %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="edu-con-bg01 mt15" id="homework_late_setting">
|
||||
<% if @is_empty %>
|
||||
<div class="edu-con-top clearfix mb15 homework_setting">
|
||||
<p class="ml15 fl">补交设置</p>
|
||||
<span class="fr color-red none mr15"><%= @is_teacher ? '请先设置发布时间' : '还未设置,暂时无法查看' %></span>
|
||||
</div>
|
||||
<% else %>
|
||||
<div id="show_late_setting">
|
||||
</div>
|
||||
|
||||
<div class="edu-con-bg01 mt15" id="homework_late_setting">
|
||||
<div class="<%= edit_mode ? 'none' : '' %>" id="show_late_setting">
|
||||
<%= render :partial => 'show_late_setting' %>
|
||||
</div>
|
||||
<div class="none" id="edit_late_setting">
|
||||
<div class="<%= edit_mode ? '' : 'none' %>" id="edit_late_setting">
|
||||
<%= render :partial => 'edit_late_setting' %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% if @homework.homework_type != 4 %>
|
||||
<div class="edu-con-bg01 mt15" id="homework_anon_setting">
|
||||
<% if @is_empty %>
|
||||
<div class="edu-con-top clearfix mb15 homework_setting">
|
||||
<p class="ml15 fl">匿评设置</p>
|
||||
<span class="fr color-red none mr15"><%= @is_teacher ? '请先设置发布时间' : '还未设置,暂时无法查看' %></span>
|
||||
</div>
|
||||
<% else %>
|
||||
<div id="show_anon_setting">
|
||||
</div>
|
||||
|
||||
<% if @homework.homework_type != 4 %>
|
||||
<div class="edu-con-bg01 mt15" id="homework_anon_setting">
|
||||
<div class="<%= edit_mode ? 'none' : '' %>" id="show_anon_setting">
|
||||
<%= render :partial => 'show_anon_setting' %>
|
||||
</div>
|
||||
<div class="none" id="edit_anon_setting">
|
||||
<div class="<%= edit_mode ? '' : 'none' %>" id="edit_anon_setting">
|
||||
<%= render :partial => 'edit_anon_setting' %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="edu-con-bg01 mt15" id="homework_score_setting">
|
||||
<% if @homework.homework_type == 4 %>
|
||||
<div class="edu-con-top clearfix mb15">
|
||||
<p class="ml15 fl">评分设置</p>
|
||||
</div>
|
||||
<div class="ml30 mr30 pb10">
|
||||
<div class="clearfix pr">
|
||||
<ul>
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl mr10">最终成绩组成</label>
|
||||
</li>
|
||||
<li class="clearfix">
|
||||
<label class=" panel-form-label fl mr10">系统评分</label>
|
||||
<input type="text" disabled class="fl task-form-15 task-height-40 panel-box-sizing" value="100%" placeholder="100%" />
|
||||
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p>系统评分是根据学生的任务完成情况,按照百分比计算 <br/>
|
||||
例如实训任务5关,学生A完成3关,则最终成绩为 3 / 5 * 100 = 60分 <br/>
|
||||
注意:学生完成实训后,必须关联实训项目,否则成绩为零
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<% if @is_empty %>
|
||||
<div class="edu-con-top clearfix mb15 homework_setting">
|
||||
<p class="ml15 fl">评分设置</p>
|
||||
<span class="fr color-red none mr15"><%= @is_teacher ? '请先设置发布时间' : '还未设置,暂时无法查看' %></span>
|
||||
</div>
|
||||
<% else %>
|
||||
<div id="show_score_setting">
|
||||
<%= render :partial => 'show_score_setting' %>
|
||||
</div>
|
||||
<div class="none" id="edit_score_setting">
|
||||
<%= render :partial => 'edit_score_setting' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="edu-con-bg01 mt15" id="homework_public_setting">
|
||||
<% if @is_empty %>
|
||||
<div class="edu-con-top clearfix mb15 homework_setting">
|
||||
<p class="ml15 fl">公开设置</p>
|
||||
<span class="fr color-red none mr15"><%= @is_teacher ? '请先设置发布时间' : '还未设置,暂时无法查看' %></span>
|
||||
</div>
|
||||
<% else %>
|
||||
<div id="show_public_setting">
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="edu-con-bg01 mt15" id="homework_score_setting">
|
||||
<% if @homework.homework_type == 4 %>
|
||||
<div class="edu-con-top clearfix mb15">
|
||||
<p class="ml15 fl">评分设置</p>
|
||||
</div>
|
||||
<div class="ml30 mr30 pb10">
|
||||
<div class="clearfix pr">
|
||||
<ul>
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl mr10">最终成绩组成</label>
|
||||
</li>
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl mr10">系统评分</label>
|
||||
<input type="text" disabled class="fl task-form-15 task-height-40 panel-box-sizing" value="100%" placeholder="100%" />
|
||||
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p>系统评分是根据学生的任务完成情况,按照百分比计算 <br/>
|
||||
例如实训任务5关,学生A完成3关,则最终成绩为 3 / 5 * 100 = 60分 <br/>
|
||||
注意:学生完成实训后,必须关联实训项目,否则成绩为零
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="<%= edit_mode ? 'none' : '' %>" id="show_score_setting">
|
||||
<%= render :partial => 'show_score_setting' %>
|
||||
</div>
|
||||
<div class="<%= edit_mode ? '' : 'none' %>" id="edit_score_setting">
|
||||
<%= render :partial => 'edit_score_setting' %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="edu-con-bg01 mt15" id="homework_public_setting">
|
||||
<div class="<%= edit_mode ? 'none' : '' %>" id="show_public_setting">
|
||||
<%= render :partial => 'show_public_setting' %>
|
||||
</div>
|
||||
<div class="none" id="edit_public_setting">
|
||||
<div class="<%= edit_mode ? '' : 'none' %>" id="edit_public_setting">
|
||||
<%= render :partial => 'edit_public_setting' %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clearfix mt15 <%= edit_mode ? '' : 'none' %>" id="homework_setting_submit_block">
|
||||
<a href="javascript:void(0);" id="homework_setting_form_submit" class="task-btn task-btn-blue fr">提交</a>
|
||||
<a href="javascript:void(0);" onclick="s_op_confirm_box('<%= student_work_index_path(:homework => @homework.id) %>', '修改的内容将全部丢失<br/>是否确认取消保存')" class="task-btn fr mr10">取消</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
@ -430,11 +430,7 @@ RedmineApp::Application.routes.draw do
|
|||
get 'add_to_homework_bank'
|
||||
get 'publish_homework'
|
||||
get 'setting'
|
||||
post 'publish_setting'
|
||||
post 'late_setting'
|
||||
post 'anon_setting'
|
||||
post 'score_setting'
|
||||
post 'public_setting'
|
||||
post 'homework_setting'
|
||||
get 'set_public'
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -160,6 +160,25 @@ $(function(){
|
|||
validateOnBlur:false
|
||||
});
|
||||
|
||||
$("input[name='homework_evaluation_start']").datetimepicker({
|
||||
allowBlank:true,
|
||||
lang:'ch',
|
||||
format:'Y-m-d H:i',
|
||||
validateOnBlur:false
|
||||
});
|
||||
$("input[name='homework_evaluation_end']").datetimepicker({
|
||||
allowBlank:true,
|
||||
lang:'ch',
|
||||
format:'Y-m-d H:i',
|
||||
validateOnBlur:false
|
||||
});
|
||||
$("input[name='homework_appeal_time']").datetimepicker({
|
||||
allowBlank:true,
|
||||
lang:'ch',
|
||||
format:'Y-m-d H:i',
|
||||
validateOnBlur:false
|
||||
});
|
||||
|
||||
// $("#reset_publish_time").live('click', function(){
|
||||
// $("input[name='homework_publish_time']").val("");
|
||||
// $("#reset_publish_time").hide();
|
||||
|
|
@ -170,7 +189,7 @@ $(function(){
|
|||
// $("#reset_end_time").hide();
|
||||
// });
|
||||
|
||||
$("#publish_setting_form_submit").live('click', function(){
|
||||
$("#homework_setting_form_submit").live('click', function(){
|
||||
var myDate = new Date();
|
||||
var result = true;
|
||||
if($("input[name='homework_publish_time']").prop("disabled")==false && $.trim($("input[name='homework_publish_time']").val()) != ""){
|
||||
|
|
@ -215,53 +234,11 @@ $(function(){
|
|||
} else{
|
||||
$("#homework_archive_time_notice").hide();
|
||||
}
|
||||
} else if($.trim($("#show_evaluation_end").val()) != ""){
|
||||
var end_time = Date.parse($("#show_evaluation_end").val());
|
||||
var archive_time = Date.parse($("input[name='homework_archive_time']").val());
|
||||
if(archive_time <= end_time){
|
||||
$("#homework_archive_time_notice").html("<i class='fa fa-exclamation-circle mr5 color-orange'></i>作业结束时间应晚于匿评结束时间").show();
|
||||
result = false;
|
||||
} else{
|
||||
$("#homework_archive_time_notice").hide();
|
||||
}
|
||||
}else if($.trim($("input[name='homework_appeal_time']").val()) != ""){
|
||||
var end_time = Date.parse($("input[name='homework_appeal_time']").val());
|
||||
var archive_time = Date.parse($("input[name='homework_archive_time']").val());
|
||||
if(archive_time <= end_time){
|
||||
$("#homework_archive_time_notice").html("<i class='fa fa-exclamation-circle mr5 color-orange'></i>作业结束时间应晚于申诉结束时间").show();
|
||||
result = false;
|
||||
} else{
|
||||
$("#homework_archive_time_notice").hide();
|
||||
}
|
||||
} else{
|
||||
$("#homework_archive_time_notice").hide();
|
||||
}
|
||||
}
|
||||
|
||||
if(result){
|
||||
if($.trim($("input[name='homework_publish_time']").val()) == "" && $.trim($("input[name='homework_end_time']").val()) == ""){
|
||||
var htmlvalue = '<div class="task-popup" style="width:578px;"><div class="task-popup-title clearfix"><h3 class="fl color-grey">提示</h3><a href="javascript:void(0);" class="pop_close"><i class="fa fa-times-circle font-18 link-color-grey fr mt5"></i></a></div>'+
|
||||
'<div class="task-popup-content"><p class="task-popup-text-center font-16">发布时间为空,其他设置将不能编辑<br/>确认要保存发布设置吗?</p></div><div class="task-popup-submit clearfix"><a href="javascript:void(0);" onclick="hideModal();" class="task-btn fl">取消</a>'+
|
||||
'<a href="javascript:void(0);" class="task-btn task-btn-blue fr" onclick="$(\'#publish_setting_form\').submit(); hideModal();">确定</a></div></div>';
|
||||
pop_box_new(htmlvalue, 578, 205);
|
||||
} else{
|
||||
$("#publish_setting_form").submit();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#edit_allow_late_1").live('click', function(){
|
||||
$("#edit_late_notice").html("允许补交,则在结束日期之前,学生可以补交作品 <br/>是在提交截止时间之后才提交作品的学生,将被扣迟交分");
|
||||
$("input[name='homework_late_penalty']").val("5");
|
||||
});
|
||||
|
||||
$("#edit_allow_late_0").live('click', function(){
|
||||
$("#edit_late_notice").html("禁止补交,则在提交截止时间之后,学生不能再提交作品");
|
||||
$("input[name='homework_late_penalty']").val("0");
|
||||
});
|
||||
|
||||
$("#late_setting_form_submit").live('click', function(){
|
||||
var result = true;
|
||||
if($("input[name='homework_allow_late']:checked").val() == '1'){
|
||||
if($.trim($("input[name='homework_late_penalty']").val()) == ""){
|
||||
result = false;
|
||||
|
|
@ -277,97 +254,14 @@ $(function(){
|
|||
}
|
||||
}
|
||||
}
|
||||
if(result){
|
||||
$("#late_setting_form").submit();
|
||||
}
|
||||
});
|
||||
|
||||
$("input[name='homework_evaluation_start']").datetimepicker({
|
||||
allowBlank:true,
|
||||
lang:'ch',
|
||||
format:'Y-m-d H:i',
|
||||
validateOnBlur:false
|
||||
});
|
||||
$("input[name='homework_evaluation_end']").datetimepicker({
|
||||
allowBlank:true,
|
||||
lang:'ch',
|
||||
format:'Y-m-d H:i',
|
||||
validateOnBlur:false
|
||||
});
|
||||
$("input[name='homework_appeal_time']").datetimepicker({
|
||||
allowBlank:true,
|
||||
lang:'ch',
|
||||
format:'Y-m-d H:i',
|
||||
validateOnBlur:false
|
||||
});
|
||||
|
||||
$("input[name='homework_anonymous_comment']").live('click', function(){
|
||||
$("input[name='homework_evaluation_start']").datetimepicker({
|
||||
allowBlank:true,
|
||||
lang:'ch',
|
||||
format:'Y-m-d H:i',
|
||||
validateOnBlur:false
|
||||
});
|
||||
$("input[name='homework_evaluation_end']").datetimepicker({
|
||||
allowBlank:true,
|
||||
lang:'ch',
|
||||
format:'Y-m-d H:i',
|
||||
validateOnBlur:false
|
||||
});
|
||||
if($(this).is(':checked')){
|
||||
$(this).parent().parent('ul').find('input[type="text"]').removeAttr('disabled');
|
||||
$(this).parent().parent('ul').find('input[type="text"]').removeClass('disabled-bg');
|
||||
$("#anon_relate_setting_ul").show();
|
||||
var my_date = new Date();
|
||||
var end_date = new Date(Date.parse($("#show_end_time").val().replace(/-/g, "/")));
|
||||
var max_date = my_date > end_date ? my_date : end_date;
|
||||
$("input[name='homework_evaluation_start']").val(formate_time(new Date(max_date.setDate(max_date.getDate()+7))));
|
||||
$("input[name='homework_evaluation_end']").val(formate_time(new Date(max_date.setDate(max_date.getDate()+14))));
|
||||
$("input[name='homework_evaluation_num']").val("3");
|
||||
$("input[name='homework_absence_penalty']").val("2");
|
||||
} else{
|
||||
$(this).parent().parent('ul').find('input[type="text"]').attr('disabled', 'disabled');
|
||||
$(this).parent().parent('ul').find('input[type="text"]').addClass('disabled-bg');
|
||||
$("input[name='homework_evaluation_start']").val("");
|
||||
$("input[name='homework_evaluation_end']").val("");
|
||||
$("input[name='homework_evaluation_num']").val("0");
|
||||
$("input[name='homework_absence_penalty']").val("0");
|
||||
$("#anon_relate_setting_ul").hide();
|
||||
}
|
||||
});
|
||||
|
||||
$("input[name='homework_anonymous_appeal']").live('click', function(){
|
||||
$("input[name='homework_appeal_time']").datetimepicker({
|
||||
allowBlank:true,
|
||||
lang:'ch',
|
||||
format:'Y-m-d H:i',
|
||||
validateOnBlur:false
|
||||
});
|
||||
if($(this).is(':checked')){
|
||||
$(this).parent().parent('ul').find('input[type="text"]').removeAttr('disabled');
|
||||
$(this).parent().parent('ul').find('input[type="text"]').removeClass('disabled-bg');
|
||||
var my_date = new Date();
|
||||
var end_date = new Date(Date.parse($("input[name='homework_evaluation_end']").val().replace(/-/g, "/")));
|
||||
var max_date = my_date > end_date ? my_date : end_date;
|
||||
$("input[name='homework_appeal_time']").val(formate_time(new Date(max_date.setDate(max_date.getDate()+2))));
|
||||
$("input[name='homework_appeal_penalty']").val("2");
|
||||
} else{
|
||||
$(this).parent().parent('ul').find('input[type="text"]').attr('disabled', 'disabled');
|
||||
$(this).parent().parent('ul').find('input[type="text"]').addClass('disabled-bg');
|
||||
$("input[name='homework_appeal_time']").val("");
|
||||
$("input[name='homework_appeal_penalty']").val("0");
|
||||
}
|
||||
});
|
||||
|
||||
$("#anon_setting_form_submit").live('click', function(){
|
||||
var result = true;
|
||||
if($("input[name='homework_anonymous_comment']").is(':checked')){
|
||||
if($.trim($("input[name='homework_evaluation_start']").val()) == ""){
|
||||
$("#homework_evaluation_start_notice").html("<i class='fa fa-exclamation-circle mr5 color-orange'></i>匿评开始时间不能为空").show();
|
||||
result = false;
|
||||
} else{
|
||||
var end_time = Date.parse($("#show_end_time").val());
|
||||
var archive_time = Date.parse($("#show_archive_time").val());
|
||||
var end_time = Date.parse($("input[name='homework_end_time']").val());
|
||||
var archive_time = Date.parse($("input[name='homework_archive_time']").val());
|
||||
var eva_start = Date.parse($("input[name='homework_evaluation_start']").val());
|
||||
var eva_end = Date.parse($("input[name='homework_evaluation_end']").val());
|
||||
if(eva_start <= end_time){
|
||||
|
|
@ -418,7 +312,7 @@ $(function(){
|
|||
$("#homework_appeal_time_notice").html("<i class='fa fa-exclamation-circle mr5 color-orange'></i>申诉结束时间不能为空").show();
|
||||
result = false;
|
||||
} else{
|
||||
var archive_time = Date.parse($("#show_archive_time").val());
|
||||
var archive_time = Date.parse($("input[name='homework_archive_time']").val());
|
||||
var eva_end = Date.parse($("input[name='homework_evaluation_end']").val());
|
||||
var appeal_time = Date.parse($("input[name='homework_appeal_time']").val());
|
||||
if(eva_end >= appeal_time){
|
||||
|
|
@ -445,9 +339,37 @@ $(function(){
|
|||
}
|
||||
}
|
||||
}
|
||||
if(result){
|
||||
$("#anon_setting_form").submit();
|
||||
|
||||
if($("input[name='homework_final_mode']:checked").val() == '0'){
|
||||
var te_pro = (parseFloat($("select[name='te_proportion']").val()))*100;
|
||||
var ta_pro = (parseFloat($("select[name='ta_proportion']").val()))*100;
|
||||
var st_pro = (parseFloat($("select[name='st_proportion']").val()))*100;
|
||||
if($("select[name='sy_proportion']").length == 1){
|
||||
var sy_pro = (parseFloat($("select[name='sy_proportion']").val()))*100;
|
||||
} else{
|
||||
var sy_pro = 0;
|
||||
}
|
||||
if(parseInt(te_pro + ta_pro + st_pro + sy_pro) != 100){
|
||||
result = false;
|
||||
$("#homework_final_mode_notice").html("<i class='fa fa-exclamation-circle mr5 color-orange'></i>各评分比例之和应为100%").show();
|
||||
} else{
|
||||
$("#homework_final_mode_notice").hide();
|
||||
}
|
||||
}
|
||||
|
||||
if(result){
|
||||
$("#homework_setting_form").submit();
|
||||
}
|
||||
});
|
||||
|
||||
$("#edit_allow_late_1").live('click', function(){
|
||||
$("#edit_late_notice").html("允许补交,则在结束日期之前,学生可以补交作品 <br/>是在提交截止时间之后才提交作品的学生,将被扣迟交分");
|
||||
$("input[name='homework_late_penalty']").val("5");
|
||||
});
|
||||
|
||||
$("#edit_allow_late_0").live('click', function(){
|
||||
$("#edit_late_notice").html("禁止补交,则在提交截止时间之后,学生不能再提交作品");
|
||||
$("input[name='homework_late_penalty']").val("0");
|
||||
});
|
||||
|
||||
$("#homework_final_mode_1").live('click', function(){
|
||||
|
|
@ -460,33 +382,6 @@ $(function(){
|
|||
$("select.normal-bg").addClass("disabled-bg");
|
||||
});
|
||||
|
||||
$("#score_setting_form_submit").live('click', function(){
|
||||
var result = true;
|
||||
if($("input[name='homework_final_mode']:checked").val() == '0'){
|
||||
var te_pro = (parseFloat($("select[name='te_proportion']").val()))*100;
|
||||
var ta_pro = (parseFloat($("select[name='ta_proportion']").val()))*100;
|
||||
var st_pro = (parseFloat($("select[name='st_proportion']").val()))*100;
|
||||
if($("select[name='sy_proportion']").length == 1){
|
||||
var sy_pro = (parseFloat($("select[name='sy_proportion']").val()))*100;
|
||||
} else{
|
||||
var sy_pro = 0;
|
||||
}
|
||||
if(parseInt(te_pro + ta_pro + st_pro + sy_pro) != 100){
|
||||
result = false;
|
||||
$("#homework_final_mode_notice").html("<i class='fa fa-exclamation-circle mr5 color-orange'></i>各评分比例之和应为100%").show();
|
||||
} else{
|
||||
$("#homework_final_mode_notice").hide();
|
||||
}
|
||||
}
|
||||
if(result){
|
||||
$("#score_setting_form").submit();
|
||||
}
|
||||
});
|
||||
|
||||
$("#public_setting_form_submit").live('click', function(){
|
||||
$("#public_setting_form").submit();
|
||||
});
|
||||
|
||||
$(".group_member_li").live("dblclick",function(e){
|
||||
var doc = $(e.target).parents('.group_member_li');
|
||||
var id = doc.attr("data-id");
|
||||
|
|
@ -735,6 +630,20 @@ function submit_new_common_homework(type, edit_mode){
|
|||
}
|
||||
}
|
||||
|
||||
function show_edit_setting(){
|
||||
$('#edit_publish_setting').show();
|
||||
$('#show_publish_setting').hide();
|
||||
$('#edit_late_setting').show();
|
||||
$('#show_late_setting').hide();
|
||||
$('#edit_anon_setting').show();
|
||||
$('#show_anon_setting').hide();
|
||||
$('#edit_score_setting').show();
|
||||
$('#show_score_setting').hide();
|
||||
$('#edit_public_setting').show();
|
||||
$('#show_public_setting').hide();
|
||||
$('#homework_setting_submit_block').show();
|
||||
}
|
||||
|
||||
function setting_cancel_edit(fn){
|
||||
var htmlvalue = '<div class="task-popup" style="width:480px;"><div class="task-popup-title clearfix"><h3 class="fl color-grey">提示</h3><a href="javascript:void(0);" class="pop_close"><i class="fa fa-times-circle font-18 link-color-grey fr mt5"></i></a></div>'+
|
||||
'<div class="task-popup-content"><p class="task-popup-text-center font-16">修改的内容将全部丢失<br/>是否确认取消保存</p></div><div class="task-popup-submit clearfix"><a href="javascript:void(0);" onclick="hideModal();" class="task-btn fl">取消</a>'+
|
||||
|
|
|
|||
Loading…
Reference in New Issue