Merge branch 'szzh' into develop
This commit is contained in:
commit
4faa3c42dc
|
@ -175,6 +175,7 @@ class HomeworkCommonController < ApplicationController
|
|||
end
|
||||
end
|
||||
@homework_detail_manual.update_column('comment_status', 2)
|
||||
@homework_detail_manual.update_column('evaluation_start', Date.today)
|
||||
@statue = 1
|
||||
# 匿评开启消息邮件通知
|
||||
send_message_anonymous_comment(@homework, m_status = 2)
|
||||
|
@ -194,6 +195,7 @@ class HomeworkCommonController < ApplicationController
|
|||
#关闭匿评
|
||||
def stop_anonymous_comment
|
||||
@homework_detail_manual.update_column('comment_status', 3)
|
||||
@homework_detail_manual.update_column('evaluation_end', Date.today)
|
||||
#计算缺评扣分
|
||||
work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")"
|
||||
@homework.student_works.each do |student_work|
|
||||
|
@ -274,7 +276,13 @@ class HomeworkCommonController < ApplicationController
|
|||
|
||||
#启动匿评参数设置
|
||||
def start_evaluation_set
|
||||
|
||||
if params[:user_activity_id]
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
else
|
||||
@user_activity_id = -1
|
||||
end
|
||||
@is_in_course = params[:is_in_course]
|
||||
@course_activity = params[:course_activity].to_i
|
||||
end
|
||||
|
||||
#设置匿评参数
|
||||
|
@ -290,6 +298,9 @@ class HomeworkCommonController < ApplicationController
|
|||
|
||||
@homework_detail_manual.evaluation_num = params[:evaluation_num]
|
||||
@homework_detail_manual.save
|
||||
@user_activity_id = params[:user_activity_id].to_i
|
||||
@is_in_course = params[:is_in_course].to_i
|
||||
@course_activity = params[:course_activity].to_i
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<div class="markPopup" id="popbox02">
|
||||
<%= form_for('new_form',:url => {:controller => 'homework_common',:action => 'set_evaluation_attr',:homework => @homework.id},:method => "post",:remote => true) do |f|%>
|
||||
<%= form_for('new_form',:url => {:controller => 'homework_common',:action => 'set_evaluation_attr',:homework => @homework.id,:user_activity_id=>user_activity_id,:is_in_course=>is_in_course,:course_activity=>course_activity},:method => "post",:remote => true) do |f|%>
|
||||
<span class="uploadText">匿评设置</span>
|
||||
<div class="cl"></div>
|
||||
|
||||
|
|
|
@ -1 +1,8 @@
|
|||
clickCanel();
|
||||
clickCanel();
|
||||
<% if @user_activity_id != -1 %>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@courae_activity}) %>");
|
||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
|
||||
<% else %>
|
||||
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework,:is_in_course => @is_in_course}) %>");
|
||||
init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>");
|
||||
<% end %>
|
|
@ -2,9 +2,11 @@
|
|||
alert('启动成功');
|
||||
<% if @user_activity_id == -1 %>
|
||||
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>");
|
||||
$("#evaluation_start_time_<%=@homework.id %>").html("匿评开启时间:<%=format_time(Time.now) %>");
|
||||
init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>");
|
||||
<% else %>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>");
|
||||
$("#evaluation_start_time_<%=@user_activity_id %>").html("匿评开启时间:<%=format_time(Time.now) %>");
|
||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
|
||||
<% end %>
|
||||
/*$("#<%#= @homework.id %>_start_anonymous_comment").replaceWith('<%#= escape_javascript(link_to "关闭匿评", alert_anonymous_comment_homework_common_path(@homework), remote: true, id:"#{@homework.id}_stop_anonymous_comment",:class => "postOptionLink")%>');*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'homework_common/set_evalutation_att') %>');
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'homework_common/set_evalutation_att',:locals => {:user_activity_id => @user_activity_id,:is_in_course => @is_in_course,:course_activity =>@course_activity,: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();
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
alert('关闭成功');
|
||||
<% if @user_activity_id == -1 %>
|
||||
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>");
|
||||
$("#evaluation_end_time_<%=@homework.id %>").html("匿评关闭时间:<%=format_time(Time.now) %>");
|
||||
init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>");
|
||||
<% else %>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>");
|
||||
$("#evaluation_end_time_<%=@user_activity_id %>").html("匿评关闭时间:<%=format_time(Time.now) %>");
|
||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity');
|
||||
<% end %>
|
||||
/*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
clickCanel();
|
||||
<% if @user_activity_id %>
|
||||
<% if @user_activity_id != -1 %>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@courae_activity}) %>");
|
||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
|
||||
<% else %>
|
||||
|
|
|
@ -102,7 +102,7 @@
|
|||
<div class="homepagePostDeadline">
|
||||
迟交扣分:<%= activity.late_penalty%>分
|
||||
</div>
|
||||
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;">
|
||||
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_start_time_<%=user_activity_id %>">
|
||||
匿评开启时间:<%= activity.homework_detail_manual.evaluation_start%> 00:00
|
||||
</div>
|
||||
</div>
|
||||
|
@ -111,7 +111,7 @@
|
|||
<div class="homepagePostDeadline">
|
||||
缺评扣分:<%= activity.homework_detail_manual.absence_penalty%>分/作品
|
||||
</div>
|
||||
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;">
|
||||
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_end_time_<%=user_activity_id %>">
|
||||
匿评关闭时间:<%= activity.homework_detail_manual.evaluation_end%> 23:59
|
||||
</div>
|
||||
</div>
|
||||
|
@ -172,7 +172,7 @@
|
|||
</li>
|
||||
<% if activity.anonymous_comment == 0 %>
|
||||
<li>
|
||||
<%= link_to("匿评设置", start_evaluation_set_homework_common_path(activity),:class => "postOptionLink", :remote => true) if activity.homework_detail_manual.comment_status == 1%>
|
||||
<%= link_to("匿评设置", start_evaluation_set_homework_common_path(activity,:user_activity_id => user_activity_id, :is_in_course => -1,:course_activity=>course_activity),:class => "postOptionLink", :remote => true) if activity.homework_detail_manual.comment_status == 1%>
|
||||
</li>
|
||||
<li>
|
||||
<%= homework_anonymous_comment activity,-1,user_activity_id,course_activity %>
|
||||
|
|
|
@ -107,7 +107,7 @@
|
|||
<div class="homepagePostDeadline">
|
||||
迟交扣分:<%= homework_common.late_penalty%>分
|
||||
</div>
|
||||
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;">
|
||||
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_start_time_<%=homework_common.id %>">
|
||||
匿评开启时间:<%= homework_common.homework_detail_manual.evaluation_start%> 00:00
|
||||
</div>
|
||||
</div>
|
||||
|
@ -116,7 +116,7 @@
|
|||
<div class="homepagePostDeadline">
|
||||
缺评扣分:<%= homework_common.homework_detail_manual.absence_penalty%>分/作品
|
||||
</div>
|
||||
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;">
|
||||
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_end_time_<%=homework_common.id %>">
|
||||
匿评关闭时间:<%= homework_common.homework_detail_manual.evaluation_end%> 23:59
|
||||
</div>
|
||||
</div>
|
||||
|
@ -177,7 +177,7 @@
|
|||
</li>
|
||||
<% if homework_common.anonymous_comment == 0 &&(comment_status == 0 || comment_status == 1)%>
|
||||
<li>
|
||||
<%= link_to("匿评设置", start_evaluation_set_homework_common_path(homework_common),:class => "postOptionLink", :remote => true)%>
|
||||
<%= link_to("匿评设置", start_evaluation_set_homework_common_path(homework_common, :is_in_course => is_in_course,:course_activity=>-1),:class => "postOptionLink", :remote => true)%>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if homework_common.anonymous_comment == 0%>
|
||||
|
|
Loading…
Reference in New Issue