Merge branch 'cxt_course' into 'develop'
匿评时其他人的评语不可见 See merge request !41
This commit is contained in:
commit
dd0c202f8c
|
@ -691,7 +691,11 @@ class StudentWorkController < ApplicationController
|
||||||
def show
|
def show
|
||||||
@score = student_work_score @work,User.current
|
@score = student_work_score @work,User.current
|
||||||
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
|
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
|
||||||
|
if @homework.homework_detail_manual.comment_status == 2 && !@is_teacher && @work.user != User.current
|
||||||
|
@student_work_scores = @work.student_works_scores.where("user_id = #{User.current.id} and reviewer_role = 3").order("updated_at desc")
|
||||||
|
else
|
||||||
@student_work_scores = student_work_score_record(@work)
|
@student_work_scores = student_work_score_record(@work)
|
||||||
|
end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
|
@ -867,6 +871,7 @@ class StudentWorkController < ApplicationController
|
||||||
@score = StudentWorksScore.find params[:score_id]
|
@score = StudentWorksScore.find params[:score_id]
|
||||||
@is_last = params[:is_last] == "true"
|
@is_last = params[:is_last] == "true"
|
||||||
@jour = @score.journals_for_messages.new(:user_id => User.current.id,:notes =>params[:message], :reply_id => 0)
|
@jour = @score.journals_for_messages.new(:user_id => User.current.id,:notes =>params[:message], :reply_id => 0)
|
||||||
|
@show_real_name = User.current.allowed_to?(:as_teacher, @score.student_work.homework_common.course) || User.current.admin? || @score.reviewer_role != 3 || @jour.user == User.current
|
||||||
if @jour.save
|
if @jour.save
|
||||||
@status = 1
|
@status = 1
|
||||||
else
|
else
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<%= link_to image_tag(url_to_avatar(jour.user), :width => "32", :height => "32"), user_path(jour.user),:class => "st_img fl" %>
|
<%= link_to image_tag(url_to_avatar(jour.user), :width => "32", :height => "32"), user_path(jour.user),:class => "st_img fl" %>
|
||||||
<div class="ping_back_tit">
|
<div class="ping_back_tit">
|
||||||
<a href="javascript:void(0);" class="c_blue fl" >
|
<a href="javascript:void(0);" class="c_blue fl" >
|
||||||
<%= link_to jour.user.show_name, user_path(jour.user), :title => jour.user.show_name, :class => "c_blue fl" %>
|
<%= link_to show_real_name ? jour.user.show_name : "匿名", user_path(jour.user), :title => jour.user.show_name, :class => "c_blue fl" %>
|
||||||
</a>
|
</a>
|
||||||
<% if jour.user==User.current || User.current.admin? %>
|
<% if jour.user==User.current || User.current.admin? %>
|
||||||
<%= link_to(l(:label_bid_respond_delete), destroy_score_reply_student_work_index_path(:jour_id => jour.id),
|
<%= link_to(l(:label_bid_respond_delete), destroy_score_reply_student_work_index_path(:jour_id => jour.id),
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<ul class="ping_box_ul <%= is_last ? '' : 'ping_line'%> fl">
|
<ul class="ping_box_ul <%= is_last ? '' : 'ping_line'%> fl">
|
||||||
<% show_real_name = @is_teacher || score.user == User.current || score.user.allowed_to?(:as_teacher,@course) || score.reviewer_role != 3 %>
|
<% show_real_name = @is_teacher || score.user == User.current || score.reviewer_role != 3 %>
|
||||||
<%= link_to image_tag(url_to_avatar(show_real_name ? score.user : ""), :width => "34", :height => "34"), show_real_name ? user_path(score.user) : "javascript:void(0)",:class => "ping_pic fl" %>
|
<%= link_to image_tag(url_to_avatar(show_real_name ? score.user : ""), :width => "34", :height => "34"), show_real_name ? user_path(score.user) : "javascript:void(0)",:class => "ping_pic fl" %>
|
||||||
|
<% show_real_score = @homework.score_open == 1 || @is_teacher || score.student_work.user == User.current %>
|
||||||
<div class="pingBoxTit">
|
<div class="pingBoxTit">
|
||||||
<%= link_to show_real_name ? score.user.show_name : "匿名", show_real_name ? user_path(score.user) : "javascript:void(0)", :title => show_real_name ? score.user.show_name : "匿评用户", :class => "linkBlue fl" %>
|
<%= link_to show_real_name ? score.user.show_name : "匿名", show_real_name ? user_path(score.user) : "javascript:void(0)", :title => show_real_name ? score.user.show_name : "匿评用户", :class => "linkBlue fl" %>
|
||||||
<span class="ml5 fl">
|
<span class="ml5 fl">
|
||||||
|
@ -9,7 +10,7 @@
|
||||||
<% unless score.score.nil? %>
|
<% unless score.score.nil? %>
|
||||||
<span class="ml20 fl">评分:</span>
|
<span class="ml20 fl">评分:</span>
|
||||||
<a href="javascript:void(0);" class="c_orange fl" >
|
<a href="javascript:void(0);" class="c_orange fl" >
|
||||||
<%= score.score%>分
|
<%= show_real_score ? score.score : "**" %>分
|
||||||
</a>
|
</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
<a href="javascript:void(0);" class="fr linkBlue mr5" onclick="$('#add_score_reply_<%= score.id%>').slideToggle();">回复</a>
|
<a href="javascript:void(0);" class="fr linkBlue mr5" onclick="$('#add_score_reply_<%= score.id%>').slideToggle();">回复</a>
|
||||||
|
@ -33,7 +34,8 @@
|
||||||
|
|
||||||
<div id="replay_histroy_<%= score.id%>">
|
<div id="replay_histroy_<%= score.id%>">
|
||||||
<% score.journals_for_messages.order("created_on desc").each do |jour|%>
|
<% score.journals_for_messages.order("created_on desc").each do |jour|%>
|
||||||
<%= render :partial => 'jour_replay',:locals => {:jour => jour}%>
|
<% show_real_name = @is_teacher || score.reviewer_role != 3 %>
|
||||||
|
<%= render :partial => 'jour_replay',:locals => {:jour => jour, :show_real_name => show_real_name || jour.user == User.current}%>
|
||||||
<% end%>
|
<% end%>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
|
@ -7,6 +7,7 @@ $('#score_<%= @work.id%>').peSlider({range: 'min'});
|
||||||
<%# else %>
|
<%# else %>
|
||||||
//$("#work_score_<%#= @score.id%>").html("<%#= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @new_score,:is_last => @is_last}) %>");
|
//$("#work_score_<%#= @score.id%>").html("<%#= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @new_score,:is_last => @is_last}) %>");
|
||||||
<%# end%>
|
<%# end%>
|
||||||
|
<% score_open = @is_teacher || @homework.score_open == 1 || @work.user == User.current %>
|
||||||
|
|
||||||
$("#score_list_<%= @work.id%>").html("<%=escape_javascript(render :partial => 'student_work_score_records', :locals => {:student_work_scores => @student_work_scores, :is_member_work => is_member_work}) %>");
|
$("#score_list_<%= @work.id%>").html("<%=escape_javascript(render :partial => 'student_work_score_records', :locals => {:student_work_scores => @student_work_scores, :is_member_work => is_member_work}) %>");
|
||||||
var num = $("#work_num_<%= @work.id%>").html();
|
var num = $("#work_num_<%= @work.id%>").html();
|
||||||
|
@ -19,14 +20,14 @@ $("#score_list_<%= @work.id%>").removeAttr("style");
|
||||||
$("#group_member_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'group_member_work', :locals => {:student_work => @work}) %>");
|
$("#group_member_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'group_member_work', :locals => {:student_work => @work}) %>");
|
||||||
<% else %>
|
<% else %>
|
||||||
<% anon_count = @work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>
|
<% anon_count = @work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>
|
||||||
$("#student_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'evaluation_un_group_member_work', :locals => {:st => @work, :anon_count => anon_count}) %>");
|
$("#student_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'evaluation_un_group_member_work', :locals => {:st => @work, :anon_count => anon_count, :score_open => score_open}) %>");
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
$("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_un_work',:locals => {:student_work => @work, :index => 1}) %>");
|
$("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_un_work',:locals => {:student_work => @work, :index => 1, :score_open => score_open}) %>");
|
||||||
$("#work_num_<%= @work.id%>").html(num);
|
$("#work_num_<%= @work.id%>").html(num);
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
$("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_work',:locals => {:student_work => @work, :index => 1}) %>");
|
$("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_work',:locals => {:student_work => @work, :index => 1, :score_open => score_open}) %>");
|
||||||
$("#work_num_<%= @work.id%>").html(num);
|
$("#work_num_<%= @work.id%>").html(num);
|
||||||
<% end%>
|
<% end%>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
$("#add_score_reply_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'add_score_reply', :locals => {:score => @score,:is_last => @is_last}) %>");
|
$("#add_score_reply_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'add_score_reply', :locals => {:score => @score,:is_last => @is_last}) %>");
|
||||||
<% if @status && @status == 1%>
|
<% if @status && @status == 1%>
|
||||||
$("#replay_histroy_<%= @score.id%>").prepend("<%= escape_javascript(render :partial => 'jour_replay', :locals => {:jour => @jour}) %>");
|
$("#replay_histroy_<%= @score.id%>").prepend("<%= escape_javascript(render :partial => 'jour_replay', :locals => {:jour => @jour, :show_real_name => @show_real_name}) %>");
|
||||||
$("#add_score_reply_<%= @score.id%>").hide();
|
$("#add_score_reply_<%= @score.id%>").hide();
|
||||||
<% else%>
|
<% else%>
|
||||||
alert("回复内容不能为空");
|
alert("回复内容不能为空");
|
||||||
|
|
Loading…
Reference in New Issue