From 9ccca401f6c85664243a66235b083dde700d915d Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 5 Jan 2016 16:47:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BF=E8=AF=84=E6=97=B6=E4=B9=9F=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=B3=BB=E7=BB=9F=E6=B5=8B=E8=AF=95=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_programing_work_show.html.erb | 86 +++++++++---------- .../student_work/_student_work_list.html.erb | 54 +++++++++--- 2 files changed, 83 insertions(+), 57 deletions(-) diff --git a/app/views/student_work/_programing_work_show.html.erb b/app/views/student_work/_programing_work_show.html.erb index f7ecb0ccf..d98a9fe0f 100644 --- a/app/views/student_work/_programing_work_show.html.erb +++ b/app/views/student_work/_programing_work_show.html.erb @@ -31,52 +31,50 @@
- <% if @is_teacher%> -
  • - - 测试结果: - -
    - <% work.student_work_tests.each_with_index do |test, index| %> -
    -

    - 第<%= work.student_work_tests.count - index%>次测试 -

    - - <%= test.created_at.to_s(:db) %> - -
    +
  • + + 测试结果: + +
    + <% work.student_work_tests.each_with_index do |test, index| %> +
    +

    + 第<%= work.student_work_tests.count - index%>次测试 +

    + + <%= test.created_at.to_s(:db) %> + +
    +
    + <% if test.status.to_i == -2 %> +
    + <%= test.results.first %> +
    + <% else %> +
    +
      + <% test.results.each_with_index do |x, i| %> +
    • + 测试<%=i+1%> + <% if x["status"].to_i != 0 %> + 测试错误! + 您的输出: + <%=x["result"]%> + 正确输出: + <%=x["output"]%> +
      + <% else %> + 测试正确! +
      + <% end %> +
    • + <% end %> +
    - <% if test.status.to_i == -2 %> -
    - <%= test.results.first %> -
    - <% else %> -
    -
      - <% test.results.each_with_index do |x, i| %> -
    • - 测试<%=i+1%> - <% if x["status"].to_i != 0 %> - 测试错误! - 您的输出: - <%=x["result"]%> - 正确输出: - <%=x["output"]%> -
      - <% else %> - 测试正确! -
      - <% end %> -
    • - <% end %> -
    -
    - <% end %> <% end %> -
    -
  • - <% end%> + <% end %> + +
  • <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && work.user != User.current )%> diff --git a/app/views/student_work/_student_work_list.html.erb b/app/views/student_work/_student_work_list.html.erb index 5598092e9..4f891f4c8 100644 --- a/app/views/student_work/_student_work_list.html.erb +++ b/app/views/student_work/_student_work_list.html.erb @@ -40,18 +40,46 @@ <% end%>
    - <% if @homework.homework_type != 3 && student_work.user == User.current && !@is_evaluation %> - <% if @homework.homework_type == 2%> - <%=render :partial => 'programing_work_show', :locals=> {:work => student_work, :score =>student_work_score(student_work,User.current),:student_work_scores => student_work.student_works_scores.order("updated_at desc")} %> - <% else %> - <%=render :partial => 'show' , :locals=> {:work => student_work, :score =>student_work_score(student_work,User.current),:student_work_scores => student_work.student_works_scores.order("updated_at desc")} %> - <% end %> - <% elsif @homework.homework_type == 3 %> - <% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %> - <% if pro && pro.student_work_id == student_work.id && !@is_evaluation %> - <%=render :partial => 'show' , :locals=> {:work => student_work, :score =>student_work_score(student_work,User.current),:student_work_scores => student_work.student_works_scores.order("updated_at desc")} %> - <% end %> - <% end %>
    -<% end%> \ No newline at end of file +<% end%> + \ No newline at end of file