From cc7a752623b3ff1eebd4f9adf3eb87321da89b59 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 17 Sep 2015 17:20:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B0=E5=A4=84=E9=99=84=E4=BB=B6=E3=80=81?= =?UTF-8?q?=E7=BC=BA=E8=AF=84=E3=80=81=E5=8C=BF=E8=AF=84=E3=80=81=E6=88=90?= =?UTF-8?q?=E7=BB=A9=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 29 +++++----------------- app/views/student_work/index.html.erb | 21 +++++++++++++--- public/javascripts/course.js | 14 +++++------ 3 files changed, 30 insertions(+), 34 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 4264f1439..c2a76fb4f 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -415,25 +415,7 @@ class StudentWorkController < ApplicationController sheet1 = book.create_worksheet :name => "homework" blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10 sheet1.row(0).default_format = blue - if @homework.homework_type == 0 #普通作业 - sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name), - l(:excel_t_score),l(:excel_ta_score),l(:excel_f_score),l(:excel_commit_time)]) - count_row = 1 - items.each do |homework| - sheet1[count_row,0]=homework.user.id - sheet1[count_row,1] = homework.user.lastname.to_s + homework.user.firstname.to_s - sheet1[count_row,2] = homework.user.login - sheet1[count_row,3] = homework.user.user_extensions.student_id - sheet1[count_row,4] = homework.user.mail - sheet1[count_row,5] = homework.name - sheet1[count_row,6] = homework.teacher_score.nil? ? l(:label_without_score) : format("%.2f",homework.teacher_score) - sheet1[count_row,7] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : format("%.2f",homework.teaching_asistant_score) - # sheet1[count_row,8] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score) - sheet1[count_row,8] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score) - sheet1[count_row,9] = format_time(homework.created_at) - count_row += 1 - end - elsif @homework.homework_type == 1 #匿评作业 + if @homework.homework_type == 1 #匿评作业 sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name), l(:excel_t_score),l(:excel_ta_score), l(:excel_n_score),l(:excel_f_score),l(:excel_commit_time)]) count_row = 1 @@ -453,7 +435,7 @@ class StudentWorkController < ApplicationController end elsif @homework.homework_type == 2 #编程作业 sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name), - l(:excel_t_score),l(:excel_ta_score), l(:excel_s_score),l(:excel_f_score),l(:excel_commit_time)]) + l(:excel_t_score),l(:excel_ta_score), l(:excel_s_score),l(:excel_n_score),l(:excel_f_score),l(:excel_commit_time)]) count_row = 1 items.each do |homework| sheet1[count_row,0]=homework.user.id @@ -464,9 +446,10 @@ class StudentWorkController < ApplicationController sheet1[count_row,5] = homework.name sheet1[count_row,6] = homework.teacher_score.nil? ? l(:label_without_score) : format("%.2f",homework.teacher_score) sheet1[count_row,7] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : format("%.2f",homework.teaching_asistant_score) - sheet1[count_row,8] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score) - sheet1[count_row,9] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score) - sheet1[count_row,10] = format_time(homework.created_at) + sheet1[count_row,8] = homework.system_score.nil? ? l(:label_without_score) : format("%.2f",homework.system_score) + sheet1[count_row,9] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score) + sheet1[count_row,10] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score) + sheet1[count_row,11] = format_time(homework.created_at) count_row += 1 end end diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index fee601b5f..fcd70fe83 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -48,10 +48,23 @@
  • diff --git a/public/javascripts/course.js b/public/javascripts/course.js index ea9501371..2882ccdcc 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -897,13 +897,13 @@ $(function(){ $("#about_project label").eq(1).remove(); - //附件下载提示 - $(".zip_download_alert").bind("mouseover",function(){ - $(this).next("div").show(); - }); - $(".zip_download_alert").bind("mouseout",function(){ - $(this).next("div").hide(); - }); + ////附件下载提示 + //$(".zip_download_alert").bind("mouseover",function(){ + // $(this).next("div").show(); + //}); + //$(".zip_download_alert").bind("mouseout",function(){ + // $(this).next("div").hide(); + //}); }); //匿评弹框取消按钮