修复老师评分时删除评论不可用#1574

course_group
sw 11 years ago
parent 66e2edef0a
commit 88764f1a4b

@ -433,8 +433,8 @@ class HomeworkAttachController < ApplicationController
#删除留言 #删除留言
def destroy_jour def destroy_jour
@homework = HomeworkAttach.find(params[:jour_id]) @homework = HomeworkAttach.find(params[:jour_id])
@course=@homework.bid.courses.first
@journal_destroyed = JournalsForMessage.find(params[:object_id]) @journal_destroyed = JournalsForMessage.find(params[:object_id])
@is_comprehensive_evaluation = @journal_destroyed.is_comprehensive_evaluation @is_comprehensive_evaluation = @journal_destroyed.is_comprehensive_evaluation
@journal_destroyed.destroy @journal_destroyed.destroy

@ -22,7 +22,7 @@
<span style="float:left"> <span style="float:left">
<%= l(:label_work_rating) %> <%= l(:label_work_rating) %>
</span> </span>
<%= render :partial => 'show_score', locals: {:stars => get_homework_score(jour.user,@homework ) } %> <%= render :partial => 'homework_attach/show_score', locals: {:stars => get_homework_score(jour.user,@homework ) } %>
<% end %> <% end %>
</span> </span>
<div class="cl"></div> <div class="cl"></div>

@ -1,23 +1,19 @@
//教师评论 //教师评论
<% if @add_jour.is_comprehensive_evaluation == 1 %> <% if @add_jour.is_comprehensive_evaluation == 1 %>
//$('#comprehensive_evaluation').html('<#%= escape_javascript(render(:partial => 'comprehensive_evaluation',
//:locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework,:teaher_score => @teaher_score} )) %>');
HoverLi(4); HoverLi(4);
$('#jour_count_4').html('<%= @comprehensive_evaluation.count %>') $('#jour_count_4').html('<%= @comprehensive_evaluation.count %>');
$('#tbc_04').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @comprehensive_evaluation,:show_score => true,:show_name => true,:is_jour => false})) %>') $('#tbc_04').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @comprehensive_evaluation,:show_score => true,:show_name => true,:is_jour => false})) %>');
//匿评 //匿评
<% elsif @add_jour.is_comprehensive_evaluation == 2 %> <% elsif @add_jour.is_comprehensive_evaluation == 2 %>
// $('#message').html('<#%= escape_javascript(render(:partial => 'showjour', :locals => {:jour =>@jour, :state => false,:homework => @homework} )) %>'); $('#add_jour').html('<%= escape_javascript(render(:partial => 'addjour', :locals => {:homework_attach => @homework, :sta => 0, :is_comprehensive_evaluation => @is_comprehensive_evaluation})) %>');
// $('#pre_show').html('<#%= escape_javascript(render(:partial => 'pre_show', :locals => {:content => nil})) %>');
$('#add_jour').html('<%= escape_javascript(render(:partial => 'addjour', :locals => {:homework_attach => @homework, :sta => 0, :is_comprehensive_evaluation => @is_comprehensive_evaluation})) %>')
HoverLi(5); HoverLi(5);
$('#jour_count_5').html('<%= @anonymous_comments.count %>') $('#jour_count_5').html('<%= @anonymous_comments.count %>');
$('#tbc_05').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @anonymous_comments,:show_score => true,:show_name => false,:is_jour => false})) %>') $('#tbc_05').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @anonymous_comments,:show_score => true,:show_name => false,:is_jour => false})) %>');
//留言 //留言
<% else %> <% else %>
HoverLi(3); HoverLi(3);
$('#jour_count_3').html('<%= @jours.count %>') $('#jour_count_3').html('<%= @jours.count %>');
$('#tbc_03').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @jour,:show_score => false,:show_name => true,:is_jour => true})) %>') $('#tbc_03').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @jour,:show_score => false,:show_name => true,:is_jour => true})) %>');
<% end %> <% end %>
$('#new_form_user_message').val(""); $('#new_form_user_message').val("");
$('#new_form_reference_user_id').val(""); $('#new_form_reference_user_id').val("");

@ -1,24 +1,19 @@
<% if @journal_destroyed.nil? %> <% if @journal_destroyed.nil? %>
alert('<%=l(:notice_failed_delete)%>'); alert('<%=l(:notice_failed_delete)%>');
<% else %> <% else %>
//教师评论 <% if @is_comprehensive_evaluation == 1 %>
<% if @is_comprehensive_evaluation == 1 %> HoverLi(4);
//$('#comprehensive_evaluation').html('<#%= escape_javascript(render(:partial => 'comprehensive_evaluation', $('#jour_count_4').html('<%= @comprehensive_evaluation.count %>');
//:locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework,:teaher_score => @teaher_score} )) %>'); $('#tbc_04').html('<%= escape_javascript(render(:partial => "homework_attach/jour",:locals => {:jours => @comprehensive_evaluation,:show_score => true,:show_name => true,:is_jour => false})) %>');
HoverLi(4); //匿评
$('#jour_count_4').html('<%= @comprehensive_evaluation.count %>') <% elsif @is_comprehensive_evaluation == 2 %>
$('#tbc_04').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @comprehensive_evaluation,:show_score => true,:show_name => true,:is_jour => false})) %>') HoverLi(5);
//匿评 $('#jour_count_5').html('<%= @anonymous_comments.count %>');
<% elsif @is_comprehensive_evaluation == 2 %> $('#tbc_05').html('<%= escape_javascript(render(:partial => "homework_attach/jour",:locals => {:jours => @anonymous_comments,:show_score => true,:show_name => false,:is_jour => false})) %>');
// $('#message').html('<#%= escape_javascript(render(:partial => 'showjour', :locals => {:jour =>@jour, :state => false,:homework => @homework} )) %>'); //留言
// $('#pre_show').html('<#%= escape_javascript(render(:partial => 'pre_show', :locals => {:content => nil})) %>'); <% else %>
HoverLi(5); HoverLi(3);
$('#jour_count_5').html('<%= @anonymous_comments.count %>') $('#jour_count_3').html('<%= @jours.count %>');
$('#tbc_05').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @anonymous_comments,:show_score => true,:show_name => false,:is_jour => false})) %>') $('#tbc_03').html('<%= escape_javascript(render(:partial => "homework_attach/jour",:locals => {:jours => @jour,:show_score => false,:show_name => true,:is_jour => true})) %>');
//留言 <% end %>
<% else %>
HoverLi(3);
$('#jour_count_3').html('<%= @jours.count %>')
$('#tbc_03').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @jour,:show_score => false,:show_name => true,:is_jour => true})) %>')
<% end %>
<% end %> <% end %>

Loading…
Cancel
Save