From a9235bef2f5c0574ee77fc1e1b837edfaae922ca Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 29 May 2015 15:37:23 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=8C=BF=E8=AF=84=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=EF=BC=8C=E5=BE=97=E5=88=86=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=BA=E6=88=91=E7=9A=84=E8=AF=84=E5=88=86=202=E3=80=81?= =?UTF-8?q?=E5=8C=BF=E8=AF=84=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E6=98=AF=E6=88=91=E7=9A=84=E4=BD=9C=E5=93=81=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=90=8D=E6=98=BE=E7=A4=BA=E4=B8=BA=E5=8C=BF=E5=90=8D?= =?UTF-8?q?=EF=BC=8C=E5=AD=A6=E5=8F=B7=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 5 +-- .../student_work/_evaluation_work.html.erb | 26 ++++++++++++ .../_evaluation_work_title.html.erb | 12 ++++++ .../student_work/_student_work_title.html.erb | 33 +++++++++++++++ app/views/student_work/index.html.erb | 40 +++---------------- public/stylesheets/courses.css | 2 + 6 files changed, 81 insertions(+), 37 deletions(-) create mode 100644 app/views/student_work/_evaluation_work.html.erb create mode 100644 app/views/student_work/_evaluation_work_title.html.erb create mode 100644 app/views/student_work/_student_work_title.html.erb diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index a9733c2d4..9def1c630 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -12,14 +12,13 @@ class StudentWorkController < ApplicationController @is_teacher = User.current.allowed_to?(:as_teacher,@course) #老师 || 非匿评作业 || 匿评结束 显示所有的作品 @show_all = @is_teacher || @homework.homework_type != 1 || @homework.homework_detail_manual.comment_status == 3 - #当前列表为匿评列表 - @is_evaluation = !@is_teacher && @homework.homework_type == 1 && @homework.homework_detail_manual.comment_status == 2 if @show_all @stundet_works = search_homework_member @homework.student_works.order("#{@order} #{@b_sort}"),@name else #学生 if @homework.homework_detail_manual.comment_status == 1 #未开启匿评,只显示我的作品 @stundet_works = @homework.student_works.where(:user_id => User.current.id) - elsif @homework.homework_detail_manual.comment_status == 2 #开启匿评,显示匿评作品和我的作品 + elsif @homework.homework_detail_manual.comment_status == 2 #匿评列表,显示匿评作品和我的作品 + @is_evaluation = true my_work = @homework.student_works.where(:user_id => User.current.id) @stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id} end diff --git a/app/views/student_work/_evaluation_work.html.erb b/app/views/student_work/_evaluation_work.html.erb new file mode 100644 index 000000000..2e12ae5a8 --- /dev/null +++ b/app/views/student_work/_evaluation_work.html.erb @@ -0,0 +1,26 @@ + + \ No newline at end of file diff --git a/app/views/student_work/_evaluation_work_title.html.erb b/app/views/student_work/_evaluation_work_title.html.erb new file mode 100644 index 000000000..a3b1cda41 --- /dev/null +++ b/app/views/student_work/_evaluation_work_title.html.erb @@ -0,0 +1,12 @@ +
  • + 学号 +
  • +
  • + 学生姓名 +
  • +
  • + 作品名称 +
  • +
  • + <%= link_to "我的评分","javascript:void(0)",:class => "c_dark f14 fb fl"%> +
  • \ No newline at end of file diff --git a/app/views/student_work/_student_work_title.html.erb b/app/views/student_work/_student_work_title.html.erb new file mode 100644 index 000000000..7cf5e5d01 --- /dev/null +++ b/app/views/student_work/_student_work_title.html.erb @@ -0,0 +1,33 @@ +
  • + 学号 +
  • +
  • + 学生姓名 +
  • +
  • + 作品名称 +
  • +
  • + <%= link_to "教师评分",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "c_dark f14 fb fl"%> + <% if @show_all && @order == "teacher_score"%> + + <% end%> +
  • +
  • + <%= link_to "教辅评分",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "c_dark f14 fb fl"%> + <% if @show_all && @order == "teaching_asistant_score"%> + + <% end%> +
  • +
  • + <%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "c_dark f14 fb fl"%> + <% if @show_all && @order == "student_score"%> + + <% end%> +
  • +
  • + <%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "final_score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "c_dark f14 fb fl"%> + <% if @show_all && @order == "final_score"%> + + <% end%> +
  • \ No newline at end of file diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index a0612fd53..92f6cdaa2 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -53,44 +53,16 @@
    <% @stundet_works.each do |student_work|%> - <%= render :partial => 'student_work',:locals => {:student_work => student_work}%> + <%= render :partial => (@is_evaluation ? 'evaluation_work' :'student_work'),:locals => {:student_work => student_work}%>
    <% end%> diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 4dc925519..4f8708120 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -635,6 +635,8 @@ a:hover.icon_add{background:url(images/icons.png) -20px -310px no-repeat;} .t_c{ text-align:center;} .hwork_tit{ width:240px; float:left; } .hwork_tit a{ width:255px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } +.hwork_tit_e{ width:440px; float:left; } +.hwork_tit_e a{ width:455px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } .hwork_code{ width:60px; text-align:center; margin-right:15px;} .hwork_code02{ width:60px; text-align:center; margin-right:10px;} a.hwork_center{ display:block; width:60px; text-align:center; margin-right:5px;overflow: hidden;}