From acc3f6dadf38cc18a28fc05abb39bf35cf282046 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 2 Jul 2015 16:04:26 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=BF=9F=E4=BA=A4=E6=89=A3=E5=88=86=E3=80=81?= =?UTF-8?q?=E7=BC=BA=E8=AF=84=E6=89=A3=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/homework_common_helper.rb | 2 +- app/views/homework_common/_homework_common_form.html.erb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/homework_common_helper.rb b/app/helpers/homework_common_helper.rb index b9940f4be..465df62da 100644 --- a/app/helpers/homework_common_helper.rb +++ b/app/helpers/homework_common_helper.rb @@ -15,7 +15,7 @@ module HomeworkCommonHelper #教辅评分比例下拉框 def ta_proportion_option type = [] - i = 10 + i = 0 while i <= 100 option = [] option << i.to_s + "%" diff --git a/app/views/homework_common/_homework_common_form.html.erb b/app/views/homework_common/_homework_common_form.html.erb index fa45397f0..21ed8900c 100644 --- a/app/views/homework_common/_homework_common_form.html.erb +++ b/app/views/homework_common/_homework_common_form.html.erb @@ -47,7 +47,7 @@

基本规则设置(总分为100分)

\ 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 index 23e29b01b..0e4151065 100644 --- a/app/views/student_work/_student_work_title.html.erb +++ b/app/views/student_work/_student_work_title.html.erb @@ -36,8 +36,8 @@ <% end%>
  • - <%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "final_score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%> - <% if @show_all && @order == "final_score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "final_score", :sort => @score, :name => @name) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%> + <%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%> + <% if @show_all && @order == "score"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%> <% end%>
  • \ No newline at end of file From 194ab98361ab0f2d9acba4fbd83902bd4934583c Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 2 Jul 2015 17:44:58 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E6=88=91=E7=9A=84=E8=AF=84=E5=88=86?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 9a5e7c9fa..2815fc63e 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -21,7 +21,7 @@ class StudentWorkController < ApplicationController @stundet_works = search_homework_member @homework.student_works.select("*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name end else #剩余情况: 学生 && 非匿评作业 如果未提交作品,只能看到自己的,提交了作品,能看到所有作品 - my_work = @homework.student_works.select("*,final_score - absence_penalty - late_penalty as score").where(:user_id => User.current.id) + my_work = @homework.student_works.select("*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id) if my_work.empty? @stundet_works = [] else From 1e12b680275f404c1499ea48cd69d7399cc8b17f Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 3 Jul 2015 10:09:49 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E9=81=AE=E4=BD=8F=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/courses.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 0d956819b..177e8202d 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -654,7 +654,7 @@ a.down_btn{ border:1px solid #CCC; color:#999; padding:0px 5px; font-size:12px; a:hover.down_btn{ background:#14ad5a; color:#fff; border:1px solid #14ad5a;} .fr{ float:right;} .li_min_search{ float:right; margin-right:-10px;} -.info_ni{ width:100px; padding:5px;position: absolute;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;margin-left: 110px;margin-top: 10px;} +.info_ni{ width:100px; padding:5px;position: absolute;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;margin-left: 200px;margin-top: 10px;} /*返回顶部*/ .to_top{width: 19px;height: 74px;position: fixed;top: 50px;right: 1px;color: white;background: #15bccf; line-height: 1.2; padding-top: 10px;padding-left: 5px;font-size: 14px;cursor: pointer;} .hwork_num_ab{ width:120px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;min-height: 1px;} From 642fa8dd5d4747531d2f38b3f6a711ccce46ba48 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 3 Jul 2015 10:47:10 +0800 Subject: [PATCH 07/12] =?UTF-8?q?1=E3=80=81=E7=BC=BA=E8=AF=84=E3=80=81?= =?UTF-8?q?=E8=BF=9F=E4=BA=A4=E6=89=A3=E5=88=86=202=E3=80=81=E5=8C=BF?= =?UTF-8?q?=E8=AF=84=E6=8F=90=E7=A4=BA=E6=A1=86=E3=80=81=E6=9C=80=E7=BB=88?= =?UTF-8?q?=E6=88=90=E7=BB=A9=E8=AE=A1=E7=AE=97=E6=8F=90=E7=A4=BA=E6=A1=86?= =?UTF-8?q?=203=E3=80=81=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 34 +++++++++++++++---- app/controllers/student_work_controller.rb | 1 + app/views/student_work/_student_work.html.erb | 27 ++++++++++++++- app/views/student_work/add_score.js.erb | 16 +++++++-- app/views/student_work/index.html.erb | 2 +- public/javascripts/course.js | 15 ++++++-- public/stylesheets/courses.css | 3 +- 7 files changed, 85 insertions(+), 13 deletions(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 86f555daa..6b33a38ec 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -91,15 +91,37 @@ class HomeworkCommonController < ApplicationController @homework.end_time = params[:homework_common][:end_time] @homework.publish_time = params[:homework_common][:publish_time] @homework.homework_type = params[:homework_common][:homework_type] - @homework.late_penalty = params[:late_penalty] + unless @homework.late_penalty == params[:late_penalty] + @homework.student_works.where("late_penalty != 0").each do |student_work| + student_work.late_penalty = params[:late_penalty] + student_work.save + end + @homework.late_penalty = params[:late_penalty] + end @homework.course_id = @course.id #匿评作业相关属性 - @homework_detail_manual.ta_proportion = params[:ta_proportion] || 0.6 - @homework_detail_manual.evaluation_start = params[:evaluation_start] - @homework_detail_manual.evaluation_end = params[:evaluation_end] - @homework_detail_manual.evaluation_num = params[:evaluation_num] - @homework_detail_manual.absence_penalty = params[:absence_penalty] + if @homework.homework_type == 1 + @homework_detail_manual.ta_proportion = params[:ta_proportion] || 0.6 + @homework_detail_manual.evaluation_start = params[:evaluation_start] + @homework_detail_manual.evaluation_end = params[:evaluation_end] + @homework_detail_manual.evaluation_num = params[:evaluation_num] + unless @homework_detail_manual.absence_penalty == params[:absence_penalty] + if @homework_detail_manual.comment_status == 3 #当前作业处于匿评结束状态,修改缺评扣分才会修改每个作品应扣分的值 + @homework.student_works.where("absence_penalty != 0").each do |student_work| + student_work.absence_penalty = student_work.absence_penalty / @homework_detail_manual.absence_penalty * params[:absence_penalty].to_i + student_work.save + end + end + @homework_detail_manual.absence_penalty = params[:absence_penalty] + end + else #不是匿评作业,缺评扣分为0分,每个作品的缺评扣分改为0分,防止某些作业在结束匿评之后改为普通作业 + @homework.student_works.where("absence_penalty != 0").each do |student_work| + student_work.late_penalty = 0 + student_work.save + end + @homework_detail_manual.absence_penalty = 0 + end @homework.save_attachments(params[:attachments]) render_attachment_warning_if_needed(@homework) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 2815fc63e..954ab733f 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -42,6 +42,7 @@ class StudentWorkController < ApplicationController end end @homework_commons = @course.homework_commons.order("created_at desc") + @homework_commons = @course.homework_commons.order("created_at desc") @score = @b_sort == "desc" ? "asc" : "desc" respond_to do |format| format.html diff --git a/app/views/student_work/_student_work.html.erb b/app/views/student_work/_student_work.html.erb index 302c513b1..6e4cc65f1 100644 --- a/app/views/student_work/_student_work.html.erb +++ b/app/views/student_work/_student_work.html.erb @@ -39,8 +39,33 @@ <% end%> <% score = student_work.respond_to?("score") ? student_work.score : student_work.final_score - student_work.absence_penalty - student_work.late_penalty%> -
  • +
  • <%= score.nil? ? "--" : format("%.1f",score)%> + <% unless score.nil?%> + <% if @homework.homework_type == 1%> + +
    + 作品最终评分为 +  <%= student_work.final_score%> 分。 + 迟交扣分 +  <%= student_work.late_penalty%> 分, + 缺评扣分 +  <%= student_work.absence_penalty%> 分, + 最终成绩为 +  <%= score%> 分。 +
    + <% else%> + +
    + 作品最终评分为 +  <%= student_work.final_score%> 分。 + 迟交扣分 +  <%= student_work.late_penalty%> 分, + 最终成绩为 +  <%= score%> 分。 +
    + <% end%> + <% end%>
  • \ No newline at end of file diff --git a/app/views/student_work/add_score.js.erb b/app/views/student_work/add_score.js.erb index 0ba275d5d..4474ab3b5 100644 --- a/app/views/student_work/add_score.js.erb +++ b/app/views/student_work/add_score.js.erb @@ -16,14 +16,26 @@ $("#score_list_<%= @work.id%>").removeAttr("style"); $(function(){ + //匿评评分提示 $(".student_score_info").bind("mouseover",function(e){ //alert($(this).html()); $(this).find("div").show(); - $(this).find("div").css("top",e.pageY); - $(this).find("div").css("left",e.pageX); +// $(this).find("div").css("top",e.pageY); +// $(this).find("div").css("left",e.pageX); }); $(".student_score_info").bind("mouseout",function(e){ //alert($(this).html()); $(this).find("div").hide(); }); + //最终成绩提示 + $(".student_final_scor_info").bind("mouseover",function(e){ + //alert($(this).html()); + $(this).find("div").show(); +// $(this).find("div").css("top",e.pageY); +// $(this).find("div").css("left",e.pageX); + }); + $(".student_final_scor_info").bind("mouseout",function(e){ + //alert($(this).html()); + $(this).find("div").hide(); + }); }); diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 167829ec3..c5bc5858d 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -60,7 +60,7 @@ <%= link_to "附件", zipdown_assort_path(obj_class: @homework.class, obj_id: @homework, format: :json), remote: true, class: "down_btn fr zip_download_alert", :id => "download_homework_attachments" %> <% end%> -
    +
    使用 winzip 工具进行解压可能会导致 diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 172e630f0..c8e3b533e 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -788,13 +788,24 @@ $(function(){ $(".student_score_info").bind("mouseover",function(e){ //alert($(this).html()); $(this).find("div").show(); - $(this).find("div").css("top",e.pageY); - $(this).find("div").css("left",e.pageX); + //$(this).find("div").css("top",e.pageY); + //$(this).find("div").css("left",e.pageX); }); $(".student_score_info").bind("mouseout",function(e){ //alert($(this).html()); $(this).find("div").hide(); }); + //最终成绩提示 + $(".student_final_scor_info").bind("mouseover",function(e){ + //alert($(this).html()); + $(this).find("div").show(); + //$(this).find("div").css("top",e.pageY); + //$(this).find("div").css("left",e.pageX); + }); + $(".student_final_scor_info").bind("mouseout",function(e){ + //alert($(this).html()); + $(this).find("div").hide(); + }); $("#about_project label").eq(1).remove(); diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 177e8202d..c25821b80 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -654,7 +654,8 @@ a.down_btn{ border:1px solid #CCC; color:#999; padding:0px 5px; font-size:12px; a:hover.down_btn{ background:#14ad5a; color:#fff; border:1px solid #14ad5a;} .fr{ float:right;} .li_min_search{ float:right; margin-right:-10px;} -.info_ni{ width:100px; padding:5px;position: absolute;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;margin-left: 200px;margin-top: 10px;} +.info_ni_download{ width:100px; padding:5px;position: fixed;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;margin-left: 200px;margin-top: 10px;} +.info_ni{ width:100px; padding:5px;position: fixed;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;margin-left: 50px;margin-top: -5px;} /*返回顶部*/ .to_top{width: 19px;height: 74px;position: fixed;top: 50px;right: 1px;color: white;background: #15bccf; line-height: 1.2; padding-top: 10px;padding-left: 5px;font-size: 14px;cursor: pointer;} .hwork_num_ab{ width:120px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;min-height: 1px;} From d2b76e92f270942924f26ef379df2a781d65fd7e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 3 Jul 2015 10:55:22 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E5=B1=95=E5=BC=80=E5=90=8E=E6=88=90?= =?UTF-8?q?=E7=BB=A9=E5=BE=97=E5=88=86=E6=A1=86=E6=98=BE=E7=A4=BA=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/courses.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index c25821b80..be0e4de71 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -654,8 +654,8 @@ a.down_btn{ border:1px solid #CCC; color:#999; padding:0px 5px; font-size:12px; a:hover.down_btn{ background:#14ad5a; color:#fff; border:1px solid #14ad5a;} .fr{ float:right;} .li_min_search{ float:right; margin-right:-10px;} -.info_ni_download{ width:100px; padding:5px;position: fixed;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;margin-left: 200px;margin-top: 10px;} -.info_ni{ width:100px; padding:5px;position: fixed;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;margin-left: 50px;margin-top: -5px;} +.info_ni_download{ width:100px; padding:5px;position: absolute;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;margin-left: 200px;margin-top: 10px;} +.info_ni{ width:100px; padding:5px;position: absolute;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;margin-left: 50px;margin-top: -5px;} /*返回顶部*/ .to_top{width: 19px;height: 74px;position: fixed;top: 50px;right: 1px;color: white;background: #15bccf; line-height: 1.2; padding-top: 10px;padding-left: 5px;font-size: 14px;cursor: pointer;} .hwork_num_ab{ width:120px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;min-height: 1px;} From 4eb9ce6f0fe10f299ca9e3d355dfb7c187901852 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 3 Jul 2015 10:58:30 +0800 Subject: [PATCH 09/12] =?UTF-8?q?css=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/courses.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index be0e4de71..702140467 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -678,7 +678,7 @@ input#score{ width:40px;} .student_work_search{background-color: #64bdd9;color: white !important;padding: 2px 7px;margin-left: 10px;cursor: pointer; } /* 与我相关 */ -.new_icon{background:url(../images/new_icon.png) 0px 0px no-repeat; width:35px; height:15px; display:block;} +/*.new_icon{background:url(../images/new_icon.png) 0px 0px no-repeat; width:35px; height:15px; display:block;}*/ a.about_me{text-align:center;font-size:16px; color:#64bdd9; margin:10px 0 0 10px;} a:hover.about_me{ color:#0781b4;} From 2938679795fe0a31d3c5dd7ba0a3845eebf61f57 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 3 Jul 2015 11:41:53 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E8=BF=9F=E4=BA=A4=E5=92=8C=E7=BC=BA?= =?UTF-8?q?=E8=AF=84=E6=89=A3=E5=88=86=EF=BC=8C=E4=BF=AE=E6=94=B9=E4=B8=BA?= =?UTF-8?q?0=E5=90=8E=E7=BB=A7=E7=BB=AD=E4=BF=AE=E6=94=B9=E6=9C=89?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 6b33a38ec..7808691cf 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -92,7 +92,7 @@ class HomeworkCommonController < ApplicationController @homework.publish_time = params[:homework_common][:publish_time] @homework.homework_type = params[:homework_common][:homework_type] unless @homework.late_penalty == params[:late_penalty] - @homework.student_works.where("late_penalty != 0").each do |student_work| + @homework.student_works.where("created_at > #{@homework.end_time}").each do |student_work| student_work.late_penalty = params[:late_penalty] student_work.save end @@ -108,8 +108,10 @@ class HomeworkCommonController < ApplicationController @homework_detail_manual.evaluation_num = params[:evaluation_num] unless @homework_detail_manual.absence_penalty == params[:absence_penalty] if @homework_detail_manual.comment_status == 3 #当前作业处于匿评结束状态,修改缺评扣分才会修改每个作品应扣分的值 - @homework.student_works.where("absence_penalty != 0").each do |student_work| - student_work.absence_penalty = student_work.absence_penalty / @homework_detail_manual.absence_penalty * params[:absence_penalty].to_i + work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")" + @homework.student_works.each do |student_work| + absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count + student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0 student_work.save end end From 73d7ae4988c53b95545aabe2a85d8999f70b6761 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 3 Jul 2015 11:44:11 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E6=97=B6=E5=8C=BF=E8=AF=84=E6=89=A3=E5=88=86=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_common/_homework_common_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/homework_common/_homework_common_form.html.erb b/app/views/homework_common/_homework_common_form.html.erb index 21ed8900c..4542be9f5 100644 --- a/app/views/homework_common/_homework_common_form.html.erb +++ b/app/views/homework_common/_homework_common_form.html.erb @@ -103,7 +103,7 @@ <%= select_tag :absence_penalty,options_for_select(absence_penalty_option,homework.homework_detail_manual.absence_penalty), {:class => "fl mb10 h26 w70"} %>  分 -

    学生漏评1个作品将扣 2 

    +

    学生漏评1个作品将扣 <%= homework.homework_detail_manual.absence_penalty%> 

    From 981ad6e743d0b086d576f4934a25a044a166ab29 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 3 Jul 2015 11:49:02 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E7=BC=BA=E8=AF=84=E5=88=97=E8=A1=A8?= =?UTF-8?q?=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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 954ab733f..596d5ba51 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -257,7 +257,7 @@ class StudentWorkController < ApplicationController work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")" @stundet_works = StudentWork.find_by_sql("SELECT *,(all_count - has_count) AS absence FROM( SELECT * , - (SELECT evaluation_num FROM homework_detail_manuals WHERE homework_detail_manuals.homework_common_id = #{@homework.id}) AS all_count, + (SELECT COUNT(*) FROM `student_works_evaluation_distributions` WHERE user_id = student_works.user_id AND student_work_id IN #{work_ids}) AS all_count, (SELECT COUNT(*) FROM `student_works_scores` WHERE user_id = student_works.user_id AND student_work_id IN #{work_ids}) AS has_count FROM `student_works` WHERE homework_common_id = #{@homework.id}