From 0f61994252038b66528a98ca5c4bcb512f2d6800 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 12 May 2016 17:49:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=82=B9=E5=87=BB=E4=BD=9C=E4=B8=9A=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E4=BC=98=E7=A7=80=E6=8E=92=E8=A1=8C=E4=B8=AD=E5=AD=A6?= =?UTF-8?q?=E7=94=9F=E9=93=BE=E6=8E=A5=EF=BC=8C=E5=9C=A8=E6=89=93=E5=BC=80?= =?UTF-8?q?=E7=9A=84=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8=E4=B8=AD=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=AE=9A=E4=BD=8D=E5=88=B0=E8=AF=A5=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=B9=B6=E9=BB=98=E8=AE=A4=E6=89=93=E5=BC=80?= =?UTF-8?q?=E8=AF=A5=E4=BD=9C=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 4 +++- .../organizations/_org_course_homework.html.erb | 14 ++++++++++++-- .../student_work/_evaluation_un_work.html.erb | 1 + app/views/student_work/_student_work_list.html.erb | 2 +- app/views/users/_course_homework.html.erb | 4 ++-- app/views/users/_user_homework_detail.html.erb | 4 ++-- 6 files changed, 21 insertions(+), 8 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9b19b8c7c..bbf67f6a3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2997,9 +2997,11 @@ def homework_common_index_url_in_org(course_id) Setting.protocol + "://" + Setting.host_name + "/homework_common?course=" + course_id.to_s end -def student_work_index_url_in_org(homework_id, is_focus = '') +def student_work_index_url_in_org(homework_id, is_focus = '', show_work_id = '') if is_focus != '' Setting.protocol + "://" + Setting.host_name + "/student_work?homework=" + homework_id.to_s + "&is_focus=" + is_focus.to_s + elsif show_work_id != '' + Setting.protocol + "://" + Setting.host_name + "/student_work?homework=" + homework_id.to_s + "&show_work_id=" + show_work_id.to_s else Setting.protocol + "://" + Setting.host_name + "/student_work?homework=" + homework_id.to_s end diff --git a/app/views/organizations/_org_course_homework.html.erb b/app/views/organizations/_org_course_homework.html.erb index 8a780ea78..b4ca46959 100644 --- a/app/views/organizations/_org_course_homework.html.erb +++ b/app/views/organizations/_org_course_homework.html.erb @@ -159,8 +159,18 @@ <% end %> <% student_works.each_with_index do |sw, i| %>
- <%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_url_in_org(activity.id), :alt => "学生头像" %> - + + <% if User.current.member_of_course?(activity.course) || User.current.admin? || activity.is_open == 1 %> + <%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_url_in_org(activity.id, '', sw.id), :alt => "学生头像" %> + + <% else %> + <%= image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40", :title => '该作业的作品暂未公开') %> + + <% end %> <% score = sw.respond_to?("score") ? sw.score : (sw.final_score || 0) - sw.absence_penalty - sw.late_penalty %>

分数:<%=format("%.1f",score.to_i<0 ? 0 : score.to_i) %>分

diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb index 965d126ee..ad7f12efa 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -1,4 +1,5 @@ +