Merge branch 'szzh' of http://git.trustie.net/jacknudt/trustieforge into szzh
This commit is contained in:
commit
188bb0c1a7
|
@ -175,6 +175,7 @@ class HomeworkCommonController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@homework_detail_manual.update_column('comment_status', 2)
|
@homework_detail_manual.update_column('comment_status', 2)
|
||||||
|
@homework_detail_manual.update_column('evaluation_start', Date.today)
|
||||||
@statue = 1
|
@statue = 1
|
||||||
# 匿评开启消息邮件通知
|
# 匿评开启消息邮件通知
|
||||||
send_message_anonymous_comment(@homework, m_status = 2)
|
send_message_anonymous_comment(@homework, m_status = 2)
|
||||||
|
@ -194,6 +195,7 @@ class HomeworkCommonController < ApplicationController
|
||||||
#关闭匿评
|
#关闭匿评
|
||||||
def stop_anonymous_comment
|
def stop_anonymous_comment
|
||||||
@homework_detail_manual.update_column('comment_status', 3)
|
@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(",") + ")"
|
work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")"
|
||||||
@homework.student_works.each do |student_work|
|
@homework.student_works.each do |student_work|
|
||||||
|
@ -274,7 +276,13 @@ class HomeworkCommonController < ApplicationController
|
||||||
|
|
||||||
#启动匿评参数设置
|
#启动匿评参数设置
|
||||||
def start_evaluation_set
|
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
|
end
|
||||||
|
|
||||||
#设置匿评参数
|
#设置匿评参数
|
||||||
|
@ -290,6 +298,9 @@ class HomeworkCommonController < ApplicationController
|
||||||
|
|
||||||
@homework_detail_manual.evaluation_num = params[:evaluation_num]
|
@homework_detail_manual.evaluation_num = params[:evaluation_num]
|
||||||
@homework_detail_manual.save
|
@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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<div class="markPopup" id="popbox02">
|
<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>
|
<span class="uploadText">匿评设置</span>
|
||||||
<div class="cl"></div>
|
<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('启动成功');
|
alert('启动成功');
|
||||||
<% if @user_activity_id == -1 %>
|
<% 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})%>");
|
$("#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%>");
|
init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>");
|
||||||
<% else %>
|
<% 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}) %>");
|
$("#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");
|
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
|
||||||
<% end %>
|
<% 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")%>');*/
|
/*$("#<%#= @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};
|
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');
|
showModal('ajax-modal', '350px');
|
||||||
$('#ajax-modal').siblings().remove();
|
$('#ajax-modal').siblings().remove();
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
alert('关闭成功');
|
alert('关闭成功');
|
||||||
<% if @user_activity_id == -1 %>
|
<% 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})%>");
|
$("#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%>");
|
init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>");
|
||||||
<% else %>
|
<% 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}) %>");
|
$("#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');
|
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity');
|
||||||
<% end %>
|
<% end %>
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
clickCanel();
|
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}) %>");
|
$("#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");
|
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|
|
@ -102,7 +102,7 @@
|
||||||
<div class="homepagePostDeadline">
|
<div class="homepagePostDeadline">
|
||||||
迟交扣分:<%= activity.late_penalty%>分
|
迟交扣分:<%= activity.late_penalty%>分
|
||||||
</div>
|
</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
|
匿评开启时间:<%= activity.homework_detail_manual.evaluation_start%> 00:00
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -111,7 +111,7 @@
|
||||||
<div class="homepagePostDeadline">
|
<div class="homepagePostDeadline">
|
||||||
缺评扣分:<%= activity.homework_detail_manual.absence_penalty%>分/作品
|
缺评扣分:<%= activity.homework_detail_manual.absence_penalty%>分/作品
|
||||||
</div>
|
</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
|
匿评关闭时间:<%= activity.homework_detail_manual.evaluation_end%> 23:59
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -172,7 +172,7 @@
|
||||||
</li>
|
</li>
|
||||||
<% if activity.anonymous_comment == 0 %>
|
<% if activity.anonymous_comment == 0 %>
|
||||||
<li>
|
<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>
|
||||||
<li>
|
<li>
|
||||||
<%= homework_anonymous_comment activity,-1,user_activity_id,course_activity %>
|
<%= homework_anonymous_comment activity,-1,user_activity_id,course_activity %>
|
||||||
|
|
|
@ -107,7 +107,7 @@
|
||||||
<div class="homepagePostDeadline">
|
<div class="homepagePostDeadline">
|
||||||
迟交扣分:<%= homework_common.late_penalty%>分
|
迟交扣分:<%= homework_common.late_penalty%>分
|
||||||
</div>
|
</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
|
匿评开启时间:<%= homework_common.homework_detail_manual.evaluation_start%> 00:00
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -116,7 +116,7 @@
|
||||||
<div class="homepagePostDeadline">
|
<div class="homepagePostDeadline">
|
||||||
缺评扣分:<%= homework_common.homework_detail_manual.absence_penalty%>分/作品
|
缺评扣分:<%= homework_common.homework_detail_manual.absence_penalty%>分/作品
|
||||||
</div>
|
</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
|
匿评关闭时间:<%= homework_common.homework_detail_manual.evaluation_end%> 23:59
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -177,7 +177,7 @@
|
||||||
</li>
|
</li>
|
||||||
<% if homework_common.anonymous_comment == 0 &&(comment_status == 0 || comment_status == 1)%>
|
<% if homework_common.anonymous_comment == 0 &&(comment_status == 0 || comment_status == 1)%>
|
||||||
<li>
|
<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>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if homework_common.anonymous_comment == 0%>
|
<% if homework_common.anonymous_comment == 0%>
|
||||||
|
|
Loading…
Reference in New Issue