作业动态中的评分设置和匿评自动开启、关闭时间的自动刷新
This commit is contained in:
parent
c073e56b79
commit
65022f03cb
|
@ -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,8 +1,7 @@
|
||||||
<%= form_for('new_form', :remote => true, :method => :post,:url => add_score_student_work_path(work.id)) do |f|%>
|
<%= form_for('new_form', :remote => true, :method => :post,:url => add_score_student_work_path(work.id)) do |f|%>
|
||||||
<li >
|
<li >
|
||||||
<span class="tit_fb"> 评价:</span>
|
<span class="tit_fb"> 评价:</span>
|
||||||
<%= f.text_area 'user_message',:id =>"new_form_user_message_#{work.id}", :class => 'hwork_ping_text', :placeholder => l(:text_caracters_maximum,:count=>250),:maxlength => 250 %>
|
<%= f.text_area 'user_message', :class => 'hwork_ping_text', :placeholder => l(:text_caracters_maximum,:count=>250),:maxlength => 250 %>
|
||||||
<p id="hint_message_<%=work.id %>" style="margin-left: 67px;"></p>
|
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</li>
|
</li>
|
||||||
<li >
|
<li >
|
||||||
|
@ -17,24 +16,7 @@
|
||||||
<%= render :partial => 'student_work/student_work_attachment_form', :locals => {:work => work,:score => score} %>
|
<%= render :partial => 'student_work/student_work_attachment_form', :locals => {:work => work,:score => score} %>
|
||||||
</div>
|
</div>
|
||||||
<%end%>
|
<%end%>
|
||||||
<a href="javascript:void(0);" class="blue_n_btn fr evaluation_submit" id="submit_evaluation_<%=work.id %>" onclick="submit(<%=work.id %>);">提交</a>
|
<a href="javascript:void(0);" class="blue_n_btn fr evaluation_submit" onclick="$(this).parent().parent().submit();$('#about_hwork_<%= work.id%>').html('');">提交</a>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</li>
|
</li>
|
||||||
<% end%>
|
<% end%>
|
||||||
<script type="text/javascript">
|
|
||||||
function submit(id) {
|
|
||||||
<% if @is_teacher %>
|
|
||||||
$('#submit_evaluation_'+id).parent().parent().submit();
|
|
||||||
$('#about_hwork_'+id).html('');
|
|
||||||
<% else %>
|
|
||||||
if ($.trim($('#new_form_user_message_'+id).val()) =="") {
|
|
||||||
$('#hint_message_'+id).html("为了对其他学生的作品负责,请您务必填写评语");
|
|
||||||
$('#hint_message_'+id).css('color','#ff0000');
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
$('#submit_evaluation_'+id).parent().parent().submit();
|
|
||||||
$('#about_hwork_'+id).html('');
|
|
||||||
}
|
|
||||||
<% end %>
|
|
||||||
}
|
|
||||||
</script>
|
|
|
@ -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